cancel
Showing results for 
Search instead for 
Did you mean: 

Deleting table row when OnLeadSelection = none

Former Member
0 Kudos

Hello experts.

I have a table with some columns (Textviews and InputFields) and a Delete button.

One of the requirements is that the LeadSelection will be set to None, which means that the user will set the cursor on one of the InputFields and by pressing the button the row will be deleted, and (of course) it means that i have no lead selection to work with.

How can i do that? i know that in WD4J it can be done.

Thx.

Motty.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

data: lo_nd_user_entities TYPE REF TO if_wd_context_node,

ls_user_entities TYPE wd_this->element_user_entities,

lt_elements TYPE wdr_context_element_set,

lo_elements TYPE REF TO if_wd_context_element.

lt_elements = lo_nd_user_entities->get_selected_elements( ).

CHECK NOT lt_elements[] IS INITIAL.

  • IF lt_elements IS NOT INITIAL.

LOOP AT lt_elements INTO lo_elements.

  • Get Contents of selected Lines............

CALL METHOD lo_elements->get_static_attributes

IMPORTING

static_attributes = ls_user_entities.

ENDLOOP.

Former Member
0 Kudos

Hi.

Same as i wrote to Alex: There is No lead selection set to the table so it doesn't help to try and get the selected elements.

Motty.

Former Member
0 Kudos

hi motty.....

if your table is not in selectable mode,

go to the properties of the table and check the rowselectable check box and also in the context, check the initialize lead selection check box.

---regards,

alex b justin

Former Member
0 Kudos

Hi Alex.

They are both checked. I fill like there is something missing....

Motty.

Former Member
0 Kudos

hi motty.......

check for these:

your table should display atleast one value

the cardinality of the node that is bound to the table must be 0..n

the initialize lead selection of the node must be checked

the table ui elements must be selectablr

---regards,

alex b justin

Former Member
0 Kudos

Hi Alex.

That was our starting point....

And yet, the system cant tell on which element the cursor is positioned on....

Motty.

Former Member
0 Kudos

Hi ,

set the property selection_mode of the table to multi no lead then your table has no lead selection but you can select multiple entries from the table.Then the code works.

Former Member
0 Kudos

Well, it seems like there is no solution for my problem.

Thank you all anyhow.

Former Member
0 Kudos

hi motty.....

you can use the method get_selected_elements in if_wd_context_node and get the element and then delete it.

---regards,

alex b justin

Former Member
0 Kudos

No you cant.

There is no selection and the set is NULL.

Motty.

Former Member
0 Kudos

hi motty......

you mean you dont have a selection in the table.... if so then set it in the ui element.

---regards,

alex b justin

Former Member
0 Kudos

I don't follow...

Can you guide me please?

thx

motty.