cancel
Showing results for 
Search instead for 
Did you mean: 

problem with tables and radiobuttons

former_member1193316
Participant
0 Kudos

Hi,

when i search for a perticular thing all the values should display in a table.

its displaying in table but by default the first row of the table has been selected.

i dont want default selection. i want to select manually. so i changed the table property selection mode as none. so while run time i can select the field. i worte a method for lead selection. so when i selected any row on the table the acton should perform. but now selection is working but when i select any row the lead selection is not triggering its action.

what should i do?

and my one more question is i hav been added radiobuttongroupbykey, but i cant able to see that ui element in my view.

how to enable it and how to add test to the radiobuttons.

please guide me

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Venkat,

Setting the selection mode as None will not do what you expect it to do. Selection mode can be single, multi, singlenolead, multinolead or none. If it is none, then it means no selection will happen. Thats why you dont get any values when you do lead selection.

When you dont want that first row to be selected, you have to set the "Initialization lead selection" property of your context to false. In the context tab, when you click on your context node and see the properties below, you will find a checkbox that says "Initialization lead selection". It will be checked by default, just uncheck it. Then when you display the table, top row will not come selected as default.

And, set the selection mode property to single or multi depending on what you have defined in your context. Whether you want single or multiple selection.

For your second question, since you are using a radio button by key, the values will be seen only on doing a set_attribute_value_set. You can see the values only in runtime, not in se80.

In your context node, you would have an attribute for which you will bind the radio button. In the doinit method, write the following code:

data: lt_valueset type table of wdr_context_attr_value,

ls_valueset type wdr_context_attr_value,

lr_node_info type ref to if_wd_context_node_info,

lr_node type ref to if_wd_context_node.

lr_node = wd_context->get_child_node( 'Your node name' ).

lr_node_info = lr_node->get_node_info.

clear: ls_valueset, lt_valueset.

ls_valueset-key = 'key1'.

ls_valueset-value = 'Option 1'.

append ls_valueset to lt_valueset.

ls_valueset-key = 'key2'.

ls_valueset-valueset = 'Option 2'.

append ls_valueset to lt_valueset.

lr_node_info->set_attribute_value_set(

exporting

name = 'Attribute name'

value_set = lt_valueset

).

The texts 'Option 1', 'Option 2' will be displayed in the UI. key1 and key2 will be the actual values that will be selected. In your radio button, you should bind the selectedKey attribute to the context attribute.

Check the web dynpro component <b>WDR_TEST_EVENTS</b> or <b>WDR_TEST_UI_ELEMENTS</b> for details on how to use the various UI elements. You will have a better idea.

Hope this helps. <b>Please award points if it solves your problem.</b>

Regards,.

Nithya

Answers (1)

Answers (1)

mohammed_anzys
Contributor
0 Kudos

Hi,

In the radio button properties , there is a field "KeyToSelect"..You have to populate with the respective value.normally it will be 'X'.

Thanks

Anzy