Marcio,

To know the ID of the user, you could change your options line to:
<html:options collection="users" property="id" labelProperty="name" />

That only works if your users collection has a getId method along with your
[assumed] getName() method.  When you submit it, if you need the name you
will probably have to look it up in your Action since you'll only have the
ID submitted, not the name.

Regards,
David

-----Original Message-----
From: admin [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 30, 2004 4:14 PM
To: [EMAIL PROTECTED]
Subject: Newbie question regarding <html:select>


Hello folks.

I have a Bean called users with two properties (Id and Name)

<html:select name="users" property="name">
        <html:options collection="users" property="name"
labelProperty="name" />
</html:select>

When a choose a name in this selection i need to know the ID of the
selected user. How can i do that?

Thanks for any help.

Marcio Lima



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

Reply via email to