Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

problem with <rich:combobox

Tags:

java

richfaces

why the rich: comboBox uses the value to display in the listing and not the label, as I do to show the description and select the id.

I did so

 <rich:comboBox width="300">
    <t:selectItems value="#{compromissoHome.buscar}" var="teste" itemValue="#{teste.testeId}" itemLabel="#{teste.teste1}"/>
</rich:comboBox>
like image 705
William Witter da Silva Avatar asked Oct 15 '22 07:10

William Witter da Silva


1 Answers

rich:combobox does what it was designed to (an input text component with client-side suggestions). To do so, for each selectItem, it uses iremValue as label and ignores itemLabel.

If we want to use it for selecting of values based on selected labels (rendered by the component), we can enhance it on the client-side (as I did)...

In this article I share my (working) approach:

Enhanced rich:comboBox: Values (not only Text) and RegExp Suggestions http://community.jboss.org/docs/DOC-15534

If you have no problem in working with JavaScript, please test it and let me know what you think.

like image 114
luistamawong Avatar answered Oct 19 '22 01:10

luistamawong