Method selectOption from Select
Jean-Francois LE BERRE <[email protected]> Mon, 29 Mar 2004 21:53:50 -0500
| Newsgroups | gmane.comp.jakarta.ecs.user |
|---|---|
| Message-ID | <[email protected]> |
Hi,
Method selectOption from Select seems not to work...
My code is the following:
Option[] types = {
new Option("user_auth", "user_auth", "Utilisateur authentifié"),
new Option("moderator", "moderator", "Modérateur"),
new Option("administrator", "administrator", "Administrateur")
};
int selected = 0;
int t = userToModify.getType();
if(t == IType.USER_AUTH)
selected = 0;
else if(t == IType.MODERATOR)
selected = 1;
else if(t == IType.ADMINISTRATOR)
selected = 2;
// I checked: here t is 2 in my example
Select typesOption = new Select("type", types);
typesOption.selectOption(selected);
But when displaying HTML page, no item is selected in the Select form.
I checked HTML source code too...
What am I doing wrong?
I'm using this archive:
http://apache.mirror.cygnal.ca/jakarta/ecs/binaries/ecs-1.4.2.tar.gz
Thanks
Jean-François