Multiple repeating SubForms binding to the same data node | Community
Skip to main content
February 28, 2013
Question

Multiple repeating SubForms binding to the same data node

  • February 28, 2013
  • 14 replies
  • 14355 views

Having multiple repeating SubForms binding to the same data node : In our documents, many times we need to display information from same table in multiple locations. For example, if document displays information of Insureds on one page and information of drivers on another page, we need to create a LiveCycle document with two SubForms. Each SubForm needs to have a repeating binding to CommonInsured element in XSD.  LiveCycle Designer is not able to handle such case. We cannot have two subforms bound to the same node, ONLY in a case where repeating option is selected for data binding.

The only way I have found out is the following Javascript

//Get the data node from XML. You will find the code for this function in //JavaHelperFunctions library.

// InsuredDataRepeatingSubForm is a second subform.

//You need to manually add instances to this subform at the

//runtime and Insured data to each instance.

var insuArray = JavaHelperFunctions.getInsureds();

    var i=0;

    for( i=0; i<insuArray.length; i++)

    {

       if (i>0)

       {

var thesubform = this.InsuredDataRepeatingSubForm.instanceManager.addInstance(i);

              thesubform.InsuredName.rawValue = insuArray[i].fullName.value;

       }  

       else

       {

               this.InsuredDataRepeatingSubForm.InsuredName.rawValue = insuArray[i].fullName.value;

       }

    }

Is there any way I can achieve directly using bindings since we are trying to minimize javascript that changes the layout of the form?

Thanks in advance!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

14 replies

Level 9
March 27, 2013

Glad I could help.

Kyle

July 31, 2013

Kyle,

Glad I found this thread. 

I'm doing essentially the same thing that Vanessa was doing.  Primary difference being that i'm not duplicating a table row, but a subform.

I can only get the function to work partially for me, it adds the same number of instances to the sister page, but doesn't populate those fields with the values. 

Any suggestions on where my issue might be?

Thanks

November 21, 2018

Hello Kyle,

I have created a subform with the ability to auto fill information in subsequent fields throughout the form (1 pager). I added an "ADD" button so that it can duplicate the form as many times as necessary for when we are doing bulk-work. The issue that I am having is that all of the information I enter in the first form will auto-populate in all subsequent "added (repeated)" forms.

I would like for each of the "added" subforms to work independently from each other when it comes to "binding", but still have the ability to auto-populate information within each form only.

how can i accomplish this?

PS: i cannot share the template as its copyrighted by my employer.

Thank you so much!!

Jorge

_Bruce_Robertson
Level 10
November 22, 2018

Hi Jorge,

I'm not sure what you mean by work independently from each other when it comes to "binding", Do you want the details to auto-populate or are you looking for a button to optionally populate the form.

Bruce