Dear Listeners!

I have a problem with nested zones and eventlinks and the default id
generation of the zone id after zone updates. If the parameter id of the
zone is bound than everything works fine. But in some situations I cannot
provide a unique zone id. (e.g. Loops, ...).

In the beginRender of the AbstractComponentEventLink the function
clientBehaviorSupport.linkZone(getClientId(), zone, link); gets called.
Afterwards the zoneId is bound to the eventlink in the javascript
updateZoneOnEvent function with: var zoneElement = zoneId == '^' ?
$(element).up('.t-zone') : $(zoneId);
Due to the default id generation in the zone component the eventlink's zone
parameter referes to a zone id that does not exists anymore.

Please have a look on this example:

public class TestPage
{
    @InjectComponent
    private Zone outerZone, innerZone;

    @OnEvent(value = "refreshOuterZone")
    Object onRefreshOuterZone()
    {
        return outerZone;
    }

    @OnEvent(value = "refreshInnerZone")
    Object onRefreshInnerZone()
    {
        return innerZone;
    }
}

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"; xmlns:t="
http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";
      xmlns:p="tapestry:parameter">

<body>
<t:eventLink event="refreshOuterZone" zone="outerZone">Refresh Outer
Zone</t:eventLink>
<t:zone t:id="outerZone" update="show">
<t:eventLink event="refreshInnerZone" zone="innerZone">Refresh Inner
Zone</t:eventLink>
<t:zone t:id="innerZone" update="show">
<p>I am the inner Zone</p>
</t:zone>
</t:zone>
</body>
</html>

Maybe the eventlink could get a zone component and not just the name of the
zone to access the 'correct' client id of the zone in the eventlink.

Best regards,
Gerold

Reply via email to