Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.
SOLVED

Row removal

Avatar

Level 2

I have created a dynamic form. In this form I have a table that duplicates. The first field is a number field that auto generates the number as you add a new row (1,2,3...etc). I have added the jave to recalculate the number field when you delete a row to keep the numbers in order. On each duplicated table there is an add and delete row. Every thing seems to function as desired except with the deleting of a row. If I have 5 rows and I wish to delete row number 3 it will delete the row above it (2). Does anyone know how make the form delete the duplicated row that the delete row button is in rather than a different row?

1 Accepted Solution

Avatar

Correct answer by
Level 9

Hi Shane,

You need to remove the same instance of the row which is created. Try this one.

form1.page1.Table1.Row1.instanceManager.removeInstance(this.Row1.index);

This will remove the particular row.

Thanks,

Bibhu.

View solution in original post

2 Replies

Avatar

Correct answer by
Level 9

Hi Shane,

You need to remove the same instance of the row which is created. Try this one.

form1.page1.Table1.Row1.instanceManager.removeInstance(this.Row1.index);

This will remove the particular row.

Thanks,

Bibhu.

Avatar

Level 2

Thanks for your reply. It put me on the right path to my solution.

I accomplished what I wanted to do with the below javacode in the click field. I was in a subform so I needed the extra parent.

Table1._Row1.removeInstance(this.parent.parent.index);

-Shane