Quantcast
Channel: Adobe Community : All Content - LiveCycle Designer
Viewing all articles
Browse latest Browse all 5571

Multiple repeating SubForms binding to the same data node

$
0
0

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!


Viewing all articles
Browse latest Browse all 5571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>