cancel
Showing results for 
Search instead for 
Did you mean: 

Table control get selected rows

former_member301120
Active Participant
0 Kudos

Hello to all,

I'm new at developing WD4A.

If generated a table control and enabled multisection.

If added a method for the event onSelect.

But now, how can I get the selected rows in the event handler.

Any code fragement?

Please advice.

Regards

Christian

Accepted Solutions (0)

Answers (3)

Answers (3)

ChrisPaine
Active Contributor
0 Kudos

Christian,

The event parameters of the onSelect method will provide you with the element that has been selected.

if you find your action (in actions tab in view) , select the action and then click on the little blue box icon on the toolbar above the list of actions (Parameter from UI Event).

this allows you to explicitly add the context element parameter to your action handler method. In your method you then have a very simple way to refer to the selected element - it is an input parameter of the method.

Given that the onSelect is triggered on each and every multiselect it may not be a good idea to then refer to all selected rows.

Instead perhaps create another button to trigger your logic to read all the selected rows. I guess it depends on what logic you are trying to implement.

Cheers,

Chris

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi,

The code wizard can certainly be a start. At any rate get familiar with these interfaces:

if_wd_context_node (where you can find the method which was pointed out get_selected_elements) and

if_wd_context_element. You will use these a lot.

Regards,

George

Former Member
0 Kudos

Hi Christian,

In the Event Trigged onSelect Method.

1. Get the reference of the Node which is bound to the Table using GET_CHILD_NODE method.

2. Get the selected rows using method GET_SELECTED_ELEMENTS using the reference node.

Ranganathan.