Modified event not raised when typing in textbox

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

cew
User
Posts: 213
Joined: Tue Feb 01, 2011 8:14 am

Modified event not raised when typing in textbox

Post by cew »

Hi there,

the PDFXChange-Viewer does not raise the Modified event if the user types in a comment textbox.
The Save command (disc symbol) gets active.

I tried getting the right status using

Code: Select all

GetDocumentProperty(docId, "Modified", out outData, 0);
But in my case, just clicking in an existing textbox and typing, GetDocumentProperty returns false.

There is no event being fired that I could use to detect changes by typing without clicking outside the textbox.

Please help!

Best regards
cew
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19883
Joined: Mon Jan 12, 2009 8:07 am

Re: Modified event not raised when typing in textbox

Post by Stefan - PDF-XChange »

Hello cew,

The same happens with the end user Viewer - you need to exit the comment box/typewriter/text area tool before the document is flagged as modified.

I will check with my colleagues why this is so.

Best,
Stefan
cew
User
Posts: 213
Joined: Tue Feb 01, 2011 8:14 am

Re: Modified event not raised when typing in textbox

Post by cew »

Hi Stefan,
Tracker Supp-Stefan wrote: [...] you need to exit the comment box/typewriter/text area tool before the document is flagged as modified.
the viewer is placed within a tab. If the user wants to close the tab, I have to check if the doc is modified.
Therefore I have to get the right state before closing the the tab because otherwise changes would get lost...

Best
cew
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19883
Joined: Mon Jan 12, 2009 8:07 am

Re: Modified event not raised when typing in textbox

Post by Stefan - PDF-XChange »

Hello cew,

I just did a simple test in the end user Viewer - and I presume the same will work in the AX (could test it a bit later if I have a minute) - is that even if I've only opened a document -and then started a typewriter annotation - the file is not flagged as modified - but when I try to close it - I do get the ConfirmDocumentSave prompt - so I believe that you should still be able to capture any document modifications - even if a notification is not sent before the user exists the comment field.

Best,
Stefan
cew
User
Posts: 213
Joined: Tue Feb 01, 2011 8:14 am

Re: Modified event not raised when typing in textbox

Post by cew »

Tracker Supp-Stefan wrote:I do get the ConfirmDocumentSave prompt - so I believe that you should still be able to capture any document modifications - even if a notification is not sent before the user exists the comment field.
I don't allow the user to close the document manually. Because the viewer is located in a tab control, I handle all on my own. The user won't get any prompt from the viewer.
I tried to get the "Prompts.ConfirmDocumentSave" and cancel it using SetProperty("Prompts.ConfirmDocumentSave.Cancel", 1) to avoid the prompt and just raise my own modified-event. But the cancel did not work. The prompt is still shown.

How does the Save-Button gets notified when typing in a textbox?

Best
cew
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19883
Joined: Mon Jan 12, 2009 8:07 am

Re: Modified event not raised when typing in textbox

Post by Stefan - PDF-XChange »

Hello Cew,

ConfirmDocumentSave is a group object, and you will need to set the UserChoise value.

The proper syntax would be:
SetProperty("Prompts.ConfirmDocumentSave.UserChoice", DataIn(2), 0);
or
SetProperty("Prompts.ConfirmDocumentSave.UserChoice", DataIn("Cancel"), 0);

Best,
Stefan
cew
User
Posts: 213
Joined: Tue Feb 01, 2011 8:14 am

Re: Modified event not raised when typing in textbox

Post by cew »

Hi Stefan,

nevertheless I could implement the workaround using "ConfirmDocumentSave"
will you implement raising the Modified-Event to be notified like your save-command?

Best
cew
cew
User
Posts: 213
Joined: Tue Feb 01, 2011 8:14 am

Re: Modified event not raised when typing in textbox

Post by cew »

Hi stefan,

will you implement raising the Modified-Event to be notified like your save-command?

Best
cew
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2445
Joined: Thu Jun 30, 2005 4:11 pm

Re: Modified event not raised when typing in textbox

Post by Vasyl - PDF-XChange »

Sure - we will add simple event like "TextEditor.Modified" into new version V3 of our SDK..
PDF-XChange Co. LTD (Project Developer)

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.