1 Reply Latest reply on Jan 20, 2012 10:03 AM by Bill95722

    Repeatable subform length lost?

    Bill95722 Level 1

      I have this code in the click event of a "Delete" button within a repeatable subform:

       

      var SFArray = xfa.resolveNodes("SubForm[*]"); //  build array of subforms

      xfa.host.messageBox("length=" + SFArray.length);

      if (_SubForm.count > _SubForm.occur.min) { // check for minimum

           _SubForm.removeInstance(SubForm.index); // remove requested instance

      } // end if

      var SFArray = xfa.resolveNodes("SubForm[*]");

      xfa.host.messageBox("newlength=" + SFArray.length);

       

      At execution I get length=3 (for example), then newlength=0 following the removeInstance

       

      I don't understand why the 2nd resolveNodes produces length=0 and following code using the array fails with "index out of bounds"

       

      Thanks for any help!