• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Create HtmlSelectOneRadio through backing bean

 
James Ellis
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to create a HtmlSelectOneRadio box and add it to a panelGrid. Can anyone give me some sample code for how to create a radio box and initialize it with some test data (any data will do) through a backing bean.

My problem is I can't seem to figure out what is supposed to be in the setValue of



And without a value nothing is being displayed on the page...
 
g madhava
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try the below.
 
James Ellis
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks so much, that worked with one small change. I guess MyFaces doesn't like SelectItems as Integers, so you have to create them as Strings. Below is the updated (working) code.

 
Sudeep Agrawal
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alternatively :

 
Chris Tiearney
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm using the ICEfaces framework and also need to dynamically generate these elements. I tried to use your technique described here but ended up with an error and a blank where all the elements are supposed to be. Here is the method:



And the error I keep getting is:


This application tries to generate a form with ICEfaces elements and then display it in a ice:panelPopup element containing only one ice:panelGroup element with the property: which is a HtmlPanelGroup object from the ICEfaces library.

Any help would be appreciated because I am totally lost at the moment.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic