cancel
Showing results for 
Search instead for 
Did you mean: 

Removing attributes from node

Former Member
0 Kudos

Hi,

Im creating a node and its attributes dynamically and binding it to a table to show a table dynamically. The problem is that when i load a new item, i have to rebuild the node and table because it might have different columns. The node allways has 3 fixed columns (id, name, description) so first i have to remove all of the attributes except the id, name and description. Same for the table columns. Can anyone tell me how to remove attributes from a node or how to differently solve my problem? All i see is how to remove an element but is a data right, not the model?

Much thanks,

Hugo Hendriks

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

I had a similar situation, where 2 table columns were always present, and the name and type of other columns were only available runtime.

I simply deleted all data (invalidate()) and recreated the context from scratch after each model execution that impacts the table structure.

Otherwise, use the API to find the right methods for deleting Nodes and Elements.

https://media.sdn.sap.com/javadocs/NW04/SPS15/wd/index.html

Good luck,

Roelof

Former Member
0 Kudos

Hi,

mmmmmm, im looking through the javadoc but cant find a method to remove an attribute from a node...kinda strange.

Does invalidate remove all the data or all the attribues of the node?

greetings,

Hugo

vijayakhanna_raman
Active Contributor
0 Kudos

Hi,

Invalidate removes the data only use reset to remove attributes i.e. IWDContext.reset().

Regards,

Vijayakhanna Raman

Former Member
0 Kudos

Hi,

If you want to reset the nodes created at design time use

wdContext.getContext().reset(true);

Regards

Saravanan K

Former Member
0 Kudos

But this kill all of my context. I only want to clear the attributes of 1 node, not of all the nodes in my context.

regards,

Hugo

vijayakhanna_raman
Active Contributor
0 Kudos

Hi,

I think this is not not possible

Regards,

Vijayakhanna Raman

Former Member
0 Kudos

Hi Hugo,

Try it this way:

wdContext.<node>.getContext().reset(true);

This should remove only the attributes of the specified node.

Regards,

Christoph

vijayakhanna_raman
Active Contributor
0 Kudos

Hi,

Use this

wdContext.getContext().reset(false);

This will remove all the context created dynamically

Check this,

Regards,

Vijayakhanna Raman