You must iterate on component children, look at each uiselectitem and uiselectitems, and queary each of them until you get a SelectItem which value match the current one. you can then get label of this SelectItem. Note that this iteration will call the various EL associated with your select menu child components. This is because JSF never cache EL results.

Rob99 a écrit :
Hello,

I have bound an "HtmlSelectOneMenu" to my backing bean using "binding=..."
on the tag.  I can get the chosen "value" easily enough with:


    HtmlSelectOneMenu m;
    ...
    String chosenValue = m.getValue();


Is there any way to get the "label" of the chosen item instead of the
"value" from the component?  Or is it absolutely necessary to query the
model that populated the "HtmlSelectOneMenu" in the first place?


-Thank you!

Reply via email to