I just grabbed the version of Tapestry that is linked form the main
tapestry home page.  I built the simplest example I could think of:

<html jwcid="@Header" title="literal:Test Page">
       <div id="receiver">
           Test Home Page
       </div>
       <div jwcid="[EMAIL PROTECTED]" element="literal:div">
           <div jwcid="@Insert" value="ognl:someValue"/>
       </div>
</html>

   @InitialValue("literal:original value")
   public abstract String getSomeValue();
   public abstract void setSomeValue(String val);

   @EventListener(elements="receiver", events="onclick")
   public void doSomething() {
       _log.debug("called eventListener");
       setSomeValue("update value");
       getRequestCycle().getResponseBuilder().updateComponent("updated");
   }

The event was firing as expected, but my listener method was never
getting called.  I tried every possible listener signature to no
avail.  Finally, in desperation, I added a Form component around both
divs and added submitForm="form1" and async=true to the EventListener
annotation and everything worked as expected, except that I don't
really want to have to rewind an entire form when processing an ajax
request that has nothing to do with a Form.  Surely, it should be
possible to use an EventListener outside of a form context?

While I'm at it, when I first started these experiments, I got an
ERROR statement in my logs every time the event would fire back to the
browser.  The error was something to do  with a missing markup filter
for text/xml charset="UTF-8".  I did eventually find some hivemind
sorcery that fixed it referenced in some other email to one of the
lists, but if basic EventListener functionality requires an XML
MarkupFilter, perhaps that ought to be included in the default
hivemind config that comes with tapestry.  There should definitely be
some mention made of it in the docs.

--sam

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to