on 05-08-2007 12:23 PM
Dear forumpeople,
At this moment I try to set an attribute with this code:
wdContext.currentContextElement().set...
But, how should I set an attribute which is set in a node?
We tried:
wdContext.current***Element().set*("");
But this is not working because of a NullPointerException.
Any ideas?
Regards,
Adri
Hi ,
Node is like a collection. You have to first initialise it... create elements and them use it.
IPrivateView<viewname>.I<nodename>Element e = wdContext.node<nodename>().create<nodename>Element();
wdcontext.node<nodename>().addElement(e);
.
You have to do this for every element u create.. and then use
wdcontext.node<nodename>().get<nodename>ElementAt(no of the element.. ).setXXX();
And please do search this forum for even elobarate answers.
Good luc..
Regards
Bharathwaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Adri,
If your Problem is solved, Please award points for useful answers.
Regards,
<b>Ramganesan K</b>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Tnkx for the replies, we aprreciated your help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Adri,
Suppose u have a node customer & attribute name inside that,it will be.
wdContext.nodeCustomer().currentCustomerElement().setName();
regards
Sumit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Adi,
That code applicable for context attubutes not for context Node Attributes.
Follow this code,
Adding Values to Context Node:
<b><i>Syntax:</i></b>
IPrivate<View Name>View.I<Node>Element x = wdContext.node<node>().create<node>Element();
WdContext.node<Node>().addElement(x);
x.set<AttributeName>("Value");
<b><u>Example:</u></b>
for ( int i=0;i<=10;i++){
IPrivateBusinessGraphicsView.ITestElement x = wdContext.nodeTest().createTestElement();
wdContext.nodeTest().addElement(x);
x.setMyAttr("100"+i);
x.setMyAttr("2000"+i);
}
This must be solve your Problem
Regards,
<b>Ramganesan K</b>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Adri,
If you want to set a value to attribute in the node then use the following code:
wdContext.node<nodename>.current<NodeElement>.set<attibute>("");
Regards,
Jhansi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Make the cardinality for the node as 1..1.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.