I would like to keep the lastUpdated time in the browser so that new events
can be propagated to the browser. For this I am using a Zone with
zonerefresh mixin where I am trying to dynamically change the context passed
to the ZoneRefresh mixin.

The below approach does not work. I appreciate if anyone has any other
better way of solving this problem.

<t:zone t:id="poller" elementName="span" period="5" t:mixins="zoneRefresh"
t:context="${time}">
                
</t:zone>

within the onRefresh event handler, I would like to change the 'time'  

Object onZoneRefresh(Object[] context) {
ajaxRenderer.addCallback(new JavaScriptCallback() {
                                                @Override
                                                public void 
run(JavaScriptSupport jsSupport) {
                                                        JSONObject json = new 
JSONObject();
                                                        json.put("period", 5);
                                                        json.put("URL",
createEventLink(newTime));
                                                        
jsSupport.addInitializerCall(InitializationPriority.LATE,
"zoneRefresh", json)
                                                }
                                        });
}

private Object createEventLink(Long newTime){
      Link link = resources.createEventLink("zoneRefresh", newTime);
      return link.toAbsoluteURI();
         }

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Zone-Refresh-with-dynamic-context-tp5713719.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to