Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

Deleting specific row (dynamically) in a subform with multiple pages

Avatar

Level 1

I am going crazy trying to delete a row in a subform.  So for I can only get it to delete the second row, and (this.parent.index) deletes the first row... which is also not desired.  I want the user to be able to delete the particular row that s/he clicks

1 Reply

Avatar

Former Community Member

On the delete button you have the code:

respirator_inventory.Row1.instanceManager.removeInstance(1);

The parameter that is being passed is the instance that you want to delete. Th einstances are 0 based so in your case no matter which button you press you will always delete the 2nd instance. What you want to do is find out which instance you are on and then delete that instance. You can get teh instance that you are on by using this.parent.index. So putting that into the expression you wil want to change the code to:

respirator_inventory.Row1.instanceManager.removeInstance(this.parent.index);

Paul