cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic delete attributes in ValueNode

former_member186148
Active Participant
0 Kudos

Hello SDN!

I have a ValueNode with set of attributes. This ValueNode belong to context root. In my app I add some attributes programmatically. Sometimes I need to remove these added attributes.

I've tried validate() method but nothing happens.

How I can remove these attributes?

P.S. I'm working with nw2004s

Regards, Lev

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Please try using this..

wdContext.node"node name"().getNodeInfo().getAttribute("Attribute name").remove();

sanyev
Active Participant
0 Kudos

HI Lev,

In NW04s you will not be able to use wdContext.getNodeInfo().getAttribute("name").remove(); This is available only on later releases. You should be able to delete dynamically added nodes and attributes using the reset API. [http://help.sap.com/javadocs/NW04S/current/wd/com/sap/tc/webdynpro/progmodel/api/IWDContext.html#reset()]

For NW04s it is not possible to delete a particular attribute from a node.

Regards,

Sanyev

former_member201361
Active Contributor
0 Kudos

Hi Lev,

To delete all the Dynamically added Attributes , use Reset method as shown below

wdContext.getContext.reset();

if u want to remove only a few selected Attributes , then use remove method as shown below.

wdContext.nodeInventor().getNodeInfo().getAttribute("ur Attribute name").remove();

Hope it helps

Thanks and Regards

Former Member
0 Kudos

Hi,

Please check this link

Try this, wdContext.getContext().reset(); as give in the link which deletes only dynamically created attributes and not the ones which created at design time

Edited by: Santhosh Edla on Feb 18, 2009 4:14 PM

Former Member
0 Kudos

Here is one more useful link