on 05-21-2009 2:55 PM
hi ,
i have one question regarding supply function....
Q . is supply function automatically invalidate the sub node which has singelton property true
Thanks,
sudhanshu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sudhanshu,
Say you have node structure as follows:
-->Node1
-
>attr1
-
>attr2
-
>Node2
-
>attr3
Where Node1 is singleton true
The Supply Function for Node1 will be called when Node1 is invalidated. This means that the sub node Node2 will be invalidated as well because the parent node has been invalidated. Then depending on how the supplyfunction is written the sub node will be populated.
Regards,
Kartikaye
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi ,
my supply function is for node2 not for node1.so in my case when i select any element in node1
i populate corresponding in node2,but i have a doubt when i add element in node2 why it is not adding
with the previous element that i added just before.It automatically getting invalidated somewhere.
i am not invalidating any node anywhere.
So my question is that nwds framework automatically invalidate the node to which supply function written i.e. node2
thanks,
sudhanshu
Hi sudhanshu,
May be the code in your supply function is overwriting the elements.
Write the code in your supply function so that it will retain the old elements also in the node.
Are you adding the new elements to the node or binding the element to the node? Try adding the new elements to the node. Don't bind it.
Regards,
Jaya.
int size = wdContext.nodeFirsttable().nodeSectable().size();
IPrivateImageDemoView.ISectableNode SectableNode = parentElement.nodeSectable();
IPrivateImageDemoView.ISectableElement sectableElement = wdContext.nodeSectable().createSectableElement();
sectableElement.setSecattr("secattr"+parentElement.index());
wdContext.nodeSectable().addElement(sectableElement);
Hi,
Just delete the supply function.
And write the code in onActionTable1LeadSelect() like this.
If Node1 is the parent node and Node2 is the child node.
Take the child node as singleton as false.
IPrivateTestCompView.INode2Node node2=wdContext.currentNode1Element().nodeNode2();
IPrivateTestCompView.INode2Element node2Element=node2.createNode2Element();
node2Element.setNode2Value2("Increasing ...."+wdContext.currentNode1Element().getNode1Value1());
wdContext.currentNode1Element().nodeNode2().addElement(node2Element);
It works as per your requriement.
Change your code like this and write this in on action of first table lead select.
int size = wdContext.nodeFirsttable().nodeSectable().size();
IPrivateImageDemoView.ISectableNode SectableNode = wdContext.currentFirstTableNodeElement().nodeSectable();
IPrivateImageDemoView.ISectableElement sectableElement = wdContext.createSectableElement();
sectableElement.setSecattr("secattr"+parentElement.index());
wdContext.currentFirstTableNodeElement().nodeSectable().addElement(sectableElement);
Note: before this delete the supply function and change the nodeSectable singleton prop to false.
Regards,
Charan
Edited by: SRI KRISHNA CHARAN on May 22, 2009 10:07 AM
When you have such a context structure, there exists only a single subnode, namely for the lead-selected element of the parent node. When you change the lead-selection and set it back again afterwards, the subnode does not exist anymore and its supply function is called again (for a new, empty subnode).
Armni
Hi Armin,
yes,it automatically invaildates the nodes whenever the lead selection change.There is a concept of dispose function which is used to store that invalidating values so that every time there will be no need
of backend call.
this dispose function automatically calls when lead selection changes ,but u have to explicitly attached
this dispose function to that node.
Thanks,
sudhanshu
Edited by: Sudhanshu Agarwal on May 25, 2009 7:24 AM
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.