cancel
Showing results for 
Search instead for 
Did you mean: 

Selection of row in Table using radiobutton

Former Member
0 Kudos

Hi,

Instead of using default button for selecting row in table,i want to select row using radiobutton which is cell editor in one of the columns.Any suggestions/inputs how to do it.Please note that only one row at a time should get select.

Akash

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Why not setting the selection cardinality of the table data source node to 0:1 or 1:1?

Armin

Former Member
0 Kudos

Hi

As Sowjanya Said the Value Attribute attached to selected Key Property holds one instance at a time and the Key to select is used to hold different Values for each radio button. so on select of radio button u will have the value in selected Key Value Attribute.

Wishes

Krishna kanth

Former Member
0 Kudos

Hi Akash,

Create two value attributes of type string or integer attr1 in the value node that is bound to table datatsource and the othe attr2 directly under the context or different node which is 1-1.

Bind the attr1 to KeyToSelect property and attr2 to SelectedKey property of the radio button then u will be able to select only one radio button at a time.

Regards,

Sowjanya

Former Member
0 Kudos

hi

Change the selection property of table to None.

This will remove the default first column. Then add a column of type Radiobutton(which is there in your case). Make it the first column in the table and bind it to a context attribute of type boolean.

Create two value attributes of type string or integer say "A" (any one) in the value node that is bound to table datatsource and another attribute say "B" directly under the context or different node of cardinality 1:1.

Bind "A" to KeyToSelect property and "B" to SelectedKey property of the radio button.

In the event onselect of the radiobutton write the logic of what you want to do.

This should help achieve what you are trying.

Let me know if you require some more information.

regards

ravi

Former Member
0 Kudos

Hi,

Which property of RadioButton i have to bind to the context attribute of type boolean. Right now what i have done is to the Value Node to which my table datasource is bound say X, in that i have created a attribute of type integer say A, now keyToSelect property is bound to this property and under root context attribute of type integer B is bound to selectedKey property. Now on displaying all radio button are coming as clicked.Let me know if i have miss anything, i need to have replacement of default button for selection as radio button.

Second point do i need to fill the value of A for each node element say starting with 1, to identify which row is clicked.

Former Member
0 Kudos

Hi

The SelectedKey would be bound to B which is created directly under the root context like you have done.

Is "A" a modelattribute of node "X" returned by SAP.Is the Key To Select Property bound to "A".

Let me know how you have declared "A".

If your Return SAP Structure is of the following structure

BAPI_RETURN_NODE

-


>Output_node

-


>ET_RETURN_NODE

-


>ET_MODEL_ATTRIBUTE

In that case bind your KeyToSelect to ET_MODEL_ATTRIBUTE

and then bind "B" to your selectedKey property.

Remember both "B" and "ET_MODEL_ATTRIBUTE" should be of same type.

Let me know if you require some more information

regards

ravi

Former Member
0 Kudos

Hi,

No A is value attribute under value node, i am transferring data from Model to this value node, that's where my second doubt came, do i have to fill value attribute A b'coz this will not be present under Model Node. This is substitution for button selection. Both A and B are of type integer . To make it simple to understand take this scenario :

1) I have value node 'X' and i have some attributes in it which i have to display as columns and now i have declared attribute A under it of type integer for radio button and binded it to the keyToSelect property of radion button.

2) I have declared attribute B under root context of type integer and binded it to the SelectedKeyProperty.

with this thing i am getting every radio button clicked...

Former Member
0 Kudos

Hi Akash

See the reason why all your radiobuttons are selected are because you dont have any values set in the attribute "A" that you have bound to KeyToSelect property.

In a Radiobutton whenever you select it the value from Attribute "A" gets stored in the attribute "B". Since you dont have any values in "A" you are getting all the radiobuttons are checked.

Let me know if you require more information.

regards

ravi

Former Member
0 Kudos

Hi,

Thanks Ravi, it's working.

Sowjanya, Krish thanks alot for your suggestions,your suggestions were also on the same line.

Armien,

For table we need to have cardinality set to 0..n or 1..n , i have tried that it was giving error as it can't hold more then one element type.

Couple of posts back i have seen some points system for rating suggestions, it's not coming now, how do we rate now?

Regards,

Akash

Former Member
0 Kudos

Hi

You should get the points on the left side. Maybe at the time of posting your query you unchecked the checkbox which says "if the answer is correct i will allocate points" or something like that. Dont know

Maybe Armin would be able to answer on that.

regards

ravi

Former Member
0 Kudos

I did not suggest setting the cardinality but the <b>selection cardinality</b> to 0:1. This is the normal way to express that at most 1 row at a time may be selected.

Did you try this?

Armin

Former Member
0 Kudos

Hi Armin,

oh okie , sorry i have tried the other way, selection cardinality is coming as 0..1 so i didn't make any change in that.

Regards,

Akash

Former Member
0 Kudos

Did it work or not?

Armin