on 09-27-2006 7:43 AM
Hi,
I have added an attribute dynamically using the following line of code in wdDoModifyView():
wdThis.wdGetContext().getContext().getRootNodeInfo ().addAttribute(<attributename>, <datatype>);
Now I want to remove the dynamically created attribute from the context.
Pls suggest me in this regard.
Regards,
Ramesh.
Hi Ramesh,
You can use the following code to remove the attribute dynamically:
Iterator itr = wdContext.node<NodeName>().getNodeInfo().iterateAttributes();
<i>// If the node where you are making these attributes is a context node then just do:</i>
// <b>wdContext.getNodeInfo().iterateAttributes()</b>, <i>for iterator</i>
while(itr.hasNext()){
IWDAttributeInfo attrInfo = (IWDAttributeInfo)itr.next();
attrInfo.remove();
}
This will solve your problem.
Regards
Pravesh
PS: Please consider rewarding points if helpful and solved.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ramesh,
From JavaDoc (https://media.sdn.sap.com/javadocs/NW04/SP12/webdynpro/com/sap/tc/webdynpro/progmodel/api/IWDNodeInfo.html)
<i>Node infos also provide a mean to dynamically add child nodes (there are different methods for unmapped, mapped and recursive nodes) or attributes (unmapped or mapped, several methods to add attributes automatically from external meta data). <b>You cannot remove such nodes or attributes afterwards, you can only reset the whole context to its initial state via IWDContext.reset(boolean).</b>
</i>
Best regards, Maksim Rashchynski.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.