Skip to Content
0
Former Member
Apr 12, 2010 at 12:24 PM

Cannot retreive index of selected radio button

50 Views

Hi,

I have implemented a RadioButtonGroupByIndex as follow:

String[] monthNames = new String []  {
   "January", "February", "March", "April",
   "May", "June", "July", "August", 
   "September", "October", "November", "December",
};

//1. Create context elements for node "MonthsOfYear"
List monthsOfYear = new ArrayList();
for (int i =  0; i < monthNames.length; ++i) {
   IPrivateMainView.IMonthsOfYearElement month = 
   wdContext.createMonthsOfYearElement();
   month.setMonthName(monthNames<i>);
   monthsOfYear.add(month);
}

//2. Bind node to element list
wdContext.nodeMonthsOfYear().bind(MonthsOfYear);


//set lead selection
 wdContext.nodeMonthsOfYear().setLeadSelection(5);

I have created an onSelect event on the RadioButtonGroupByIndex. I am trying to retreive the index of the selected radio button to enable an edit field. When trying to display the id of the selected radio button, the result is "0" for each one of them. How come the index is not 0 for the first one, 1 for the second... ?

Thanks in advance for your help.

Thibault