You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Jesse Kuhnert (JIRA)" <de...@tapestry.apache.org> on 2007/06/17 01:03:26 UTC

[jira] Updated: (TAPESTRY-1524) Lose EventListener handling if you update a component containing that EventListener target

     [ https://issues.apache.org/jira/browse/TAPESTRY-1524?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jesse Kuhnert updated TAPESTRY-1524:
------------------------------------

    Fix Version/s: 4.1.3

> Lose EventListener handling if you update a component containing that EventListener target
> ------------------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-1524
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1524
>             Project: Tapestry
>          Issue Type: Bug
>          Components: XHR/dhtml/Ajax
>    Affects Versions: 4.1.2
>         Environment: java 1.5.0_07, osx 10.4.9, tomcat 5.5.24
>            Reporter: Julian Wood
>            Priority: Minor
>             Fix For: 4.1.3
>
>
> It seems that if you update a component inside which there is another component on which there is an EventListener, you will lose that EventListener.
> For example:
> <div jwcid="myTable@Any">
>     <div id="nameHeader">Name<span jwcid="@Insert" value="ognl:sortAscending?' ^':' v'"/></div>
> </div>
>     @InitialValue("ognl:false")
>     @Persist
>     public abstract Boolean getSortAscending();
>     public abstract void setSortAscending(Boolean sortAscending);
>     @EventListener(elements = "nameHeader", events = "onclick", async = true)
>     public void sort(IRequestCycle cycle)
>     {
>         setSortAscending(!getSortAscending());
>         cycle.getResponseBuilder().updateComponent("myTable");
>     }
> So if you load this up in a browser, then click on 'Name v', it changes to 'Name ^' like it should. But if you click it again, it has lost it's EventListener, and 'Name ^' doesn't change. The ajax response didn't include this bit which creates and connects the event:
> tapestry.cleanConnect(dojo.byId("nameHeader"), "onclick", "event1702620775");
> tapestry.event1702620775=function(e){
> var content={beventname:"onclick"};
> tapestry.event.buildEventProperties(e, content);
> if (!content["beventtarget.id"]) content["beventtarget.id"]="nameHeader";
> tapestry.bind("/myapp/app?component=adminBillableItems&page=Admin&service=directevent&session=T", content);
>  };
> dojo.event.connect(dojo.byId("nameHeader"), "onclick", tapestry, "event1702620775");});

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org