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 selectOneRadio problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSF
Bookmark "selectOneRadio problem" Watch "selectOneRadio problem" New topic
Author

selectOneRadio problem

Ian Dunsirn
Ranch Hand

Joined: May 25, 2006
Posts: 36
I am having some troubles with radio buttons. Here is my code:

<h:selectOneRadio id="commentOrder" value="{#prjsys.oldestCommentFirst}">
<f:selectItem itemLabel="Newest First" itemValue="false"/>
<f:selectItem itemLabel="Oldest First" itemValue="true"/>
</h:selectOneRadio>

The item in the bean (prjsys.oldestCommentFirst) is set to true. I expect that when I call my page, the radio button for "Oldest First" should be filled in. However, when I actually do call the apge, nothing is selected. How can I get the jsf to fill in the appropriate button based on the value stored in prjsys.oldestCommentFirst?
Piotr Swiecicki
Greenhorn

Joined: Nov 16, 2006
Posts: 17
try fixing EL expression - it should be:
#{prjsys.oldestCommentFirst}
Ian Dunsirn
Ranch Hand

Joined: May 25, 2006
Posts: 36
I made that correction and it still is not working.
Ian Dunsirn
Ranch Hand

Joined: May 25, 2006
Posts: 36
I found a way around it for now. It would appear that prjsys.oldestCommentFirst needs to be a String before the radio buttons will work like I wanted.
 
GeeCON Prague 2014
 
subject: selectOneRadio problem