Hello everybody!
I am programming some JSF JSP pages with Eclipse JBoss and I get into
troubles. Here is my problem:
I need to display a list as follow:
M. Smith - Professor
Mrs Smith - Student
M. Martin - Student
For the moment, I am doing as follow:
I have a table of relations statut-person.
For each existing relation I get the name and the statut label (in the
application language).
I concatenate both (statut and name) in a String and store it in a list.
I display this list with a SelectOneMenu:
<h:selectOneMenu id="stpers" style="width:200px"
value="#{MyClass.relationFn}">
<f:selectItems value="#{MyClass.functionsPersToDisplay}" />
</h:selectOneMenu>
So when I get the selected item, I get again a String that I need to parse
to get back the function, the name and thus the relation.
Is there another way, easier, where I could get the relation id directly?
The selected item would returns an id but these id will not be displayed
And I would display the corresponding values for this id (statut and name of
the person). Using a hashtable maybe? but then is it possible with a
selectOneMenu?
Thanks for your help.
Best
Sophie