• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Radio buttons are not retaining thier values...

 
Ranch Hand
Posts: 32
MySQL Database Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I'm new to JSF. I have a problem with radio buttons in jsf. After clicking on yes or no to a radio button, i will submit my form. After that when i reload the saved form from the data base, it is not retaining the value of the radio button. but after saving the form the values are avail in the db.

Based on this radio button value i have to show the subsections.

Here is my code...

<t:selectOneRadio id="rad1" value="#{formPage.form.details.prop1}"
<f:selectItem itemLabel="Yes" itemValue="Yes" />
<f:selectItem itemLabel="No" itemValue="No" />
</t:selectOneRadio>


public class XXX {

private Form1 form = null;
...
public XXX() {
eform = formObjectsFactory.createForm1();
}
}

public class Form1 {
private Details details = null;
...
public Form1() {
details = formObjectFactory.createDetails();
}
}

public Details {
private String prop1= null;
...

}


And assume that remaining code what ever is needed here is all in place.
I know that we can do the same with javascript while loading the form. But in my form i have around 500 radio buttons are available. when we tried with javascript it is taking too much time to load the form with all the values and each and every radio button will have unique id.

Please advice me a solution for this.

Thanks in advance,
Kiran

[ October 16, 2008: Message edited by: kopparapu v kiran kumar ]
[ October 16, 2008: Message edited by: kopparapu v kiran kumar ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic