Expand my Community achievements bar.

SOLVED

Removing the same row instance from two separate tables

Avatar

Level 3

Hi all,

I have two tables that each have repeatable rows. The two tables should display almost the same information in each instance of the row (I managed to code in a way to bind the values in specific instances of the rows). However, I have added a button within the repeatable row that allows the user to remove the current instance of the row, so that if they look back and realize they don't need a row, they can take it directly out of the table. However, I cannot seem to have the button remove the same row instance from the second table. Is there any way to do this? I am not terribly familiar with the instance manager.

Any help would be greatly appreciated. I just cannot figure out how to identify a specific instance of the repeatable row in the 2nd table.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi there,

When removing instances within an object's event which is inside the instance, you must make sure that you remove this particular instance at the end of the event.

E.g.:

If you remove the instance of which the button is inside before even finishing the whole event, the program will not recognize what event is to be finished because you have removed the object's which is fired..

So here you are trying to finish some code which doesn't exist anymore ...

I suggest you should always remove the instance of (this) object at the end of any event to make sure to finish all your actions before deleting the object.

Hope this help!

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hi there,

When removing instances within an object's event which is inside the instance, you must make sure that you remove this particular instance at the end of the event.

E.g.:

If you remove the instance of which the button is inside before even finishing the whole event, the program will not recognize what event is to be finished because you have removed the object's which is fired..

So here you are trying to finish some code which doesn't exist anymore ...

I suggest you should always remove the instance of (this) object at the end of any event to make sure to finish all your actions before deleting the object.

Hope this help!

Avatar

Level 3

Thank you Magus. This helped a lot. For those who are interested, the code I had in the click event of the Remove Row button in table 1 was:

for (i = 0; i < Table_1._Row1.count; i++) {

    if (this.parent.parent.index === i) {

        this.resolveNode('form1.Subform1.Simple_disposition_table.Table_2._Row1').removeInstance(i);       

    }

}

this.resolveNode('form1.Subform1.Large_sig_disposition_table.Table_1._Row1').removeInstance(this.parent.parent.index);