• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Bessrour Adnen
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Posts: 5325
575
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"javabeans best" please check your private messages regarding an important administrative matter.
 
Bessrour Adnen
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Devaka Cooray wrote:"javabeans best" please check your private messages regarding an important administrative matter.

noted et corrected!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!