cancel
Showing results for 
Search instead for 
Did you mean: 

Reg selecting rows in a table using radio buttons

jnmurthi
Participant
0 Kudos

Hi All,

I have a problem with selecting rows in Tables. I have put radio buttons as a column in the table to select record from the table. But while I am executing my application I am seeing that all the radio buttons are selected and are disabled which will cause problems.

Please suggest me a solution of what I need to do inorder to select one row at a time and also have my radio buttons in the tables enabled and let me select one row at at time.

Please do help me in this issue.

Regards,

Murthy.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Murthy,

first create attripute "select"-set as type boolean,

add it radio button,

in table onLeadselect=TableLead

create action for radio button

and write this code

static int check;

Check = wdContext.node<name>().getLeadSelection();

and in "on action Table Lead u write this code,

wdContext.node<name>.get<name>ElementAt(Check).setSelect(false);

Regards,

vino

Message was edited by:

Vinoth Raja.V

Former Member
0 Kudos

Hi,

You can also look at thread.

Regards,

Satyajit.

Former Member
0 Kudos

hi,

1)create 1 attribute as select,bind this attribute to radiobutton

2)insert radiobutton in table

3)click radiobutton->properties>onSelect->create action and write the code

Declare flag as global variable,

static int flag;

{

flag=wdContext.nodeViewFlightTest().getLeadSelection();

}

4)In table properties there is an option,onLeadSelection---->create action

it is used to select only 1 radiobutton, defaultly first record is in lead selection, u want to select some other record...u have uncheck first selected radiobutton....for that we using this code....

if(wdContext.nodeViewFlightTest().getViewFlightTestElementAt(flag).getSelect())

{

wdContext.nodeViewFlightTest().getViewFlightTestElementAt(flag).setSelect(false);

}

jnmurthi
Participant
0 Kudos

Hi Suresh,

Can you tell me where to bind the attribute to the radio button........like whether it should be binded to "keytoselect" or "selectedkey"

Regards,

Murthy.

Former Member
0 Kudos

Hi,

set datatype=boolean to select attribute

bind to "selected key"

jnmurthi
Participant
0 Kudos

hi,

can you give me some idea of where to write the code.

shall i write in the doInit() of the view or shall i write it in the component controller.

does it make any difference

Former Member
0 Kudos

Hi,

u see my above post, i explained clearly....u have to write an code in onSelect and also in onLeadSelection.........

jnmurthi
Participant
0 Kudos

Hi suresh,

if(wdContext.nodeViewFlightTest().getViewFlightTestElementAt(flag).getSelect())

{

wdContext.nodeViewFlightTest().getViewFlightTestElementAt(flag).setSelect(false);

}

I have tried writing this code, but i could not see "getSelect()" and "setSelect()".

can you guide me regarding this

regards,

Murthy.

Former Member
0 Kudos

Hi,

"Select" is the name of your context attribute to which you have mapped the selectedKey property of the radio button.

This attribute is under the node ViewFlightTest.

You could have named it differently.So use that name.

Former Member
0 Kudos

Hi Murthy,

Select is an attbribute.....so u have to create an attribute as Select,then only u can get both that methods getSelect() and setSelect().....