This should be as straightforward as this:

<t:select t:id="addTo" id="addSelect" model="playlistNames"
 blankOption="NEVER" value="selectedPlaylist"/>

//gets the object on the client
var selectList = document.getElementById("addSelect");



----- Original Message -----
From: "Gabriel Rodriguez" <[EMAIL PROTECTED]>
To: "Tapestry users" <users@tapestry.apache.org>
Sent: Monday, 17 November, 2008 6:00:50 PM GMT +02:00 Athens, Beirut, 
Bucharest, Istanbul
Subject: RE: unique ids for a select boxes


If I remember correctly, this will happen if you're creating more than
one instance of it per page. Any id should be unique and Tapestry will
help you achieve this whether you want it to or not. Anything else is
bad form.

-----Original Message-----
From: Chris Hannam [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 17, 2008 8:58 AM
To: Tapestry users
Subject: Re: unique ids for a select boxes

Hi,
Its gets stranger. That works for the first time I visit the page. The
select box has the correct name. When I revisit the page the id has
changed
to :

<select id="addTo:11dab2a7236" name="addTo">

From:
<select id="addTo" name="addTo">

Any ideas why?

CH

On Mon, Nov 17, 2008 at 3:31 PM, Gabriel Rodriguez <
[EMAIL PROTECTED]> wrote:

>
> Try this:
>
> <t:select id="addTo" clientId="addTo" model="playlistNames"
> blankOption="NEVER" value="selectedPlaylist"/>
>
> -----Original Message-----
> From: Chris Hannam [mailto:[EMAIL PROTECTED]
> Sent: Monday, November 17, 2008 8:26 AM
> To: Tapestry users
> Subject: Re: unique ids for a select boxes
>
> Yes, it sets a unique id on the name e.g. select:12o34nkasi98
>
> I need to know the id to access the select box.
>
> CH
>
> On Mon, Nov 17, 2008 at 3:21 PM, Gabriel Rodriguez <
> [EMAIL PROTECTED]> wrote:
>
> >
> > Have you tried setting the clientId property?
> >
> > -----Original Message-----
> > From: Chris Hannam [mailto:[EMAIL PROTECTED]
> > Sent: Monday, November 17, 2008 8:11 AM
> > To: users@tapestry.apache.org
> > Subject: unique ids for a select boxes
> >
> > Hi,
> > I`m trying to find the id of a select component from the following
> .tml
> > file:
> >
> > <t:select id="addTo" model="playlistNames" blankOption="NEVER"
> > value="selectedPlaylist"/>
> >
> > The tapestry generated id when rendered in the browser has a unique
> > identifier e.g. select:11daaf3019f  when means I cant access the
> select
> > box
> > from my javascript.
> >
> > Can anyone point me in the right direction?
> >
> > CH
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to