cancel
Showing results for 
Search instead for 
Did you mean: 

Creating Radio Buttons and Drop Down at runtime

Former Member
0 Kudos

Hi Experts,

I am new to Webdynpro and I have a requirement where i need to add radio buttons and drop down lists at runtime.

The scenario is as follows:

We have 4 status coloumn for an employee, under each status of every emp record we have to put a radio button and the one for the current status should be selected by default. Now under the selected radio button should then display a drop down list which will contain some values and in that also the current one should be displayed at the top by default.

Please provide me with the step by step procedure and code to perform this task including creating context and all.

Thanks in Advance,

Becky.

Accepted Solutions (1)

Accepted Solutions (1)

Answers (1)

Answers (1)

Former Member
0 Kudos

Could you explain why those UI elements need to be created programmatically? In most cases this is not needed, maybe in your use-case too.

Armin

Former Member
0 Kudos

Hi Armin,

Actually in my case, the radio buttons and the drop down list will be displayed alongwith the record details of an employee. And the drop downlist should appear only in the coloumn in which the radio button is selected and not for others.

So i think we will have to do it dynamically only.

Please suggest....

Thanks n Regards,

Becky.

Former Member
0 Kudos

Hi,

First check for the radio button is checked or not.

If the radio button is checked then use the given code to show and populate the dropdown say for ex.Groups.

lsCounterNode=new ArrayList(); //Initilizing an arraylist to hold the data of the dropdown

int iCounters=wdContext.nodeT_Group_Counters().size(); //to get the number of counters

String strCounter[]=new String[iCounters]; //An array to store the counter values

for(int iIndex=0;iIndex<iCounters;iIndex++) //Rotate the loop to get all the counter values

{

strCounter[iIndex]=wdContext.nodeT_Group_Counters().getT_Group_CountersElementAt(iIndex).getPlnal();

}

if(strCounter.length>0 && strCounter!=null)

{

for(int j=0;j<strCounter.length;j++)

{

IPrivate<ViewName>.ICounterElement countval= wdContext.createCounterElement();

countval.setCounterVal(strCounter[j]);

lsCounterNode.add(countval);

}

} //end if

wdContext.nodeCounter().bind(lsCounterNode);

Regards

Padma N

Former Member
0 Kudos

I don't understand. Which "column" are you referring to? Can't you just use a table here?

Armin