Hi All,
I recently came across something confusing regarding zone updates and
component injection ...
The problem is that tapestry allows you to inject and update a zone
which might not have rendered due to conditional logic, however when the
client attempts to update the zone an error is thrown.
For example:
tml:
<t:if test="mytest">
<t:zone t:id="myzone">
zone content
</t:zone>
</t:if>
java:
@InjectComponent
private Zone myzone;
public boolean isMytest()
{
return false;
}
MultiZoneUpdate onMyEvent()
{
Zone myzone2 = (Zone) resources.getEmbeddedComponent("myzone");
if (myzone != null)
log.debug("myzone is not null");
if (myzone2 != null)
log.debug("myzone2 is not null");
return new MultiZoneUpdate("myzone", myzone);
}
So even though the zone will never be rendered due to the conditional
logic (mytest) the component object is still realised ie not null. When
the client receives the XHR response from onMyEvent blackbird will show
the error: "Client exception processing response: TypeError: e is null"
which is tapestry.js not finding the ZoneManager for the zone.
My question is, since the component object is realised whether rendered
or not, is there any way to detect that the zone was never rendered
within the handling of onMyEvent (server side) ?
Regards, Paul.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org