cancel
Showing results for 
Search instead for 
Did you mean: 

Radio Buttons Selection

Former Member
0 Kudos

Hi,

I have a req that I should display 5 RadioButtons on OUTPUT and when I select either of all these they should display 1,2,3,4,5 are selected individually.

I got the output but when I SELECT Iam unable to see the message that " Button 1 is selected". I created action also.Kindly send me the correct solution with necesssary coding. Its Urgent....

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

Try this

Create a RadioButtonGroupbyIndex

List radio = new ArrayList();

//Create the element of radio and bind it to the list

//for eg from db

for(int j=1;j<6;j++){

IPrivate<View>.I<Radio>Element ele=wdContext.create<Rdio>Element();

ele.set<Param>(String.valueOf(j));

radio.add(ele);

}

//add the list to radio node

wdContext.node<radio>().bind(radio);

you can receive the value of radio as

String radiovalue=wdContext.current<radio>Element().get<param>();

wdComponentAPI.getMessageManager().reportSuccess(radiovalue);

Kind Regards

Mukesh

Answers (2)

Answers (2)

Former Member
0 Kudos

I don't completely understand your question, so I must guess: You have 5 radio buttons in a RadioButtonGroupByIndex, and if a button is selected, you want to get a message "button x has been selected".

Assign an action "ButtonSelected" to the RadioButtonGroupByIndex.onSelect event.

Let X be the context node with the attribute providing the radio button texts.

In the action handler:

void onActionButtonSelected(...)
{
  int selectedIndex = wdContext.nodeX().getLeadSelection();
  wdComponentAPI.getMessageManager().reportSuccess("Button at index " + selectedIndex + " has been selected.";
}

Armin

Former Member
0 Kudos

Hi

when u create a radiobutton u have to link an action tab with it, so whenever u will select any radiobutton it should display the requirement for that u have to do linking in properties of indivisual Radio button for that particular action.

All The Best

Priyanka

Do reward points.