Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to block lead selection change in a tree ?

Hi Guys,

<u>Scenario</u>

I have MasterTree - DetailEditor pair. <i>MasterTree</i> is used to visit some tree-structured data and <i>DetailEditor</i> is used to edit currently selected tree node.

<u>Requirement</u>

If currently selected node data is updated through <i>DetailEditor</i> and needs to be saved, than on a subsequent tree selection change the user should be warned about unsaved data.

<u>Implementation</u>

In <b>onAction</b> event handler of <i>MasterTree</i> I check whether last selected node data is updated and needs to be saved and if this is the case rollback <i>treeSelection</i> to that node. On the time <b>onAction</b> event handler is called the tree selection is changed from the node that needs save to the newly selected node. In order to rollback <i>treeSelection</i> I need to introduce variable referencing last selected tree node.

<u>Question</u>

Is there any other technique to implement above scenario without using additional variable and manually rollback <i>treeSelection</i> ? For example, to plug in WDP framework on validation step just before lead selection is changed.

Thanks in advance

Not what you were looking for? View more on this topic or Ask a question