cancel
Showing results for 
Search instead for 
Did you mean: 

Reculculate field after deleting table row

0 Kudos

Hi folks,

I'm using a button in a dynamic table to delete table rows. In the click event of this button I use the following JavaScript code to delete the table row:

this.parent.parent.instanceManager.removeInstance(this.parent.parent.instanceIndex); //parent.parent b/c there is another subform wrapping the button

The problem is that I have to recalculate a field outisde the table after the row has been delete. Unfortunately after calling the removeInstance method no more code is being executed, as (I think) the button already has been deleted.

Do you have any ideas how I can solve that problem? I already went through many events of the table/table row, but nothing is being executed after deleting the row.

Thanks & best regards,

Matthias

Accepted Solutions (0)

Answers (2)

Answers (2)

NoJo
Active Participant
0 Kudos

you can trigger events of a field by scripting -->

try to add in your coding, after having deleted the row

<field>.execCalculate();

<field> sould be replaced by the correct path....

norbert

0 Kudos

Hi Chintan & Norbert,

thanks for your replies. That's exactly what I tried to do. I've written the code for calculating the field in the calculate event and tried to trigger it via calling the .execCalculate() method. The problem is, that this code is never being executed. After calling the .removeInstance() method the execution of the script stops (validated this via trying to open a message box afterwards).

Any other ideas or workarounds?

Thanks!

Matthias

0 Kudos

Hey guys,

solved the problem. You were totally right. I just made an mistake in accessing the field to be recalculated. Fixed that error and everything works fine by calling the .execCalculate() method.

Thanks a lot!

Matthias

chintan_virani
Active Contributor
0 Kudos

You must write the code for recalculation in calculate event of the required field. For Eg: If I have a dynamic table Table1 and NumericField1 is the name of the field which displays Total of the values entered in Table1 then you must write the code in calculate event of NumericField1.

Also have a look at the Purchase Order Dynamic Interactive form in your Adobe Designer installation directory, that should give you some hints.

Chintan