File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes how to get object instead of String from a <rich:combobox> Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "how to get object instead of String from a <rich:combobox>" Watch "how to get object instead of String from a <rich:combobox>" New topic
Author

how to get object instead of String from a <rich:combobox>

Bessrour Adnen
Greenhorn

Joined: Mar 17, 2010
Posts: 2
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();

thanks in advance for any insights.
Devaka Cooray
Saloon Keeper

Joined: Jul 29, 2008
Posts: 2691
    
    3

"javabeans best" please check your private messages regarding an important administrative matter.


Author of ExamLab (Download) - the free mock exam kit for SCJP / OCPJP
Home Page -- Twitter Profile -- JavaRanch FAQ -- How to Ask a Question
Bessrour Adnen
Greenhorn

Joined: Mar 17, 2010
Posts: 2
Devaka Cooray wrote:"javabeans best" please check your private messages regarding an important administrative matter.

noted et corrected!
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: how to get object instead of String from a <rich:combobox>
 
Similar Threads
rich:comboBox valueChangeListener is not working
How do you implement Tomahawk tree control with a CheckBox?
Configuring and using seam's convertEntity
rich:comboBox fails to reRender due to rich:ajaxValidator
How to generate managed bean