Order of e.document.* events (strange case with an XFA)

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Order of e.document.* events (strange case with an XFA)

Post by zarkogajic »

Hi Support,

When looking at the following events: e_document_initialized, e_pagesView_ready, e_documentView_ready and e_document_activated, the order how events are fired for a newly opened document is how I ordered them.

I have a strange case with one XFA document, where the order of events fired is:
e_document_initialized
*e_document_activated*
e_pagesView_ready
e_documentView_ready

This happens when a message dialog appears stating some web service (XFA uses) cannot be reached. The tab for a document is created and visible, but the document view area does not yet display the document, something like:

image.png

What's strange is that inside e_document_activated the document's ActiveView: (IPXV_DocumentView) *is* assigned (not null), even though e_documentView_prepare / e_documentView_ready are not yet fired.

So, in the above case I'm missing an event when a DocumentView is created / accessible for a document, after e_document_initialized but before e_document_activated.

Even more strange, this out-of-order ordering happens only if this document is the first document loaded. If a "normal" document is open before this XFA, and then this XFA, the order of events is as expected (e_document_activated after e_documentView_ready for the XFA).

Any idea what's happening here?

The thing is that I need e_documentView_ready (or similar) event to get to document's ActiveView as this allows me to know in what MainView (/MainFrame) the document is being loaded via GetMainViewFromUIObj(). And I need this *before* e_document_activated.

p.s.
The XFA document does not have open actions or similar. So, e_document_beforeRunOpenScripts is not fired for it.

p.s.2
It is possible (?) that the ordering has changed in the last 2 releases - but to be 100% sure I would have to go back in time, install older versions etc ... so better if I do not have to do this ...

-žarko
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Order of e.document.* events (strange case with an XFA)

Post by Sasha - Tracker Dev Team »

Hello zarkogajic,

Forwarded this one to Vasyl - hopefully he can tell more.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: Order of e.document.* events (strange case with an XFA)

Post by zarkogajic »

Hi Alex,

Thanks.

I just went back to 352 version, and the event order *is* different (when compared to 354) for that particular document.

The event order is:

e_document_initialized
e_pagesView_ready
e_documentView_prepare/e_documentView_ready
e_pagesView_ready (2nd time! but a different instance)
e_document_activated

-žarko
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Order of e.document.* events (strange case with an XFA)

Post by Sasha - Tracker Dev Team »

Hello zarkogajic,

Notified Vasyl about this again, he'll take a look when he has time

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: Order of e.document.* events (strange case with an XFA)

Post by zarkogajic »

Hi Support,

Any info here?

User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2351
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Order of e.document.* events (strange case with an XFA)

Post by Vasyl-Tracker Dev Team »

Hi zarko.

Unfortunately, but I cannot reproduce this wrong order of events in Editor, nor in our FullDemo. Here I got the following events order:

e.document.initialized
e.pagesView.initialized
e.documentView.initialized

e.pagesView.ready

e.documentView.prepare
e.documentView.ready

e.document.viewingStarted
e.document.activated
...

The simple example project(or document, if issue is document-related) with reproducible case will be helpful..

Cheers.
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: Order of e.document.* events (strange case with an XFA)

Post by zarkogajic »

Hi Vasly,

I can send the document, but not here (publicly).

Where to upload?

-žarko
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2351
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Order of e.document.* events (strange case with an XFA)

Post by Vasyl-Tracker Dev Team »

Please send it support@pdf-xchange.com, and with simple reference to this topic. Thanks.

Also let me confirm: does this look like a document-related problem to you? Does the order of such event documents change when you open different XFA documents?
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: Order of e.document.* events (strange case with an XFA)

Post by zarkogajic »

Hi Vasyl,

Document sent to email.
does this look like a document-related problem to you? Does the order of such event documents change when you open different XFA documents?
YES.


-žarko
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17765
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Order of e.document.* events (strange case with an XFA)

Post by Tracker Supp-Stefan »

Hello zarkogajic,

Thanks for the files! We got those and have forwarded them to Vasyl and Sasha!

Kind regards,
Stefan
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: Order of e.document.* events (strange case with an XFA)

Post by zarkogajic »

Hi Support,

Any news here?

-žarko
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2351
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Order of e.document.* events (strange case with an XFA)

Post by Vasyl-Tracker Dev Team »

Hi zarko.

Seems the showing special modal dialogue "Open Site Warning..." when your document is opening - it causes sending the "e.document.activated" too early:

e_document_initialized
>>
1. *e_document_activated*
2. show modal "Open Site Warning..." dialog
3. wait for close dialog by user
<<
e_pagesView_ready
e_documentView_ready

We will try to fix this issue in the new upcoming build.

Cheers.
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: Order of e.document.* events (strange case with an XFA)

Post by zarkogajic »

Hi Vasyl,

Thanks for confirming :)

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17765
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Order of e.document.* events (strange case with an XFA)

Post by Tracker Supp-Stefan »

:)
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: Order of e.document.* events (strange case with an XFA)

Post by zarkogajic »

Hi support,
Vasyl-Tracker Dev Team wrote: Wed Jun 09, 2021 1:54 am Seems the showing special modal dialogue "Open Site Warning..." when your document is opening - it causes sending the "e.document.activated" too early:
...
We will try to fix this issue in the new upcoming build.

Seems that in 9.1.356 this issue is still present (so, not fixed), yes?

-žarko
User avatar
Dimitar - Tracker Supp
Site Admin
Posts: 1777
Joined: Mon Jan 15, 2018 9:01 am

Re: Order of e.document.* events (strange case with an XFA)

Post by Dimitar - Tracker Supp »

Hi,

This issue was reported fixed so it should be gone by now.

Could you please test version 9.2.358.0?

Regards.
Post Reply