Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session
SOLVED

easy question, subform self-destruct button

Avatar

Level 3

Hi,

I want to have a button in a subform...When I click the button, I want it to delete the subform.

What is the code for that? Something to do with this.parent?

Thanks,

Joe

1 Accepted Solution

Avatar

Correct answer by
Level 10

You can try

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

But you need the following settings..

1) The parent subform should be flowed.

2) The subform that would like to destroy also should be flowed.

3) In the binding tab, check the Repeat subform for each data item.

4) Set the Mimimum count to ZERO.

5) Set the initial count to ONE.

6) Save the form as Dynamic XML form.

Place a button in the above Subform and paste the code in the Click event of the button.

Thanks

Srini

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

You can try

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

But you need the following settings..

1) The parent subform should be flowed.

2) The subform that would like to destroy also should be flowed.

3) In the binding tab, check the Repeat subform for each data item.

4) Set the Mimimum count to ZERO.

5) Set the initial count to ONE.

6) Save the form as Dynamic XML form.

Place a button in the above Subform and paste the code in the Click event of the button.

Thanks

Srini

Avatar

Level 3

Very good Shri.

Very Thorough.

Many thanks,

Joe