cancel
Showing results for 
Search instead for 
Did you mean: 

Initialize event happens twice when using setDynamic

Former Member
0 Kudos

Hi.

I'm using WD Java, EP 7 SP 14 and Designer 8.

I have a form with a table, and in the initialize event I add a row to the table using the addInstance() method.

I also set the document to be dynamic using the setDynamic method of the class IWDPDFDocumentInteractiveFormContext, in the method wdDoModifyView.

Then, when I run the form, there are 2 rows added to the table.

But when I don't use the setDynamic method, only one row is added (as it should be).

Is there a chance that using the setDynamic method calls the Initialize event twice?

I'll be thankful if anyone can try this, so I would know if that's a general problem, or if it happens only to me.

Best regards,

Udi.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Did you solve this? I'm having the same issue (Twice initialization)

Former Member
0 Kudos

Hai Udi,

Can you please tell me how you created an instance for the Interface "IWDPDFDocumentInteractiveFormContext". There seems to be problem in Dynamicic Forms. I thought I could use this method setDynamic. Also, the support pack that we are using here is SP 13 and Designer 7.0

Regards,

Mathan

harman_shahi
Contributor
0 Kudos

Hi Udi,

I donu2019t think the setDynamic() method would trigger the initialize event (I could be wrong though). The case could be that your Initialize code is only getting triggered when you use the setDynamic() method, and the One table row is always there by default!

Try putting some code in your initialize method for debugging:

xfa.host.messageBox("initializing form...");

See how many times this message pops up!

Just a suggestionu2026

Hope this helps,

Harman

Former Member
0 Kudos

Hi Harman,

The table has one row as default (Min count 1).

When I don't use the setDynamic method, the table has 2 rows, and when I do use the setDynamic method the table has 3 rows.

That's the simple case; I originally used it in a loop, and when using setDynamic the tables would have a double number of rows added to them.

Former Member
0 Kudos

Hi

if there are elements in the node which you have binded to the Table row, then as many number of rows will be created... so please check whether your node has elements?

Thanks

Gopal.