on 04-25-2007 2:23 PM
Hi,
I am simple view.
Context of the view has a node "Data" :cardinality :0..n , Selection 0..1
Attribute of Node "Data" is "text".
I am trying to set a value to the text attribute in the wdDoInit() of the view Implementation
wdContext.CurrentDataElement.settext("abc");
During runtime i am getting Null pointer exception.
Please explain me whether before setting the value to the attribute do i need to create that attribute element or i need to changed the propertiese of node or anything else ?
Hi,
Set the cardinality and selection as 1..n, then execute..
if found useful give points..
Juhi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I got the solution and more understanding of node cardinality.
By changing the cardinality to 1..1 i was able to set value to the attribute of node.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
congrats!!!!!!!
other thing when you have cardinality 0.n then you first need to create its element and then need to set the value attribute of that element and finally you need to bind that element to node. like
IPrivateTestapplView.IDataElement tmpEle = wdContext.createDataElement();
tmpEle.setText("Name");
wdContext.nodeData().bind(tmpEle); //this is done because node has no way to
//understand that tmpEle belongs to it..
hope it clears doubt
regards
HI,
you are getting null pointer exception because the node data has no element , do one thing change its cardinality from 0.n to 1.n and try same statement.
it wont give error coz it has default element this time.
cardinality when set to 1.1. or 1.n means that the node will have default element at runtime which then can be refered . in case of 0.n , you first need to create the and then can set its values
hope it helps
regards
let me kno if you want something more elaboration
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
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.