cancel
Showing results for 
Search instead for 
Did you mean: 

radiobuttongroup with lead selected

former_member497277
Participant
0 Kudos

Hi!

I have radiobuttongruoup element in my application with 4 radiobuttons. By defect, always it appears selected first lead and I would like that the second was selected. How I can do this?. It is possible?. I'm working with webdynpro abap.

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

former_member497277
Participant
0 Kudos

Thank to all by your answers. The code that I have used is the following:

data: datanode type ref to if_wd_context_node.

datanode = wd_context->get_child_node( name = 'DATA' ).

datanode->SET_LEAD_SELECTION_INDEX( INDEX = '2').

Best regards.

Former Member
0 Kudos

Great. Please close the thread.

Regards,

Satyajit.

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi I bring u the code that solve the problem,

IPrivateTestCompView.ICV_dropNode node=wdContext.nodeCV_drop();

node.invalidate();

for(int i=0;i<8;i++)

{

IPrivateTestCompView.ICV_dropElement element=wdContext.createCV_dropElement();

element.setCV_value("Hello"+i );

if(i==6)

{

node.addElement(i,element);

node.setLeadSelection(i);

}

else

{

node.addElement(element);

}

}

This code works well for me

try this

Saravanan K

Former Member
0 Kudos

Hi Ana Ros,

if u want to set a particular radio button in a group as selected then you can use setLeadSelection() method.

that is, if u want to set the second one as selected by default use this

node.seLeadSelection(1);

-> 'node' is the name of the node which is used to bind the elements of the radiobuttongroup in the code area.

regards

karthik

former_member497277
Participant
0 Kudos

Thanks Saravanan, but I'm working with webdynpro abap.

former_member497277
Participant
0 Kudos

Thanks Heidi! I have already seen that documentation, but it is not what I´m looking for. I look for some method to select lead certain (in my case, the second), and that doesn't appear the predetermined one (that is to say, first)

former_member497277
Participant
0 Kudos

Hello Saravanan!. Sorry, it's radiobuttongroup by index.

Former Member
Former Member
0 Kudos

Hi,

First determine the number of radiobuttons and get the size and enter the sample code like this.

//for(int i=0;i<size;i++)

{

//Add the code to create element for the node bounded to radiobutton.

//check the position u want to set the lead selection.

//suppose 3rd button to get lead selected.

if(i==3)

{

node.addElement(0,element);

node.setLeadselection(0);

}

else

{

node.addElement(element);

}

}

Try this.

Saravanan K

Former Member
0 Kudos

Hi Ana,

You must have bound a context node to the "Texts" property of the RadioButtonGroupByIndex UI element.Let's call that node as "DATA".

Say for example, you want to get the second RadioButton in that group to be selected. Then you will use:


data:   datanode type ref to if_wd_context_node.
datanode = wd_context->get_child_node( name = 'DATA' ).
datanode->set_lead_selection( paramName = '1').

Actually I don't know the paramater name that needs to be passed to the set_lead_selection method, so I have used paramName. Please look up the correct parameter name.

Regards,

Satyajit.

Former Member
0 Kudos

Hi,

Can u tell me which radiobuttongroup type( index or key) u used?

Saravanan K