cancel
Showing results for 
Search instead for 
Did you mean: 

difference between getCurrentElement() and getTreeSelection()

p_k3
Participant
0 Kudos

Hi Experts,

I need to get the cureent selected row in tale that has a TreeByNestinTableColumn element in it. I found two methods when

looking at the available methods on wdContext.node<node_name>()

One is getCurrentElement() and the other is getTreeSelection().

I am not able to understand the difference between them.

The java documentation of those methods is as follows:

public IWDNodeElement getCurrentElement()

    Returns the current element (at the lead selection) or null if no element is selected.

    Returns:
        the current element (at the lead selection) or null if no element is selected.


public IWDNodeElement getTreeSelection()
                                throws WDContextException

    Returns the element that is reached by following the lead selections of non-singleton child nodes without mandatory lead selection.

    Returns:
   Throws:
       WDContextException

Can any one tell me if there is any difference between these 2 methiod? Are they just 2 different ways of accessing the current selected node.

Thanks for your inputs in advance,

PK

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi P K ,

The difference is in the type of the node if singleton or non singleton which is used foor child nodes.

1.

public IWDNodeElement getCurrentElement()

Returns the current element (at the lead selection) or null if no element is selected.

Returns:

the current element (at the lead selection) or null if no element is selected.

Ans : This is used for singleton child node and it returns the element of the node dependent on the lead selection of the parent node whereas,

2.

public IWDNodeElement getTreeSelection()

throws WDContextException

Returns the element that is reached by following the lead selections of non-singleton child nodes without mandatory lead selection.

Returns:

Throws:

WDContextException

Ans : Returns the element of the non singleton child node which is independent of the lead selection of parent node directly.