on 10-29-2007 4:08 PM
Hello Friends,
I am creating an attribute dynamically in my wdmodify method and added it to context as follows:
IWDAttributeInfo sign = wdContext.wdGetAPI().getRootNodeInfo().addAttribute("sign"+i, "variantpack.sign");
IWDAttributeInfo option = wdContext.wdGetAPI().getRootNodeInfo().addAttribute("option"i1, "variantpack.option");
wdContext.currentContextElement().setAttributeValue("sign", wdContext.currentContextElement().node().getCurrentElement().getAttributeValue("sign"+i).toString().toUpperCase());
wdContext.currentContextElement().setAttributeValue("option", wdContext.currentContextElement().node().getCurrentElement().getAttributeValue("option"i1).toString().toUpperCase());
Now on method onActionSelect, I have to access the attributes.... how I can determine the name: e.g IF I know the name of attribute I can do something like this..
wdContext.currentContextElement().getAttributeValue("sign");
I thought to make an arraylist in wdmodify and add all attribute names and in onActionSelect method read the arraylist and get the attribute-name and then get the value..... dont know if its a good way,
ur suggestions are highly appreciated....
Regards,
Hi Shah,
You can use this code
for (Iterator iter = wdContext.node<name>().getNodeInfo().iterateAttributes(); iter.hasNext();)
{
IWDAttributeInfo attInfo = (IWDAttributeInfo) iter.next();
wdContext.node<Name>().getElementAt(0).getAttributeValue(attInfo.getName());
}
regards,
Siva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sava,
<b>for (Iterator iter = wdContext.node<name>().getNodeInfo().iterateAttributes(); iter.hasNext();)</b>
<name> is the problem to know in my case.... see my coading above, i am creating new attributes and adding them to context....
Now I am thinking to create a node and add to this node the attributes name and value, ...
Any suggestion , how I can do the above otherwise...
Regards,
Okey, I have created a node (Zusr_Sel()) in context which has two attributes,
Zusr_Sel sel = new Zusr_Sel();
sel.setFieldname(fieldName);
sel.setValue("sign"+i);
sel.setFieldname(fieldName);
sel.setValue("option"i1);
Now how I can add this node in context again, so that in other method I can retrieve this node with its values ?
Regards,
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.