aspose file tools*
The moose likes JSF and the fly likes ajax4jsf: how to get selected value(s) from component with f:selectItems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "ajax4jsf: how to get selected value(s) from component with f:selectItems" Watch "ajax4jsf: how to get selected value(s) from component with f:selectItems" New topic
Author

ajax4jsf: how to get selected value(s) from component with f:selectItems

Vlad Kolosnicin
Greenhorn

Joined: Jul 11, 2008
Posts: 4
hi there !
I have a form with several components and need to get selected values from h:selectManyCheckbox to dynamically rerender other components. I've tried something like this:



but how can I send the selected item value to backing bean in ajax request ? Could anyone help ?

I am using myfaces 1.2 and a4j.
Venkat Sadasivam
Ranch Hand

Joined: May 10, 2008
Posts: 139
You can try using valueChangeListener of selectMenyCheckbox component.


“Any fool can write code that a computer can understand. Good programmers write code that humans can understand. ”<br>
-Martin Fowler
Vlad Kolosnicin
Greenhorn

Joined: Jul 11, 2008
Posts: 4
thanks,
i've already found solution (highlighted):

inside the a4j:support tag:
<a4j:actionparam value="this.value"
assignTo="#{surveyBean.ajaxVoteOption}"
name="foo" noEscape="true"/>
[ August 14, 2008: Message edited by: Vlad Kolosnicin ]
 
Consider Paul's rocket mass heater.
 
subject: ajax4jsf: how to get selected value(s) from component with f:selectItems