Data is repeated in multiple instances, please help.

Hello

I have worked on this form using Adobe Livecycle ES2 9 days and need help.  I am new to LiveCycle and JavaScript, but as you'll see, I learned a lot .

I have a repeatable subform (GoalSheet) which totals values based on a drop-down list:

var len is form1. GoalSheet.Table6._Others.count;

$ var = 0.0;

this.rawValue = 0;

If (form1. GoalSheet.Table6.First.Funding1.rawValue == 1)

{

sum += form1. GoalSheet.Table6.First.Cost.rawValue;

}

for (var i = 0; i < len; i ++) {}

If (form1. GoalSheet.Table6.resolveNode("Others["_+_i_+_"]").fsource.rawValue == 1) {}

sum += form1. GoalSheet.Table6.resolveNode ("other [" + i + "]" ""). Cost2.RawValue;

}

}

this.rawValue = sum;

It works beautifully.  However, when the user creates a second instance of GoalSheet, it does not work.

Any suggestions?

A link to the form is here: https://www.dropbox.com/s/94t48cw2ywcxpcq/4-20%20Draft_total_formcalc_pagination_safetynet %20v126.pdf

Thanks for any help!

Michael

Hello

the GoalSheet is a repeatable instance that other ranks you have to perform a loop over all its instantiated too.

var goalSheets = _GoalSheet.count,
          sum = 0;

for (var i = 0; i < goalSheets; i += 1) {
          var vGoalSheet = form1.resolveNode("GoalSheet[" + i + "]"),
                    vOthers = vGoalSheet.Table6._Others.count;

          if (vGoalSheet.Table6.First.Funding1.rawValue == "1") {
                    sum += vGoalSheet.Table6.First.Funding1.rawValue;
                    for (var j = 0; j < vOthers; j += 1) {
                              sum += vGoalSheet.Table6.resolveNode("Others[" + j + "]").Cost2.rawValue;
                    }
          }
}
this.rawValue = sum;

I hope this helps.

Tags: Adobe LiveCycle

Similar Questions

Maybe you are looking for