cancel
Showing results for 
Search instead for 
Did you mean: 

understanding bind()

Former Member
0 Kudos

Hello!

I don't understand the necessity of -> bind() as below

stated. Why is it needed. In which cases must it

be used and when can it be ignored?

Maybe always if you create a Nodeelement ?????

Regards

sas

IPrivateTestViewInteractivePDFForm.IAddressNodeElement element = wdContext.nodeAddressNode().createAddressNodeElement();

element.setFirstName("Will");

element.setName("Smith");

wdContext.nodeAddressNode().bind(element);

View Entire Topic
Former Member
0 Kudos

Hi,

Based on the code what you have posted

IPrivateTestViewInteractivePDFForm.IAddressNodeElement element = wdContext.nodeAddressNode().createAddressNodeElement();

element.setFirstName("Will");

element.setName("Smith");

wdContext.nodeAddressNode().bind(element);

In the above code first you are trying to create an element of the node "AddressNode", Which will be stored in a variable called "element."

But this element and the node "AddressNode" doesnt have any relation other than the structure.

Now if you want to make this element part of this node you need to add that to node "AddressNode" . To do this their are two ways

Either you can use the one currently used , or else while creating it self you can make use of the method createAndAddElement() for the node.

One thing you have to note here is when you bind your previous values will be overridden. So if you want to add multiple elements add them to an List and then bind the list.

Hope its clear to you.

Regards

Ayyapparaj.