Skip to Content
author's profile photo Former Member
Former Member

WDA: How to Insert a new line into a treebykey table?

Dear colleagues,

I want to insert a new line into a treebykey table after a selected line, is there any good suggestion to do this, or example?

I found there is a method 'GET_TABLE_TREE_LEAD_SELECTION' in 'CL_WD_DYNAMIC_TOOL', but it's just for treebynesting.

Then, I try to use the event 'OnLeadSelect' of the table, but I am not clear about how the parameter of 'new_row_element' and 'old_row_element' should be used.

Thank you.

Swee Hu

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Oct 14, 2005 at 01:06 PM

    Hi Swee,

    You can get all selected elements of a context node by calling method GET_SELECTED_ELEMENTS of the context node (interface IF_WD_CONTEXT_NODE). If you need to leadSelection you can use method get_lead_selection (or get_lead_selection_index in case you are only interested in the position of the leadSelection in the table). In case of the *byKey tree-table just insert a new context element at the desired position and make sure that the parent key and key attributes are properly set. Otherwise, the new element wont appear at the proper level. The table renderer automatically calculates the hierarchy depending on the existing key/parent key values of all elements in that "flat structure".

    Kind regards,

    Thomas

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.