Tapestry
  1. Tapestry
  2. TAPESTRY-1095

Button component breaks with EventListener

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.1.1
    • Fix Version/s: 4.1.1
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      WinXP SP 2; Tomcat 5.5

      Description

      When adding an EventListener to a button component, I get the following exception thrown:

      org.apache.hivemind.ApplicationRuntimeException
      Script symbol 'clientId' is required, but not specified.
      location: classpath:/org/apache/tapestry/ComponentEvent.script, line 7, column 47
      2 <!DOCTYPE script PUBLIC
      3 "-//Apache Software Foundation//Tapestry Script Specification 3.0//EN"
      4 "http://jakarta.apache.org/tapestry/dtd/Script_3_0.dtd">
      5 <script>
      6 <input-symbol key="component" required="yes" />
      7 <input-symbol key="clientId" required="yes" />
      8 <input-symbol key="url" />
      9 <input-symbol key="events" />
      10 <input-symbol key="formEvents" />
      11 <body>
      12 <unique>
      Stack Trace:

      • org.apache.tapestry.script.InputSymbolToken.write(InputSymbolToken.java:51)
      • org.apache.tapestry.script.AbstractToken.writeChildren(AbstractToken.java:71)
      • org.apache.tapestry.script.ParsedScript.execute(ParsedScript.java:83)
      • org.apache.tapestry.services.impl.ComponentEventConnectionWorker.linkComponent(ComponentEventConnectionWorker.java:132)
      • org.apache.tapestry.services.impl.ComponentEventConnectionWorker.renderComponent(ComponentEventConnectionWorker.java:97)
      • $ComponentRenderWorker_10dd06bdb12.renderComponent($ComponentRenderWorker_10dd06bdb12.java)
      • $ComponentRenderWorker_10dd06bdb11.renderComponent($ComponentRenderWorker_10dd06bdb11.java)
      • $ComponentRenderWorker_10dd06bdb2f.renderComponent($ComponentRenderWorker_10dd06bdb2f.java)
      • $ComponentRenderWorker_10dd06bdad6.renderComponent($ComponentRenderWorker_10dd06bdad6.java)
      • $ComponentRenderWorker_10dd06bdad5.renderComponent($ComponentRenderWorker_10dd06bdad5.java)
      • org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:678)
      • org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:131)
      • org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:491)
      • org.apache.tapestry.form.FormSupportImpl.render(FormSupportImpl.java:495)
      • org.apache.tapestry.form.Form.renderComponent(Form.java:220)
      • org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:676)
      • org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:131)
      • org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:491)
      • org.apache.tapestry.html.Body.renderComponent(Body.java:151)
      • org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:676)
      • org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:131)
      • org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:491)
      • org.apache.tapestry.html.Shell.renderComponent(Shell.java:64)
      • org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:676)
      • org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:131)
      • org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java:92)
      • org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:676)
      • org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:129)
      • org.apache.tapestry.AbstractPage.renderPage(AbstractPage.java:248)
      • org.apache.tapestry.engine.RequestCycle.renderPage(RequestCycle.java:402)
      • org.apache.tapestry.services.impl.DefaultResponseBuilder.renderResponse(DefaultResponseBuilder.java:117)
      • org.apache.tapestry.services.impl.ResponseRendererImpl.renderResponse(ResponseRendererImpl.java:33)
      • $ResponseRenderer_10dd06bda0e.renderResponse($ResponseRenderer_10dd06bda0e.java)
      • $ResponseRenderer_10dd06bda0d.renderResponse($ResponseRenderer_10dd06bda0d.java)
      • org.apache.tapestry.engine.PageService.service(PageService.java:68)
      • $IEngineService_10dd06bda7b.service($IEngineService_10dd06bda7b.java)
      • org.apache.tapestry.services.impl.EngineServiceInnerProxy.service(EngineServiceInnerProxy.java:77)
      • org.apache.tapestry.services.impl.EngineServiceOuterProxy.service(EngineServiceOuterProxy.java:72)
      • org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:241)
      • org.apache.tapestry.services.impl.InvokeEngineTerminator.service(InvokeEngineTerminator.java:60)
      • $WebRequestServicer_10dd06bda56.service($WebRequestServicer_10dd06bda56.java)
      • $WebRequestServicer_10dd06bda55.service($WebRequestServicer_10dd06bda55.java)
      • $WebRequestServicer_10dd06bda52.service($WebRequestServicer_10dd06bda52.java)
      • $WebRequestServicer_10dd06bda51.service($WebRequestServicer_10dd06bda51.java)
      • org.apache.tapestry.services.impl.WebRequestServicerPipelineBridge.service(WebRequestServicerPipelineBridge.java:56)
      • $ServletRequestServicer_10dd06bda38.service($ServletRequestServicer_10dd06bda38.java)
      • $ServletRequestServicer_10dd06bda37.service($ServletRequestServicer_10dd06bda37.java)
      • org.apache.tapestry.request.DecodedRequestInjector.service(DecodedRequestInjector.java:55)
      • $ServletRequestServicerFilter_10dd06bda34.service($ServletRequestServicerFilter_10dd06bda34.java)
      • $ServletRequestServicerFilter_10dd06bda33.service($ServletRequestServicerFilter_10dd06bda33.java)
      • $ServletRequestServicer_10dd06bda39.service($ServletRequestServicer_10dd06bda39.java)
      • org.apache.tapestry.multipart.MultipartDecoderFilter.service(MultipartDecoderFilter.java:52)
      • $ServletRequestServicerFilter_10dd06bda32.service($ServletRequestServicerFilter_10dd06bda32.java)
      • $ServletRequestServicerFilter_10dd06bda31.service($ServletRequestServicerFilter_10dd06bda31.java)
      • $ServletRequestServicer_10dd06bda39.service($ServletRequestServicer_10dd06bda39.java)
      • org.apache.tapestry.services.impl.SetupRequestEncoding.service(SetupRequestEncoding.java:53)
      • $ServletRequestServicerFilter_10dd06bda36.service($ServletRequestServicerFilter_10dd06bda36.java)
      • $ServletRequestServicerFilter_10dd06bda35.service($ServletRequestServicerFilter_10dd06bda35.java)
      • $ServletRequestServicer_10dd06bda39.service($ServletRequestServicer_10dd06bda39.java)
      • $ServletRequestServicer_10dd06bda2c.service($ServletRequestServicer_10dd06bda2c.java)
      • $ServletRequestServicer_10dd06bda2b.service($ServletRequestServicer_10dd06bda2b.java)
      • org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:123)
      • org.apache.tapestry.ApplicationServlet.doGet(ApplicationServlet.java:104)
      • javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
      • javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      • org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      • org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      • org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      • org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      • org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      • org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      • org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      • org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      • org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
      • org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
      • org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      • org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
      • org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
      • java.lang.Thread.run(Unknown Source)

      I have attached files that should make it easy to reproduce this.

      1. TestPage.java
        0.3 kB
        Peter Beshai
      2. TestPage.html
        0.3 kB
        Peter Beshai

        Activity

        Hide
        Grzegorz Mrowka added a comment -

        If you change:

        {at}EventListener(targets = "myButton", events="onclick")
        to{at}

        EventListener(elements = "myButton", events="onclick")

        then everything will be ok.

        Show
        Grzegorz Mrowka added a comment - If you change: {at}EventListener(targets = "myButton", events="onclick") to{at} EventListener(elements = "myButton", events="onclick") then everything will be ok.
        Hide
        Andreas Andreou added a comment -

        Peter, does this now work for you? Can we close this?

        Show
        Andreas Andreou added a comment - Peter, does this now work for you? Can we close this?
        Hide
        Peter Beshai added a comment -

        Sorry for the delay, the comments must've gone into my junkmail folder. I thought the 'elements' solution wasn't completely viable, since from my understanding, targets is used for tapestry components and elements for just regular html elements with ids. Regardless, I just downloaded the files attached here and without editing they worked (with the latest 4.1.1 snapshot). So it seems that this problem was fixed

        Show
        Peter Beshai added a comment - Sorry for the delay, the comments must've gone into my junkmail folder. I thought the 'elements' solution wasn't completely viable, since from my understanding, targets is used for tapestry components and elements for just regular html elements with ids. Regardless, I just downloaded the files attached here and without editing they worked (with the latest 4.1.1 snapshot). So it seems that this problem was fixed
        Hide
        Jesse Kuhnert added a comment -

        Hooray! I'm glad at least that completely rewriting all of the clientId logic did something good for a chance. (Andy did also help rewrite the form logic as well)

        Show
        Jesse Kuhnert added a comment - Hooray! I'm glad at least that completely rewriting all of the clientId logic did something good for a chance. (Andy did also help rewrite the form logic as well)

          People

          • Assignee:
            Jesse Kuhnert
            Reporter:
            Peter Beshai
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development