Removing custom controller from showPrintPreview form

Questions, tips and tricks and techniques for scripting in Servoy

Removing custom controller from showPrintPreview form

Postby Westy » Fri Feb 13, 2004 9:51 pm

I have a button on a form with a custom controller that brings the user to a form that has the default controller. When the user clicks a Print button on that form the Windows Print Preview screen comes up with the custom controller instead of the default controller.

How can I make the Windows Print Preview screen display the form with either the default controller or no controller (instead of the custom controller)?
Westy
 
Posts: 852
Joined: Fri Feb 13, 2004 5:27 am
Location: Lynnfield, Massachusetts USA

Postby jcompagner » Sat Feb 21, 2004 11:47 am

to make sure i understand
the form that you are printing does have a default controller (so not a custom one) and when you print it it suddenly has a custom controller?
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby Westy » Sun Feb 22, 2004 10:09 pm

Yes, per attached: when a user clicks the Print icon from screen1, screen2 appears with the default controller. When the Print button is then clicked, screen3 appears with the custom controller instead of the default controller.
Attachments
screen1.gif
screen1.gif (28.81 KiB) Viewed 2821 times
screen2.gif
screen2.gif (13.9 KiB) Viewed 2821 times
screen3.gif
screen3.gif (24.67 KiB) Viewed 2821 times
Westy
 
Posts: 852
Joined: Fri Feb 13, 2004 5:27 am
Location: Lynnfield, Massachusetts USA

Postby jcompagner » Mon Feb 23, 2004 12:12 pm

are you sure that the form you show in that dialog in screen2 is exactly the same form you print in screen3?

besides that you can't show the same controller in the main and in the dialog (at the same time) Are you trying to do that?
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby Westy » Mon Feb 23, 2004 6:17 pm

>are you sure that the form you show in that dialog in screen2 is exactly the same form you print in screen3?<

I went back and double-checked. Sure enough, it is a different form.

Experimenting some more I see that the controller in screen2 was being ignored because it was attached to a form that was in a dialog. So when the dialog closed before the Windows Preview screen opened, Servoy reverted back to the prior controller which was the custom controller of screen1.

I have now solved the problem by adding another blank form that only contains a "Return to Contacts" button. The blank form has the controller setting that I want. So I call the blank form after the dialog is closed and just before the Windows Print Preview screen is opened. That way servoy uses the controller from the blank form. When the user closes the Print Preview screen, the blank form appears with the "Return to Contacts" button, allowing the user to return to the Contacts (screen1). This seems to work fine.

Your questions got me thinking in the right direction. Thank you.

Dean
Westy
 
Posts: 852
Joined: Fri Feb 13, 2004 5:27 am
Location: Lynnfield, Massachusetts USA


Return to Methods

Who is online

Users browsing this forum: No registered users and 28 guests

cron