how to get object instead of String from a <rich:combobox>
Bessrour Adnen
Greenhorn
Joined: Mar 17, 2010
Posts: 2
posted
0
hi there
I've been using the "value" attribute of rich:combobox to get the value as a String. Now that i'm trying to optimize my code, i want to get directly an Object when the combo submits its value.
I've succeded in using the "binding" attribute to populate the rich:combobox and I'm using the "valueChangeListener" so i can get the value when the form is submitted.
valueChangeListener="#{ImmeubleBean.onSubmittedValue}" the signature of onSubmittedValue is public void onSubmittedValue(ValueChangeEvent ev). My problem is I get it only the value as a string.
I've used all this method and they all return a String and if the return type is an Object it contains only a String.
ev.getNewValue();
cmb.getValue(); // cmb is the HtmlComboBox that I populated and binded to the combobox.
cmb.getLocalValue();
cmb.getSubmittedValue();