cancel
Showing results for 
Search instead for 
Did you mean: 

How to delete a dynamically created context node ?

Former Member
0 Kudos

Hi

I have created a context node dynamically and have added the check boxes to the node.

But when i am refreshing the page it is giving me the following excepiton:

com.sap.tc.webdynpro.progmodel.context.ContextException: DataNodeInfo(DwdReportView.Person): duplicate name for attribute attr1

I am writing the following code in wdDoExit() method so that the node is invalidated and all dynamically added nodes and attributes are destroyed from the metadata.

The code is :

wdContext.getContext().reset(false);

or

wdContext.getContext().reset();

or

wdContext.nodeName().invalidate();

I have tried all the above mentioned code snippets but it is still giving me the same exception.

Please help me resolve this issue.

Thanks in advance.

Regards

Shaily

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Shaily,

You can try moving your code to

public void wdDoModifyView(com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)

method and check if the method is being called for firsttime in the lifecycle of the view.

Hope this helps.

Best Regards,

Supriya

Former Member
0 Kudos

Hi Shaily,

You can try moving your code to

public void wdDoModifyView(com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)

method and check if the method is being called for firsttime in the lifecycle of the view.

Hope this helps.

Best Regards,

Supriya

Former Member
0 Kudos

Shally,

A better forum to place your question is the forum.

To your question: the wdDoExit() method is only called once i.e. when the view is destroyed from memory. Just like the wdDoInit() mehtod is called only once at initialisation of the view.

Try refactoring your code, so that upon initialising of your context, the old version of it is removed.

Hope this helps.

Regards,

Alain