• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

selectOneRadio problem

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try fixing EL expression - it should be:
#{prjsys.oldestCommentFirst}
 
Ian Dunsirn
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I made that correction and it still is not working.
 
Ian Dunsirn
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic