cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove node attributes dynamically?

Former Member
0 Kudos

Hi all,

I've created a node and dynamically assigned its attributes using -

node.addAttribute(<AttributeName>, "com.sap.dictionary.string");

I would like (during runtime) to delete all those attributes which was created dynamically.

I have tried the following line -

wdContext.myNode().invalidate();

But it does not work.

Suggestions? References?

Thanks,

Aviad

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos
Former Member
0 Kudos

Hi Armin,

reset() is not good for me because it will delete all other nodes in the context.

I only need to delete the attributes of a specific node.

Aviad

Former Member
0 Kudos

Aviad,

IWDContext.reset() is the only way (or the only way available via public API wich is the same

After this call you have to re-create all "remaining" structure again.

VS

Former Member
0 Kudos

Hi VS,

I've tried

wdContext.getContext().reset();

But the context is not empty afterwards.

Am I doing something wrong here?

Aviad

Former Member
0 Kudos

Aviad,

What do you mean with "context is not empty"?

Elements remaining here?

Or not all attributes / nodes discarded?

If second, then note that reset() drops only dynamically created attributes/nodes, but does not affect attributes/nodes created at design-time in IDE.

VS

Former Member
0 Kudos

It was the second...

Which means that all is working now.

Thanks guys!!

Answers (0)