Hi Matthias, Simon & all,
How can I use this natively supported enums to e.g. populate a
SelectOneList with the values from an enum, and have the selection
update a variable/property in my backing bean?
Many thanks,
Fintan
yeah,
there is already a bug, with a patch too.
need to apply next days.
On 8/22/07, Simon Lessard <[EMAIL PROTECTED]> wrote:
Hello Bryan,
Actually, in JSF 1.2, enums should be natively supported I think. Let me
check the spec some more to be sure.
Regards,
~ Simon
On 8/22/07, Bryan Basham <[EMAIL PROTECTED]> wrote:
Hello,
You need to use a converter.
For my project, Cobia, I have built
a generic enum converter and enum
UISelectItems component/tag.
These are used like this:
<h:selectOneRadio value="#{form.education}"
layout="pageDirection">
<cobia:enumSelectItems type="org.example.EducationEnum"/>
<cobia:enumConverter type="org.example.EducationEnum"/>
</h:selectOneRadio>
The 'type' attribute is the fully-qualified
class name for the enum type. These mechanisms
use resource bundles for I18N support.
If you don't need such flexibility,
then I would recommend building your
own Converter specifically for the
Education enum. However, if you use
a lot of enums that are exposed in the
UI, then you will probably want to invest
in a more general solution.
Contact me personally if you want to see
the Cobia code for this.
Regards,
Bryan
* ** *** ** * ** *** ** * ** *** ** *
This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.
Tá an t-eolas sa ríomhphost seo agus in aon chomhad a ghabhann leis rúnda agus
ceaptha le haghaidh úsáide an té nó an aonáin ar seoladh chuige iad agus na
húsáide sin amháin.
Any views or opinions presented are solely those of the author, and do not
necessarily represent those of ESB.
Is tuairimí nó dearcthaí an údair amháin aon tuairimí nó dearcthaí ann, agus ní
gá gurb ionann iad agus tuairimí nó dearcthaí BSL.
If you have received this email in error please notify the sender.
Má bhfuair tú an ríomhphost seo trí earráid, ar mhiste leat é sin a chur in iúl
don seoltóir.
Although ESB scans e-mail and attachments for viruses, it does not guarantee
that either are virus-free and accepts no liability for any damage sustained as
a result of viruses.
Scanann BSL ríomhphoist agus ceangaltáin le haghaidh víreas, ach ní ráthaíonn
sé go bhfuil ceachtar díobh saor ó víreas agus ní glacann dliteanas ar bith as
aon damáiste de dhroim víreas.
Company Registration Information: http://www.esb.ie/companies
Eolas Cláraithe an Chomhlachta: http://www.esb.ie/companies
* ** *** ** * ** *** ** * ** *** ** *