i see you are using tapestry-jquery.

I've converted your example over to prototypejs and observe the following:

When submitting the form both alerts appear (zone2 first, zone1 2nd).

zone1's javascript event listener is triggered when zone2's zone is updated even though its body is not re-rendered.

You can test this by adding ${theTime} to the body of both zones and seeing which gets updated (where getTheTime(){return System.currentTimeMillis()})

I'm not sure if this is a bug or a misunderstanding, but I'd guess that the js event is triggered when any of the zone element's body is re-written, therefore since zone1 contains zone2, zone2's re-render is considered an update to zone1 as well - at least in the js/clientside.

another thing, be careful when constructing zone updates - the way you are doing it creates an additional zone2 within the original zone2, you should use 'addRender(clientId, zone2.getBody())' or 'addRender(zone2)' to avoid this and keep the desired DOM structure.

paul.

On 7/03/2012 2:37 AM, nquirynen wrote:
Hi,

I have this construction in my .tml (simplified):

<t:Zone t:id="zone1" id="zone1">
   <t:Zone t:id="zone2" id="zone2">
     <t:Form t:id="form" t:zone="zone2">
       <t:Submit />
     </t:Form>
   </t:Zone>
</t:Zone>

In my page class:

@InjectComponent
private Zone Zone2;

public void onSubmitFromForm() {
        ajaxResponseRenderer.addRender(zone2.getClientId(), zone2);
}


So I just want to update the inner zone (zone2). But it always updates
zone1.

I've also tested this:

$('#zone1').bind(Tapestry.ZONE_UPDATED_EVENT, function(event) {
        alert("zone1 updated");
});

$('#zone2').bind(Tapestry.ZONE_UPDATED_EVENT, function(event) {
        alert("zone2 updated");
});

Submitting the form results in an alert with 'zone1 updated'.

Is this normal behaviour and am I just doing it in a wrong way? Or maybe I'm
doing something else wrong?

Thanks,
Nathan


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Zone-update-triggers-update-on-parent-Zone-tp5541247p5541247.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



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

Reply via email to