Simple... efficient... I like it !
Thanks !

On 1 July 2011 19:26, Taha Hafeez <tawus.tapes...@gmail.com> wrote:

> Hi
>
> Just set javascript id on the inner zone.
>
> <t:actionlink t:id="zoneOne" t:zone="zone1">link1</t:actionlink>
> <t:zone t:id="zone1">
>   <t:actionlink t:id="zoneTwo"*
> id='zoneTwo'*t:zone="zone2">link2</t:actionlink>
>   <t:zone t:id="zone2">
>  ${count}
>  </t:zone>
> </t:zone>
>
> This keeps the javascript id for the zone constant across zone updates
>
> regards
> Taha
>
> 2011/7/1 Clément Uster <clement.us...@gmail.com>
>
> > Hi all,
> >
> > I'm encountering a problem with zones, I have a specific case where a
> zone
> > is embedded in another zone.
> > I have two actionlinks, the first updates the first zone and the second
> one
> > updates the second zone.
> > I think the best is to read the code :)
> >
> > tml
> > <t:actionlink t:id="zoneOne" t:zone="zone1">link1</t:actionlink>
> > <t:zone t:id="zone1">
> >   <t:actionlink t:id="zoneTwo" t:zone="zone2">link2</t:actionlink>
> >   <t:zone t:id="zone2">
> >  ${count}
> >   </t:zone>
> > </t:zone>
> >
> > java
> > @Persist
> > @Property
> > private int count;
> >
> > @Component
> > private Zone zone1;
> > @OnEvent(value=EventConstants.ACTION, component="zoneOne")
> > public Object test(){
> >        count++;
> > return zone1.getBody();
> > }
> >
> > @Component
> > private Zone zone2;
> > @OnEvent(value=EventConstants.ACTION, component="zoneTwo")
> > public Object test2(){
> >        count++;
> > return zone2.getBody();
> > }
> >
> >
> >
> > Everything works the first time.
> > It stops working when I update the zone1.
> >
> > Because tapestry creates a new zone2 that has a new client id, let's say
> > "zone2_1234556".
> > And when the actionlink for zone2 is created on the client side, the
> > parameter passed to the Tapestry.Initializer.linkZone method to
> initialize
> > the actionlink is "zone2", instead of "zone2_1234556".
> >
> > So I guess the solution may be to map the t:zone parameter of the
> > actionlink
> > to a java property, named zoneId.
> > <t:actionlink t:zone="zoneId"/>
> > and using this same property to set the t:id parameter in the zone :
> > <t:zone t:id="zoneId">
> >
> > But I don't know how I should set the zoneId value to get everything
> > working.
> >
> > Thanks in advance.
> > Clément
> >
>

Reply via email to