cancel
Showing results for 
Search instead for 
Did you mean: 

missing dynamic mapping removal workaround

Former Member
0 Kudos

Hi

I've searched for a long time now and have not been able to come up with an answer.

Have SAP made the terrible design mistake or did they forget to include some sort of dynamic attribute removal? (rhetorical question - do not answer )

As it seems there are a ton of ways to add nodes and attributes to any given context node using node.getNodeInfo().add...(); however one would expect a ...getNodeInfo().removeAttribute(attributeName) and a ...getNodeInfo().removeChild(childID)

I mean the IWDTable contains a destroyAllGroupedColumns() which effective cleans it up.

And now for the question:

Is there any other way around this than to make a custom controller an re-instantiate it, manually mapping the rest of the context, when mapping removal is needed?

Best regards

Thomas.

Accepted Solutions (1)

Accepted Solutions (1)

siarhei_pisarenka3
Active Contributor
0 Kudos

Hi Thomas

You can only remove all attributes or child nodes was added dynamically before.

wdContext.getContext().reset();

or

wdContext.getContext().reset(boolean clear);

Below is info from WebDynpro Javadoc regarding the method:

<i>public void reset(boolean clear)Conditionally resets the context to its initial state. By setting the clear parameter to false, data in node collections created at design time will be preserved. All dynamically added nodes and attributes are destroyed from the metadata.

Calling reset(true) is functionally equivalent to calling reset().

The same warning given for method reset() about mapped or bound nodes and attributes also applies to reset(boolean clear).

Parameters:

clear - Whether the data shall be cleared before cleaning the metadata</i>

BR

Sergei

Former Member
0 Kudos

Thank you Siarhei

You get 10 points for that reply

cheers

/Thomas

Answers (0)