cancel
Showing results for 
Search instead for 
Did you mean: 

Radio Button in Table

Former Member
0 Kudos

Hi Experts,

I am having a problem in using the radio button in the table.

I am having a node say "Table" under the context.

Under the Table node i created a node called "Selection" node of cardinality 1..1 and selection 1..1 .

Under the Selection node i created a attribute caleed "Value", which is binded to the radio buttons in the table.

There are 3 radio buttons namely "Accept", "Reject" and "Hold". I had assigned the KeyToSelect property of the radio buttons as "a", "r" and "h".

As default, accept should be selected.

I had used the following code. but it was not working...

for(int i=0; i<wdContext.nodetable.size(); i++)

{

wdContext.currentselectionelement().setvalue("a");

}

and also i tried with creating an element for the selection node. But still not working..... Help Me....!

Thanks and Regards,

Mugundhan.A

Accepted Solutions (1)

Accepted Solutions (1)

former_member192434
Active Contributor
0 Kudos

Hi Kandha,

Put this code out side the for loop, in WDinit mthod()

wdContext.currentselectionelement().setvalue("a");

for more check this link

http://help.sap.com/saphelp_nw04/helpdata/en/77/e8cf153ebb2e468324ee8acd525fe2/content.htm

Thanks

Former Member
0 Kudos

Hi Anup,

Thanks for ur reply. I had tried it.. but it was not working...

former_member192434
Active Contributor
0 Kudos

Hi Kandha,

Have you created three different attribute for a, r, and h.

If not then create three different attribute for a, r, and h, and bind them each of them

With respective attribute. And then follow the earlier give steps

Thanks

Former Member
0 Kudos

Hi Anup,

K i will try and ping you..

Former Member
0 Kudos

Hi Anup,

It is not working.. Is there any other way?

former_member192434
Active Contributor
0 Kudos

Did you check the attribute value is

try to check whatever value u r setting to context attribute, is being setup properly or not

wdComponentAPI.getMessageManager().reportSuccess("=="+wdContext.currentselectionelement().getvalue("a"));

PS : problem is with attribute value is not being setup properly

As per other way to solve this problem, i think this the standred way to do this.

Thanks

Former Member
0 Kudos

Hi Anup,

It is displaying as a. But the radio button was not selected as default.

Thanks

former_member192434
Active Contributor
0 Kudos

you are getting attribute value as a which is String type.

to make your radio button selected you need to set the attribute val boolean true..

Former Member
0 Kudos

Hi Anup,

Thank you... Your solution is working. But there is a confusion for me.

Now i had created 3 attributes under selection node. say Value_A, Value_R and Value_H.

There is a confusion in binding these attributes to SelectedKey or KeyTo Select.

Thanks.

former_member192434
Active Contributor
0 Kudos

Hi Kandha

Here is solution where to use both KeyToSelect and SelectedKye

Radiobutton is usually used in groups. So the 'KeyToSelect' property says the unique value to identify each radio button, while 'SelectedKey' says which attribute has the value of the currently selected radio button. So if we need to group few radio buttons together, each of the radiobutton will have a unique value for 'KeyToSelect' but the 'SelectedKey' would be bound to the same attribute. Anytime, we access the value of the attribute bound to 'SelectedKey', we will get the 'keyToSelect' value of the currently selected radiobutton.

PS: If soluation is helpful plz award with points

Thanks

Former Member
0 Kudos

Hi Anup,

In my case Value_A, Value_H, Value_R are boolean type of attributes. Earlier i was using string type of attribute. so there was no confusio. between KeyToSelect and Selected Key. So can you grant me a eg with my case.

Accept RadioButton : SelectedKey : Value_A, KeyToSelect : ?

Thanks

former_member192434
Active Contributor
0 Kudos

Hi

'KeyToSelect' property says the unique value to identify each radio button.

In your case if you want to use (or giving Reference) this radio button furthure then create a new attribute and bind with it.

Or follow the same steps, which you have done with your rest of the two attributes

Let me know, if it is not clear to you.

Thanks

Former Member
0 Kudos

Hi Anup,

If i am using String type of attribute in SelectedKey means, I will give any string and check the status. Here now i binded to a boolean type of attribute. u asked to create a new attribute know. so wat type of attribute to create?

Thanks

former_member192434
Active Contributor
0 Kudos

could be String Type or any other type you want to put, which should be unique.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Under the Table node i created a node called "Selection" node of cardinality 1..1 and selection 1..1 . ?

why you taken selection node under the table node any specific reason ?

i think you bind the table uoi with Table node,

then create a attribute "value" under the table node bind with radio button.

and do like this,

for(int i=0; i<wdContext.nodetable.size(); i++)

{

wdContext.nodeTable().getTableeleemntAt(i).setvalue("a");

}

Regards,

ramesh

Former Member
0 Kudos

Hi Ramesh,

The "Table" node is a structure, which is structure binding from the model. we cannot create any new attributes under this table node know. so i created a new node called selection under the table node. I had set the singleton property of the selection node as false.