Tapestry
  1. Tapestry
  2. TAPESTRY-2408

FormInjector doesn't work properly if the content contains multiple form elements

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: 5.0.12
    • Fix Version/s: 5.0.14
    • Component/s: Core Components
    • Labels:
      None
    • Environment:
      tapestry-core-5.0.12-20080424.110110-44.jar

      Description

      I've been trying to use FormInjector to create a dynamic form and not getting very far. To demonstrate this problem I've taken the FormInjectorDemo integration test and simply taken it out of the border element. It works fine until I add a t:label component in the block. It seems to me that as soon as there is more than one kind of component in the injected block, the inserted HTML is just "<li class="t-beaneditor-row"/>" without any form elements. Two textfields work, and a textfield and an 'any' component work, but not label or radio with a textfield. I suspect it's all form components.

      I'll attach the modified demo. Remove the label component to see it working. (Just remove the "t:" before the label) Add back in to see it broken again.

      1. FormInjectorDemo.java
        1 kB
        Andy Blower
      2. FormInjectorDemo.tml
        0.9 kB
        Andy Blower

        Issue Links

          Activity

          Hide
          Howard M. Lewis Ship added a comment -

          I've tried to reproduce this using the latest 5.0.14-SNAPSHOT, even removing the use of the layout component. No dice. Looking at the exception, it was because no proper ValidationDecorator environmental was available; I'm not sure when I added the code to provide the decorator (whether it was before or after .13).

          Show
          Howard M. Lewis Ship added a comment - I've tried to reproduce this using the latest 5.0.14-SNAPSHOT, even removing the use of the layout component. No dice. Looking at the exception, it was because no proper ValidationDecorator environmental was available; I'm not sure when I added the code to provide the decorator (whether it was before or after .13).
          Hide
          Andy Blower added a comment -

          Sorry Howard, it still seems to be an issue with 5.0.13 preview release. Sorry it took a while, I've just travelled to the US for a week of meetings (joy!) and the laptop wouldn't work until today. I've not had long to look at this but it definitely seems to be an issue.

          Show
          Andy Blower added a comment - Sorry Howard, it still seems to be an issue with 5.0.13 preview release. Sorry it took a while, I've just travelled to the US for a week of meetings (joy!) and the laptop wouldn't work until today. I've not had long to look at this but it definitely seems to be an issue.
          Hide
          Howard M. Lewis Ship added a comment -

          I'm pretty sure this will work using the 5.0.13-SNAPSHOT, any chance you could retest?

          Show
          Howard M. Lewis Ship added a comment - I'm pretty sure this will work using the 5.0.13-SNAPSHOT, any chance you could retest?
          Hide
          Andy Blower added a comment - - edited

          I spent quite a while investigating JIRA issues before I raised this, and that's why I linked to 2322 because it seemed like it should have fixed it, but I made sure that the fix for 2322 was in the snapshot I was using before raising this. I've now downloaded and confirmed that, yes, it's still a problem with the latest nightly snapshot. For the record I used these jar files:

          tapestry-annotations-5.0.12-20080513.110020-60.jar
          tapestry-core-5.0.12-20080513.110020-59.jar
          tapestry-ioc-5.0.12-20080513.110020-59.jar

          I was waiting a bit for the AjaxFormLoop to be checked in before updating. The only extra information I just noticed was this error message, I'm not sure why I didn't pick up on it before - I checked and it was present with the older snapshot.

          ERROR (RequestExceptionHandler:45 ) - Processing of request failed with uncaught exception: No object of type org.apache.tapestry.ValidationDecorator is available from the Environment. Available types are org.apache.tapestry.PageRenderSupport, org.apache.tapestry.internal.services.ClientBehaviorSupport.
          java.lang.RuntimeException: No object of type org.apache.tapestry.ValidationDecorator is available from the Environment. Available types are org.apache.tapestry.PageRenderSupport, org.apache.tapestry.internal.services.ClientBehaviorSupport.
          at org.apache.tapestry.internal.services.EnvironmentImpl.peekRequired(EnvironmentImpl.java:73)
          at $Environment_119e6f44ed6.peekRequired($Environment_119e6f44ed6.java)
          at $Environment_119e6f44e72.peekRequired($Environment_119e6f44e72.java)
          at org.apache.tapestry.corelib.components.Label._$environment_read_decorator(Label.java)
          at org.apache.tapestry.corelib.components.Label.access$100(Label.java:36)
          at org.apache.tapestry.corelib.components.Label$1.run(Label.java:79)
          at org.apache.tapestry.internal.services.HeartbeatImpl.end(HeartbeatImpl.java:49)
          at org.apache.tapestry.services.TapestryModule$26.renderMarkup(TapestryModule.java:1587)
          at $PartialMarkupRenderer_119e6f44efb.renderMarkup($PartialMarkupRenderer_119e6f44efb.java)
          at org.apache.tapestry.services.TapestryModule$25.renderMarkup(TapestryModule.java:1565)
          at $PartialMarkupRenderer_119e6f44efb.renderMarkup($PartialMarkupRenderer_119e6f44efb.java)
          at org.apache.tapestry.services.TapestryModule$24.renderMarkup(TapestryModule.java:1544)
          at $PartialMarkupRenderer_119e6f44efb.renderMarkup($PartialMarkupRenderer_119e6f44efb.java)
          at $PartialMarkupRenderer_119e6f44efa.renderMarkup($PartialMarkupRenderer_119e6f44efa.java)
          at org.apache.tapestry.internal.services.AjaxPartialResponseRendererImpl.renderPartialPageMarkup(AjaxPartialResponseRendererImpl.java:67)
          at $AjaxPartialResponseRenderer_119e6f44ef8.renderPartialPageMarkup($AjaxPartialResponseRenderer_119e6f44ef8.java)
          at org.apache.tapestry.internal.services.AjaxComponentEventRequestHandler.handle(AjaxComponentEventRequestHandler.java:98)
          at $ComponentEventRequestHandler_119e6f44ef6.handle($ComponentEventRequestHandler_119e6f44ef6.java)
          at org.apache.tapestry.internal.services.AjaxFilter.handle(AjaxFilter.java:42)
          at $ComponentEventRequestHandler_119e6f44ef7.handle($ComponentEventRequestHandler_119e6f44ef7.java)
          at org.apache.tapestry.services.TapestryModule$37.handle(TapestryModule.java:1988)
          at $ComponentEventRequestHandler_119e6f44ef7.handle($ComponentEventRequestHandler_119e6f44ef7.java)
          at $ComponentEventRequestHandler_119e6f44e9a.handle($ComponentEventRequestHandler_119e6f44e9a.java)
          at org.apache.tapestry.internal.services.ComponentEventDispatcher.dispatch(ComponentEventDispatcher.java:135)
          at $Dispatcher_119e6f44e9d.dispatch($Dispatcher_119e6f44e9d.java)
          at $Dispatcher_119e6f44e8f.dispatch($Dispatcher_119e6f44e8f.java)
          at org.apache.tapestry.services.TapestryModule$12.service(TapestryModule.java:939)
          at com.proquest.core.services.WebAppCoreModule$1.service(WebAppCoreModule.java:96)
          at $RequestFilter_119e6f44e8e.service($RequestFilter_119e6f44e8e.java)
          at $RequestHandler_119e6f44e90.service($RequestHandler_119e6f44e90.java)
          at org.apache.tapestry.internal.services.LocalizationFilter.service(LocalizationFilter.java:42)
          at $RequestHandler_119e6f44e90.service($RequestHandler_119e6f44e90.java)
          at org.apache.tapestry.services.TapestryModule$2.service(TapestryModule.java:588)
          at $RequestHandler_119e6f44e90.service($RequestHandler_119e6f44e90.java)
          at org.apache.tapestry.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:25)
          at $RequestHandler_119e6f44e90.service($RequestHandler_119e6f44e90.java)
          at org.apache.tapestry.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:79)
          at $RequestHandler_119e6f44e90.service($RequestHandler_119e6f44e90.java)
          at org.apache.tapestry.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:93)
          at org.apache.tapestry.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:84)
          at org.apache.tapestry.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:75)
          at org.apache.tapestry.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:106)
          at $RequestHandler_119e6f44e90.service($RequestHandler_119e6f44e90.java)
          at $RequestHandler_119e6f44e87.service($RequestHandler_119e6f44e87.java)
          at org.apache.tapestry.services.TapestryModule$11.service(TapestryModule.java:919)
          at org.apache.tapestry.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62)
          at $HttpServletRequestFilter_119e6f44e86.service($HttpServletRequestFilter_119e6f44e86.java)
          at $HttpServletRequestHandler_119e6f44e88.service($HttpServletRequestHandler_119e6f44e88.java)
          at $HttpServletRequestHandler_119e6f44e85.service($HttpServletRequestHandler_119e6f44e85.java)
          at org.apache.tapestry.TapestryFilter.doFilter(TapestryFilter.java:168)
          at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
          at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
          at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
          at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
          at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:722)
          at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:404)
          at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
          at org.mortbay.jetty.Server.handle(Server.java:324)
          at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
          at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828)
          at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
          at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
          at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
          at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
          at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)

          Show
          Andy Blower added a comment - - edited I spent quite a while investigating JIRA issues before I raised this, and that's why I linked to 2322 because it seemed like it should have fixed it, but I made sure that the fix for 2322 was in the snapshot I was using before raising this. I've now downloaded and confirmed that, yes, it's still a problem with the latest nightly snapshot. For the record I used these jar files: tapestry-annotations-5.0.12-20080513.110020-60.jar tapestry-core-5.0.12-20080513.110020-59.jar tapestry-ioc-5.0.12-20080513.110020-59.jar I was waiting a bit for the AjaxFormLoop to be checked in before updating. The only extra information I just noticed was this error message, I'm not sure why I didn't pick up on it before - I checked and it was present with the older snapshot. ERROR (RequestExceptionHandler:45 ) - Processing of request failed with uncaught exception: No object of type org.apache.tapestry.ValidationDecorator is available from the Environment. Available types are org.apache.tapestry.PageRenderSupport, org.apache.tapestry.internal.services.ClientBehaviorSupport. java.lang.RuntimeException: No object of type org.apache.tapestry.ValidationDecorator is available from the Environment. Available types are org.apache.tapestry.PageRenderSupport, org.apache.tapestry.internal.services.ClientBehaviorSupport. at org.apache.tapestry.internal.services.EnvironmentImpl.peekRequired(EnvironmentImpl.java:73) at $Environment_119e6f44ed6.peekRequired($Environment_119e6f44ed6.java) at $Environment_119e6f44e72.peekRequired($Environment_119e6f44e72.java) at org.apache.tapestry.corelib.components.Label._$environment_read_decorator(Label.java) at org.apache.tapestry.corelib.components.Label.access$100(Label.java:36) at org.apache.tapestry.corelib.components.Label$1.run(Label.java:79) at org.apache.tapestry.internal.services.HeartbeatImpl.end(HeartbeatImpl.java:49) at org.apache.tapestry.services.TapestryModule$26.renderMarkup(TapestryModule.java:1587) at $PartialMarkupRenderer_119e6f44efb.renderMarkup($PartialMarkupRenderer_119e6f44efb.java) at org.apache.tapestry.services.TapestryModule$25.renderMarkup(TapestryModule.java:1565) at $PartialMarkupRenderer_119e6f44efb.renderMarkup($PartialMarkupRenderer_119e6f44efb.java) at org.apache.tapestry.services.TapestryModule$24.renderMarkup(TapestryModule.java:1544) at $PartialMarkupRenderer_119e6f44efb.renderMarkup($PartialMarkupRenderer_119e6f44efb.java) at $PartialMarkupRenderer_119e6f44efa.renderMarkup($PartialMarkupRenderer_119e6f44efa.java) at org.apache.tapestry.internal.services.AjaxPartialResponseRendererImpl.renderPartialPageMarkup(AjaxPartialResponseRendererImpl.java:67) at $AjaxPartialResponseRenderer_119e6f44ef8.renderPartialPageMarkup($AjaxPartialResponseRenderer_119e6f44ef8.java) at org.apache.tapestry.internal.services.AjaxComponentEventRequestHandler.handle(AjaxComponentEventRequestHandler.java:98) at $ComponentEventRequestHandler_119e6f44ef6.handle($ComponentEventRequestHandler_119e6f44ef6.java) at org.apache.tapestry.internal.services.AjaxFilter.handle(AjaxFilter.java:42) at $ComponentEventRequestHandler_119e6f44ef7.handle($ComponentEventRequestHandler_119e6f44ef7.java) at org.apache.tapestry.services.TapestryModule$37.handle(TapestryModule.java:1988) at $ComponentEventRequestHandler_119e6f44ef7.handle($ComponentEventRequestHandler_119e6f44ef7.java) at $ComponentEventRequestHandler_119e6f44e9a.handle($ComponentEventRequestHandler_119e6f44e9a.java) at org.apache.tapestry.internal.services.ComponentEventDispatcher.dispatch(ComponentEventDispatcher.java:135) at $Dispatcher_119e6f44e9d.dispatch($Dispatcher_119e6f44e9d.java) at $Dispatcher_119e6f44e8f.dispatch($Dispatcher_119e6f44e8f.java) at org.apache.tapestry.services.TapestryModule$12.service(TapestryModule.java:939) at com.proquest.core.services.WebAppCoreModule$1.service(WebAppCoreModule.java:96) at $RequestFilter_119e6f44e8e.service($RequestFilter_119e6f44e8e.java) at $RequestHandler_119e6f44e90.service($RequestHandler_119e6f44e90.java) at org.apache.tapestry.internal.services.LocalizationFilter.service(LocalizationFilter.java:42) at $RequestHandler_119e6f44e90.service($RequestHandler_119e6f44e90.java) at org.apache.tapestry.services.TapestryModule$2.service(TapestryModule.java:588) at $RequestHandler_119e6f44e90.service($RequestHandler_119e6f44e90.java) at org.apache.tapestry.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:25) at $RequestHandler_119e6f44e90.service($RequestHandler_119e6f44e90.java) at org.apache.tapestry.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:79) at $RequestHandler_119e6f44e90.service($RequestHandler_119e6f44e90.java) at org.apache.tapestry.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:93) at org.apache.tapestry.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:84) at org.apache.tapestry.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:75) at org.apache.tapestry.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:106) at $RequestHandler_119e6f44e90.service($RequestHandler_119e6f44e90.java) at $RequestHandler_119e6f44e87.service($RequestHandler_119e6f44e87.java) at org.apache.tapestry.services.TapestryModule$11.service(TapestryModule.java:919) at org.apache.tapestry.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62) at $HttpServletRequestFilter_119e6f44e86.service($HttpServletRequestFilter_119e6f44e86.java) at $HttpServletRequestHandler_119e6f44e88.service($HttpServletRequestHandler_119e6f44e88.java) at $HttpServletRequestHandler_119e6f44e85.service($HttpServletRequestHandler_119e6f44e85.java) at org.apache.tapestry.TapestryFilter.doFilter(TapestryFilter.java:168) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:722) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:404) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139) at org.mortbay.jetty.Server.handle(Server.java:324) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395) at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)
          Hide
          Howard M. Lewis Ship added a comment -

          Is this still a problem in the current nightly snapshot? Looks like TAPESTRY-2322 has the fix.

          Show
          Howard M. Lewis Ship added a comment - Is this still a problem in the current nightly snapshot? Looks like TAPESTRY-2322 has the fix.

            People

            • Assignee:
              Howard M. Lewis Ship
              Reporter:
              Andy Blower
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development