Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Bizarre looping issue

Avatar

Avatar
Level 1
evan_stuckless
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile

Avatar
Level 1
evan_stuckless
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile
evan_stuckless
Level 1

04-04-2018

I am encountering a very strange issue, perhaps someone can help me out with...

I have a set of nested subforms, three deep:

theContainer

     script object with function

     button

phaseForm[*]

goalForm[*]

     taskForm[*]

     taskForm[*]

goalForm[*]

     taskForm[*]

     taskForm[*]

          checkbox

phaseForm[*]... etc

I am looping through the structure with the following code in the script object:

function loopThroughStructure(){

     for (phaseCounter=0; phaseCounter<4; phaseCounter++){

          var theGoalCount = xfa.resolveNode("theContainer.phaseForm[" + phaseCounter + "].goalForm").all; 

          for (goalCounter=0; goalCounter<theGoalCount.length; goalCounter++){

               var theTaskCount = xfa.resolveNode("phaseForm[" + phaseCounter + "].goalForm[" + goalCounter + "].taskForm").all;

               //do stuff

          }

     }

}

Here's my issue. If I call the function at theContainer.button, it works fine. However, if I call the function at taskForm[*].checkbox, the loop fails if there is less than 3 instances of taskForm. Specifically it throws a xfa.resolveNode(...) is null error.

Any help would be appreciated. Thanks!

Evan Stuckless

Accepted Solutions (0)

Answers (0)