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

cant seem to get a component updated if the event listener is applied to a method that doesnt submit a form


    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.1
    • Fix Version/s: 4.1.1
    • Component/s: Framework
    • Labels:
    • Environment:
      windows xp, maven 2 and latest snapshot release, firefox/IE, tapestry 4.1, 2gb of ram, etc


      The event doesnt seem to actually trigger invocation of a callback method on the server unless a form is submitted


      <span jwcid="@Shell" title="Foo 0.1" ajaxEnabled="true" browserLogLevel="DEBUG">
      <body jwcid="@Body">
      <form jwcid="f@Form" action="">
      <div id="mLink" style="background-color: yellow; width:100px;">
      click me

      <div style="border:1px solid black; height : 40px; width : 400px;" jwcid="refreshme@Any">
      <span jwcid="@If" condition="ognl:good">
      <span jwcid="@Insert" value="ognl: message"> the msg goes here </span>

      and the class
      import org.apache.tapestry.IRequestCycle;
      import org.apache.tapestry.annotations.EventListener;
      import org.apache.tapestry.annotations.Persist;
      import org.apache.tapestry.event.BrowserEvent;
      import org.apache.tapestry.html.BasePage;

      import java.text.MessageFormat;

      abstract public class Playground extends BasePage {
      abstract public boolean isGood();
      abstract public void setGood(boolean good);

      @Persist abstract public String getMessage();
      abstract public void setMessage(String message);

      @EventListener(events = "onclick", submitForm = "f", elements = "mLink")
      public void updateThings(IRequestCycle c) {
      BrowserEvent event = new BrowserEvent(c);
      setMessage("base page " + new java.util.Date());
      System.out.println(MessageFormat.format("x =


      , y=


      ", event.getPageX(), event.getPageY()));


      work. When you click the square a listener on the server (namely, updateThings) is called, the variable message is changed and a call to responseBuilder.updateComponent is honored and the values on the page are changed.

      Remove the form from the html, and remove the submitForm part from the EventListener annotation and a different ituation arrives where, amazingly, tapestry seems to be getting a valid (if empty) ajax response and theres no indication (on the console or the page ) that the listener was invoked




            • Assignee:
              jkuhnert Jesse Kuhnert
              starbuxman Joshua Long
            • Votes:
              0 Vote for this issue
              0 Start watching this issue


              • Created: