jQuery in Action, 2nd edition
The moose likes JSF and the fly likes Radio buttons are not retaining thier values... Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "Radio buttons are not retaining thier values... " Watch "Radio buttons are not retaining thier values... " New topic
Author

Radio buttons are not retaining thier values...

kopparapu v kiran kumar
Greenhorn

Joined: Oct 16, 2008
Posts: 25
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 ]
[ October 16, 2008: Message edited by: kopparapu v kiran kumar ]
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Radio buttons are not retaining thier values...
 
Similar Threads
Radio buttons are not retaining thier values...
Radio
rendering problem
Display value of 'checked' radio button
Create a Different selectOneListbox Depending On the Radio Button Clicked