Skip navigation
Bill95722
Currently Being Moderated

Still don't seem to understand removeInstance correctly...

Jan 3, 2011 4:05 PM

I have a repeating subform with a Delete button. In the Delete button Click event I have this code:

_subform.removeInstance(this.index);

 

However, every time the Delete button is Clicked only instance 0 is removed. Naturally, I would desire the subform

containing the Delete button that has been clicked be the subform removed, not subform (0).

 

I have read the other posts about removeInstance but they don't seem to address my problem.

 

Please advise on what I am missing, Thank you!

 
Replies
  • Currently Being Moderated
    Jan 3, 2011 4:29 PM   in reply to Bill95722

    Try

     

    _subform.removeInstance(this.parent.index);

     

    Steve

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 4, 2011 1:07 AM   in reply to Bill95722

    Hi,

     

    Take the count of the subform by using the following syntax

     

    var StrCount = SubformPath.instanceManager.count

    here SubformPath is the path of the repeating subform.

     

    Subformpath.instanceManager.removeInstance(StrCount-1);

     

    Try with this option it would delete the last added subform. hope you are looking for this.

     

    Regards,

    Jayakar

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 4, 2011 7:07 AM   in reply to Bill95722

    It would be easiest so see the form. I can take a look if possible. stwalker.adobe.@gmail.com.

     

    Steve

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 4, 2011 7:45 AM   in reply to Bill95722

    Sorry. Good catch. stwalker.adobe@gmail.com

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points