Skip to Content
author's profile photo Former Member
Former Member

understanding bind()

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Feb 01, 2008 at 05:21 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 31, 2008 at 11:00 PM

    Erdem,

    Check last piece of this weblog : /people/niharika.jeena/blog/2005/03/31/differnce-between-add-and-bind-method-for-passing-elements-to-a-bapi-from-webdynpro

    Chintan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 01, 2008 at 02:38 AM
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 01, 2008 at 08:36 AM

    Hi Ok ,

    but one question more.

    Generally create command which you do using is, if you want to create an instace, don't you ?

    You say:

    To create a node you have to use the following code:

    wdContext.getNodeInfo().addChild(name, elementClass, singleton, collection, selection, initializeLeadSelection, structure)

    When is it necessary to create a node? I have thoughed you can insert simply nodes and elements

    by right clicking inside of each controller context tab.

    regards

    ilhan

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      When is it necessary to create a node?

      When you are not sure abt the actual structure at design time, you can create it. This is the time where we use this.(In one word Dynamic)

      Regards

      Ayyapparaj

  • author's profile photo Former Member
    Former Member
    Posted on Feb 01, 2008 at 08:11 AM

    Hi Ayyapparaj and Others,

    but (pls see NWDS Help Example of the Use of an Interactive PDF Form

    go to Control Interactive Form, right click and hit at the bottom the link

    Example of how to use an Interactive PDF Form.)

    In the Context structure is Node -> AddressNode already being existing why

    recreate it again with this command ->

    wdContext.nodeAddressNode().createAddressNodeElement().

    What does this command exactly do -> wdContext.nodeAddressNode().createAddressNodeElement().

    Creating a new "AddressNode" ?

    Creating a new "AddressNode-Element" ? If so There are also two elements existing

    named "FirstName" and "Name"

    Regards

    Sas

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      In the Context structure is Node -> AddressNode already being existing why

      recreate it again with this command ->

      wdContext.nodeAddressNode().createAddressNodeElement().

      In the above statement you are creating an instance(element ) under that context node, and not the node.

      What does this command exactly do -> wdContext.nodeAddressNode().createAddressNodeElement().

      This adds an element to an existing node called Address

      Creating a new "AddressNode" ?

      To create a node you have to use the following code

      wdContext.getNodeInfo().addChild(name, elementClass, singleton, collection, selection, initializeLeadSelection, structure)

      Creating a new "AddressNode-Element" ? If so There are also two elements existing

      named "FirstName" and "Name"

      firstname and Name are not elements they are attributes.

      Regards

      Ayyapparaj

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.