cancel
Showing results for 
Search instead for 
Did you mean: 

supply function

Former Member
0 Kudos

hi ,

i have one question regarding supply function....

Q . is supply function automatically invalidate the sub node which has singelton property true

Thanks,

sudhanshu

Accepted Solutions (0)

Answers (2)

Answers (2)

ravindra_bollapalli2
Active Contributor
0 Kudos
Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

hi,

i m adding only not binding..

thanks,

sudhanshu

Former Member
0 Kudos

Hi sudhanshu,

Can you paste you supply function code.

Regards,

Jaya.

Former Member
0 Kudos

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);

Former Member
0 Kudos

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

Former Member
0 Kudos

hi charan,

that i know ,actually my question is when framework call the supply fuction it automatically invalidate that node or not.

thanks,

sudhanhsu

Former Member
0 Kudos

Hi,

Even i tried the same. Supply function is invalidating the subnode.

But I am not sure how to control the supply function not to invalidate.

That is why i gave you the alternative solution.

Regards,

Charan

Former Member
0 Kudos

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

anoop_gupta2
Participant
0 Kudos

Hi sudhanshu ,

As per my thinking Yes the spully function invalidates the node by itself.

Regards

Anoop

Former Member
0 Kudos

No, the supply function does not invalidate the node but it is called whenever the node has been invalidated and is accessed again.

Armin

Former Member
0 Kudos

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