This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSF and the fly likes cannot set managed-property parameter with h:selectOneMenu value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "cannot set managed-property parameter with h:selectOneMenu value" Watch "cannot set managed-property parameter with h:selectOneMenu value" New topic
Author

cannot set managed-property parameter with h:selectOneMenu value

Adam Kronicki
Ranch Hand

Joined: Sep 01, 2009
Posts: 68
Hello,

I have a strange problem which I have been trying to fix for some time but am stuck in one place and don't quite understand what's going on here.

My index page looks like this:




The commandButton sends the user to a next page when I want to get the selected position from the selectOneMenu. The problem is that nothing is sent. When I select some value from the Menu the 'peek' outputText is rerendered properly and I can see the correct selection. However it is not sent to the next page and Bean. Surprisingly when I change the value of the parameter to a fixed String it works!!! So i.e. this:


Is read correctly in the next Bean!!! All of the beans are requested scoped with RichFaces @KeepAlive annotation (I tried without the annotation and it's the same).

Here I post a snippet of the faces-config.xml



Does any one have an idea why this doesn't work? I have used the managed-properties parameters like that in the past and it worked (meaning using some dynamically changed values not a static String).
Adam Kronicki
Ranch Hand

Joined: Sep 01, 2009
Posts: 68
BalusC gave me a solution on stackoverflow. To solve this problem the commandButton must be rerendered when the selectOneMenu value changes.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: cannot set managed-property parameter with h:selectOneMenu value
 
Similar Threads
Hyperlinked datatable
commandLink param problem
In Rich Faces rich:panelMenu a4j:commandButton action not called
Query string in jsf
problem JSF - datatable from DB