Creating an Expanding Table that Calculates in Adobe LiveCycle ®

This video demonstrates using Adobe LiveCycle, JavaScript and FormCalc to create a flowing / expanding table that can calculate totals in the table footer.


Code used in this example:


JavaScript in the Expanding Table Buttons:

Add Button – 

 var rowNum = this.parent.parent.index +1;
 this.parent.parent.instanceManager.addInstance(rowNum);

Del Button – 

try
  {
    var rowNum = this.parent.parent.index;
    this.parent.parent.instanceManager.removeInstance(rowNum);
  }
catch(err)
  {
   app.alert(“The minimum number of rows is 1”);  
  }

FormCalc in the Calculate Event of the Totals Cell in Footer Row:

 $.rawValue = Sum(Table1.Row1[*].Cell4);

Mandatory Fields in Adobe LiveCycle ®

How to design and implement mandatory fields at both design time and run time in Adobe LiveCycle.
Code used in this video:
if (this.rawValue==1)
 {
   this.parent.TextBox1.mandatory = “error”;
 }
else
 {
   this.parent.TextBox1.mandatory = “disabled”;
 }

//To make the Field optional change the above statement to: this.parent.TextField1.mandatory = “warning”;

HTML Snippets Powered By : XYZScripts.com