Hello!

I'm still trying to get around the @EventListener.

In the working TimeTracker application (part of tapestry example
applications) i added the following snipets of code :

In Home.html , in the form (taskForm) :

<div><span jwcid="samplefield"></span></div>

In Home.html , outside the form :

<div jwcid="[EMAIL PROTECTED]">
       <h2 style="clear:left"><span jwcid="@Insert"
value="ognl:sampledescription"/></h2>
</div>

In the java file :

@Component(type="TextField" ,id="samplefield" ,
           bindings={"value=sampledescription"})
   public abstract TextField  getSamplefield();
   public abstract String getSampledescription();



@EventListener(events="onFocus",elements="samplefield",submitForm="taskForm",async=true)
   public void sampleDataChanged(IRequestCycle cycle) {
       cycle.getResponseBuilder().updateComponent("sampleUpdateBlock");
   }

Here is also the generated script :

dojo.event.connect(dojo.byId("samplefield"), "onFocus", function(e){
                   var content={beventname:"onFocus"};
                   tapestry.event.buildEventProperties(e, content);
                   if (!content["beventtarget.id"])
content["beventtarget.id"]="samplefield";


                   tapestry.form.submitAsync("taskForm", content);

               });



On doing the event nothing happens on the client side. I checked with
FireBug debugger and there is no request sent to server.
Also , i tried with "targets" instead of "elements" and i also tried other
events.

On the other hand , if i keep the text field  and the update block but the
event listener listens to the already working widget (autocompleter) of the
timetracker application the update block gets perfectly updated... (so at
least i'm certain that there are no typos)

I'm still digging into it... but if anybody knows an easier way to solve it
i'd be happy to hear it !

Thanks !

Alex

Reply via email to