You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by John <jo...@quivinco.com> on 2014/09/03 18:23:34 UTC
dynamic ids for zones
I have a zone in a component that appear multiple times on a page so it needs unqiue ids each time.
I was thinking not to assign an id for thew zone and let the framework provide one.
How do I access this unqiue id when I want to rerender the zone. I see some compnents take the ^ value for teh zone name, how do I implement that for my inner components?
John
---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com
Re: dynamic ids for zones
Posted by Lance Java <la...@googlemail.com>.
As you are probably aware, there is only one instance of the zone
component. This one instance is rendered multiple times to produce many
clientside elements.
t:id is the serverside id, id is the clientside id(s). They don't need to
match.
On 3 Sep 2014 20:32, "John" <jo...@quivinco.com> wrote:
> doesn't the t:id need to be unqiue as well, or does the framework handle
> this?
> ----- Original Message -----
> From: Lance Java
> To: Tapestry users
> Sent: Wednesday, September 03, 2014 8:05 PM
> Subject: Re: dynamic ids for zones
>
>
> Yes, and id="prop:myClientId" can produce a different, but predictable,
> id
> each time through the loop.
> On 3 Sep 2014 19:36, "John" <jo...@quivinco.com> wrote:
>
> > Hi,
> >
> > Because the zone is reused elsewhere in the page I don't want to
> > explicitly name the Id because that does not generate a unique Id for
> > rerendering. I need a fresh Id for each successive render, and O need
> to
> > know that Id in my javascript and the page.
> >
> > John
> > ----- Original Message -----
> > From: Lance Java
> > To: Tapestry users
> > Sent: Wednesday, September 03, 2014 5:46 PM
> > Subject: Re: dynamic ids for zones
> >
> >
> > zone="^" is a clientside concept and means find the first parent
> zone to
> > the element which fired the event.
> >
> > I'm assuming you know you can explicitly define the zone id using:
> > <t:zone t:id="serverId" id="prop:myClientId" />
> >
> >
> > ---
> > This email is free from viruses and malware because avast! Antivirus
> > protection is active.
> > http://www.avast.com
> >
>
>
> ---
> This email is free from viruses and malware because avast! Antivirus
> protection is active.
> http://www.avast.com
>
Re: dynamic ids for zones
Posted by Geoff Callender <ge...@gmail.com>.
Here's an example showing unique client ids being generated for zones.
http://jumpstart.doublenegative.com.au/jumpstart7/examples/ajax/eventlinksinaloop
Geoff
On 4 Sep 2014, at 5:52 am, Thiago H de Paula Figueiredo <th...@gmail.com> wrote:
> On Wed, 03 Sep 2014 16:31:50 -0300, John <jo...@quivinco.com> wrote:
>
>> doesn't the t:id need to be unqiue as well, or does the framework handle this?
>
> t:id must be unique inside the template, but that's the Tapestry server-side component id, not the HTML client-side id. So t:id and id are completely different things, even if id is defined based on t:id if you don't bind the id parameter. Lance's suggestion is the way to go.
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: dynamic ids for zones
Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Wed, 03 Sep 2014 16:31:50 -0300, John <jo...@quivinco.com> wrote:
> doesn't the t:id need to be unqiue as well, or does the framework handle
> this?
t:id must be unique inside the template, but that's the Tapestry
server-side component id, not the HTML client-side id. So t:id and id are
completely different things, even if id is defined based on t:id if you
don't bind the id parameter. Lance's suggestion is the way to go.
--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: dynamic ids for zones
Posted by John <jo...@quivinco.com>.
doesn't the t:id need to be unqiue as well, or does the framework handle this?
----- Original Message -----
From: Lance Java
To: Tapestry users
Sent: Wednesday, September 03, 2014 8:05 PM
Subject: Re: dynamic ids for zones
Yes, and id="prop:myClientId" can produce a different, but predictable, id
each time through the loop.
On 3 Sep 2014 19:36, "John" <jo...@quivinco.com> wrote:
> Hi,
>
> Because the zone is reused elsewhere in the page I don't want to
> explicitly name the Id because that does not generate a unique Id for
> rerendering. I need a fresh Id for each successive render, and O need to
> know that Id in my javascript and the page.
>
> John
> ----- Original Message -----
> From: Lance Java
> To: Tapestry users
> Sent: Wednesday, September 03, 2014 5:46 PM
> Subject: Re: dynamic ids for zones
>
>
> zone="^" is a clientside concept and means find the first parent zone to
> the element which fired the event.
>
> I'm assuming you know you can explicitly define the zone id using:
> <t:zone t:id="serverId" id="prop:myClientId" />
>
>
> ---
> This email is free from viruses and malware because avast! Antivirus
> protection is active.
> http://www.avast.com
>
---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com
Re: dynamic ids for zones
Posted by Lance Java <la...@googlemail.com>.
Yes, and id="prop:myClientId" can produce a different, but predictable, id
each time through the loop.
On 3 Sep 2014 19:36, "John" <jo...@quivinco.com> wrote:
> Hi,
>
> Because the zone is reused elsewhere in the page I don't want to
> explicitly name the Id because that does not generate a unique Id for
> rerendering. I need a fresh Id for each successive render, and O need to
> know that Id in my javascript and the page.
>
> John
> ----- Original Message -----
> From: Lance Java
> To: Tapestry users
> Sent: Wednesday, September 03, 2014 5:46 PM
> Subject: Re: dynamic ids for zones
>
>
> zone="^" is a clientside concept and means find the first parent zone to
> the element which fired the event.
>
> I'm assuming you know you can explicitly define the zone id using:
> <t:zone t:id="serverId" id="prop:myClientId" />
>
>
> ---
> This email is free from viruses and malware because avast! Antivirus
> protection is active.
> http://www.avast.com
>
Re: dynamic ids for zones
Posted by John <jo...@quivinco.com>.
Hi,
Because the zone is reused elsewhere in the page I don't want to explicitly name the Id because that does not generate a unique Id for rerendering. I need a fresh Id for each successive render, and O need to know that Id in my javascript and the page.
John
----- Original Message -----
From: Lance Java
To: Tapestry users
Sent: Wednesday, September 03, 2014 5:46 PM
Subject: Re: dynamic ids for zones
zone="^" is a clientside concept and means find the first parent zone to
the element which fired the event.
I'm assuming you know you can explicitly define the zone id using:
<t:zone t:id="serverId" id="prop:myClientId" />
---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com
Re: dynamic ids for zones
Posted by Lance Java <la...@googlemail.com>.
zone="^" is a clientside concept and means find the first parent zone to
the element which fired the event.
I'm assuming you know you can explicitly define the zone id using:
<t:zone t:id="serverId" id="prop:myClientId" />