cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the new selection on a table?

Former Member
0 Kudos

Hi,

I have a table of keys. My start position is that there are 20 lines in the table and few lines are selected (highlighted).

I want to allow the user to mark another line. Once a line is pressed I add few more lines with the key selected to another table.

1. My problem is how to identify the new selection while the user press the ctrl or the shift key...

if he just presses the key table and gets a new selection (and all the rest of the selected keys disappear) than it is not a problem. I identify it via the new_selection parameter.

if he presses while using the ctrl button, I get the lead selection and not the new line he pressed.

I do not know how to test even the shift key press.

2. I noticed that once I change the table parameter selectionMode to Multi (from auto) I get no new_selection parameter. can someone explain this?

Thanks,

Itay

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello, Itay,

One of the ways to achieve what you want is to code the onSelect event (or the onLeadSelect event) and use the GET_SELECTED_ELEMENTS method from the context node (interface IF_WD_CONTEXT_NODE).

Hope this helps you!

Regards,

Andre

Former Member
0 Kudos

Thanks,

but it doesn't help.

I need to know which one is the new selection the user clicked on.

The only way I see is to save the selection before the press and then after the press to compare them...

This is an "ugly" solution. I thought there might be something nicer. This is my first WD4A app...

Regards,

Itay

Former Member
0 Kudos

Hi, Itay,

I see... then, I believe the solution you described is the only choice.

Regards,

Andre

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Itay,

I worked for a similar problem and couldn't find a direct solution.

But i can explain the workaround.

As you mentioned you already have a set of selected rows of the table in a different table in context.

Now when the user selects another row using ctrl then capture all the selected rows using GET_SELECTED_ITEMS. Note that the ON LEAD SELECT doesn't get triggered so you might have to call the above mentioned method in the wddomodify method.

Now compare the selected items with the original table and add the new ones.

Regards,

Kinshuk