xhr - javascriptSupport.addScript should work without any zone updates
----------------------------------------------------------------------
Key: TAP5-1406
URL: https://issues.apache.org/jira/browse/TAP5-1406
Project: Tapestry 5
Issue Type: Improvement
Components: tapestry-core
Affects Versions: 5.2.4
Reporter: Paul Stanton
If you have an xhr event handler which returns null, but does add a script to
the render, the script should still be executed.
currently I have to make sure that I perform at least one zone update when
returning a MultiZoneUpdate, ie if I were to return null the script would not
be executed on the client.
This forces me to rely on a dummy zone hack for cases when all i want to do is
call a script.
eg
private MultiZoneUpdate onSomething()
{
pageRenderQueue.addPartialMarkupRendererFilter(new
PartialMarkupRendererFilter()
{
public void renderMarkup(MarkupWriter writer,
JSONObject reply, PartialMarkupRenderer renderer)
{
javascriptSupport.addScript("alert('here');");
renderer.renderMarkup(writer, reply);
}
});
return null;
}
^ the alert would not show
private MultiZoneUpdate onSomething()
{
pageRenderQueue.addPartialMarkupRendererFilter(new
PartialMarkupRendererFilter()
{
public void renderMarkup(MarkupWriter writer,
JSONObject reply, PartialMarkupRenderer renderer)
{
javascriptSupport.addScript("alert('here');");
renderer.renderMarkup(writer, reply);
}
});
return new MultiZoneUpdate("dummyZone", dummyZone);
}
^ the alert would show provided dummyZone exists.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.