Reputation: 3917
i have a clientId for selectOneMenu. i programmatically invoke the UIComponent using. but this is where i get confused, i want to get the selected value on the selectOneMenu. i have tried getValue(), it gives the default value , and getsubmittedvalue() gives null.
can someone please help me?
thanks in advance
Upvotes: 1
Views: 1706
Reputation: 1108722
This discrepancy can occur when you're invoking it at the wrong moment of the JSF lifecycle or when the component is part of an iterated component like h:dataTable
and the component is currently not in the iteration stage. After all, this isn't the way how the JSF stuffs ought to work. The normal approach is to bind the value to a bean property and then just access exactly that property in the action method associated with the command link/button.
Anyway, I think that the actual problem is already been solved by my answer on your other question.
Upvotes: 1