how to identify which radio button is selected in icefaces?

223 views Asked by At

I have 3 radio buttons and I want to determine which radio button is selected for further processing.I have tried

document.getElementById("minselected"); also document.getElementById("minselected").isSelected(); and

document.getElementByName("min");

but its not working.

1

There are 1 answers

0
Vishnudev K On

if you are using icefaces you dont have to use any javascript tweek to get the check box value.

Try using ice:selectOneRadio component.
Sample code is given below

<ice:selectOneRadio layout="pageDirection"
    partialSubmit="true" value="#{myBean.myButtonValue}">
    <f:selectItem id="1"
        itemLabel="val1"
        itemValue="val1" />
    <f:selectItem id="2"
        itemLabel="val2"
        itemValue="val2" />
    <f:selectItem id="3"
        itemLabel="val3"
        itemValue="val3" /> </ice:selectOneRadio>

where myBean is my bean name
and myButtonValue is a string variable in bean with getter setter

When you submit the form you will get the itemValue in the bean on the variable myButtonValue