printpreview from dialogform

i would like to print over the printpreview from a form in a dialog with check out if the printerdialog is canceled. in a normal form this works well with the ‘isLastPrintPreviewPrinted()’ function, but not by printing from a form in a dialog.
it would be nice to get a hint.

thomas

What is it that doesn’t work here Thomas? In other words can you be more specific?

ok, for example i open an invoice form in a dialog from a tabpanel in addresses. now it is important to know if the printpreview of the invoice is finished with a print or not. for this i have a global variable (globals.vPrintPreview) and set it to 1 in the print methode. when i enter the printpreview with ‘print’ or ‘close’ servoy returns to the addresses form. in the _onShow methode of the addresses form i ask if globals.vPrintPreview == 1 for the ‘isLastPrintPreviewPrinted()’ function. but this doesn’t works, because it seems that servoy returns to the addresses form before the printpreview is opening and my error dialog comes at the same time as the printpreview! this phaenomen is only with a print out from a form in a dialog.
i hope i could descripe the problem better…
thomas

Aha, this looks like the same ‘issue/feature’ as where the code doesn’t wait for a (second) formindialog called in another (first) formindialog. Conclusion, but I could be wrong here, this is not possible right now.

ok, thank you marcel! i changed the function in my solution. i created one button with the print methode and one only for the printpreview. now it would be nice to make the print button in the printpreview window visible or enabeled.

Stackable forms-in-dialog should make possible what you were going for. Additionally, if it were possible to then have the print preview act as a form-in-dialog itself, then the user cannot accidentally close the program by closing the preview window with the little red close-window button. Users have been conditioned to expect to be able to close ancillary windows in this way.

Jim

I was already prepared for you to contribute with a post along this line yesterday. Thank you Jim for your persistance :)

hi jim,

i think it would be a great thing and makes solutions more professional to have printpreviews in a form-in-dialog. where is the problem for users to close the printpreview with the “close” button and the program after this? i don’t know any user who needs the red close-cross for a lucky life.

Sorry Thomas, I am not sure I understand your question, but I’ll give answering it a go anyway. It will be verbose, I’m afraid.

No one “needs” the little red close button. But it exists, on the print preview form. Since it is there, it might be a good thing if it conformed to what a user might expect from their experiences with other (similar) applications.

I maintain that users will expect that- in the case of forms that are not perceived to be the “main” form, e.g. pop-up windows, print dialogs, etc.- the little red close button will simply close that window, and NOT cause the program to quit. In the case of the “main” form, the expectation is less clear; sometimes the program will quit, and sometimes the window simply closes. Ideally, this is all controllable methodically (or as a form property, perhaps), but in any event, I would appreciate being able to assure that users will not find that they have inadvertently quit the program when they just intended to dismiss what they thought was a big-ass dialog box.

Wishing you a “lucky life”,

Jim

Hi Marcel!

I was already prepared for you to contribute with a post along this line yesterday. Thank you Jim for your persistance.

My pleasure! Yeah, I guess I can be a bit predictable on some matters, eh? So good to have you back… the world of Servoy Talk is a better place when you are in it.

Jim

Servoy Talk is a better place when you are in it

Hmmm, a little too much honor I guess :)

hi jim, i agree with you!
sometimes it will be difficult to discribe a problem in working correctly.
for me it’s almost easy to handle a problem in programming solutions with servoy. if an idea doesn’ t works i try another. there are many different ways to go. just now i’m still a servoy beginner, but my intension is to make professional, clever and useable solutions. therefore i wish to control the whole functionality by programming (methodes, functions, properties).
i’m happy about the replies of my topics. you and the other participants gave me valuable answers.
thank you