users@glassfish.java.net

Re: JSF, selectOneMenu, enum and EnumConverter

From: Ryan Lubke <Ryan.Lubke_at_Sun.COM>
Date: Tue, 10 Oct 2006 17:34:15 -0700

Antonio Goncalves wrote:
> Hi,
>
> I'm using GLassfish v2b19 (JSF 1.2 then) and I want to fill a
> selectOneMenu component with an enumeration. The Unified EL is
> supposed to support enums but I couldn't make it work. I had a look at
> the class EnumConverter but don't really know how to use it.
>
> Does anybody know how to fill a selectOneMenu with a enum ?
>
> Thanks,
>
> Antonio
Hello Antonio,

I've attached a simple example using a selectOneMenu with Enums. No
need to worry about
the converter, the framework takes care of that for you.

Unjar the attached file to obtain the source and the packaged WAR file.

To invoke the sample, deploy the WAR, and issue the following
request: http://localhost:8080/enumselect/faces/Enum.jsp

Hope this helps.

-rl