Instead of using context, use a request parameter instead, so you avoid
having to deal with changing the URL Tapestry generated. In addition, I
don't think you will be able to use the ZoneRefresh mixin, so you'll need
a little bit of custom JavaScript, most probably adapted from
ZoneRefresh's code.
On Fri, 08 Jun 2012 11:20:28 -0300, tomandjerry
<sathishswaminat...@gmail.com> wrote:
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
--
Thiago H. de Paula Figueiredo
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org