Tapestry
  1. Tapestry
  2. TAPESTRY-1046

EventListener invoke all listener inside a form eventhought only one event was trigger

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.1
    • Fix Version/s: 4.1.1
    • Component/s: Annotations
    • Labels:
      None
    • Environment:
      OS: Sun Solaris
      Tapestry version: 4.1.1

      Description

      I had a html template as folow:

      <form jwcid="myForm@Form" listener="listener:listener1">
      <div jwcid="valueDiv@Any" id="valueDiv" >
      <span jwcid="@Insert" value="myValue1" />
      <span jwcid="@Insert" value="myValue2" />
      <div>

      <button type="button" jwcid="btn1@Any" id="btn1" value="Hit me1" />
      <button type="button" jwcid="btn2@Any" id="btn2" value="Hit me2" />
      </form>

      And I declared in java file as folow:

      public abstract void setMyValue1(String s);
      public abstract void setMyValue2(String s);

      @EventListener(events = "onclick", targets = "btn1", submitForm = "myForm")
      public void listener1(IRequestCycle cycle) {
      setMyValue1( Math.random() + "" );
      }

      @EventListener(events = "onclick", targets = "btn2", submitForm = "myForm")
      public void listener2(IRequestCycle cycle) {
      setMyValue2( Math.random() + "" );
      }

      public void listener(IRequestCycle cycle) {
      System.out.println("do nothing");
      }

      After page rendered, If I click on one of two buttons 'Hit me1' or 'Hitme2' then I saw that all of three listener method were called.
      I dont known exactly this is a bug or not, maybe I wrong some thing but I have never see this problem if I use Submit component. Please let me known.

        Activity

        Hide
        Jesse Kuhnert added a comment -

        Fixed, thanks for the bug report..That was a big one! Expect the snapshot build to have a corrected version by 8/8/06.

        Show
        Jesse Kuhnert added a comment - Fixed, thanks for the bug report..That was a big one! Expect the snapshot build to have a corrected version by 8/8/06.

          People

          • Assignee:
            Jesse Kuhnert
            Reporter:
            dinh anh khoa
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development