Uploaded image for project: 'Tapestry'
  1. Tapestry
  2. TAPESTRY-1051

EventListener does not allow use of versions of methods with BrowserEvent and RequestCyle parameters

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.1, 4.1.1
    • 4.1.1
    • Annotations
    • None
    • XP
      Tomcat 5.0.1.9
      Java 1.5.0_01
      Tapestry 4.1 or 4.1.1 snapshot

    Description

      I've split this down into a very simple example:

      TestEventListener.hml:

      <html jwcid="@Shell" title="Tes Event Listener">

      <body jwcid="@Body">

      <form jwcid="myForm@Form">
      <div>
      <input id="test" type="button" value="Hi"/>
      </div>
      <div>
      <span jwcid="refreshme@Insert"
      value="ognl:clicked"
      id="refreshme"
      class=""/>
      </div>
      </form>

      </body>
      </html>

      TestEventListener.java

      package com.db.rdq.web.page;

      import org.apache.commons.logging.Log;
      import org.apache.commons.logging.LogFactory;
      import org.apache.tapestry.IExternalPage;
      import org.apache.tapestry.IRequestCycle;
      import org.apache.tapestry.annotations.EventListener;
      import org.apache.tapestry.annotations.InitialValue;
      import org.apache.tapestry.annotations.Persist;
      import org.apache.tapestry.event.BrowserEvent;
      import org.apache.tapestry.html.BasePage;

      public abstract class TestEventListener extends BasePage implements
      IExternalPage {

      @Persist
      @InitialValue("true")
      public abstract void setClicked(boolean bool);
      public abstract boolean getClicked();

      private static final Log log = LogFactory.getLog(TestEventListener.class);

      public void activateExternalPage(Object[] parameters, IRequestCycle cycle) {
      }

      @EventListener(events = "onclick", elements = "test", submitForm = "myForm")
      public void clicked()

      { log.info("Hi"); log.info(getClicked()); setClicked(!getClicked()); getRequestCycle().getResponseBuilder().updateComponent("refreshme"); }
      }

      This all works ok but if then update clicked to be:

      @EventListener(events = "onclick", elements = "test", submitForm = "myForm")
      public void clicked(BrowserEvent event){ log.info("Hi"); log.info(getClicked()); setClicked(!getClicked()); getRequestCycle().getResponseBuilder().updateComponent("refreshme"); }

      it blows up at runtime with the error:

      No listener method named 'clicked' suitable for no listener parameters found in $TestEventListener_61@20e54a[TestEventListener].

      I'm accesing thsi test using the URL:

      http://dbnycws72331.dbg.ads.db.com:8080/RDQ/app?service=external&page=TestEventListener

      yell if you need any more info.

      Attachments

        Activity

          People

            jkuhnert Jesse Kuhnert
            couldo Dom Couldwell
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: