Page 1 of 1

How to tell when showdialog() is closed/exited?

Posted: Thu Oct 10, 2013 4:48 pm
by pcady
How do I detect when a viewer shown with showdialog() is closed with the Close or Exit button. I tried adding things like this

report.addEventListener(Event.CLOSE, onComplete);
report.addEventListener(Event.CANCEL, onCancel);

but I'm not getting anywhere.

Thanks!

Re: How to tell when showdialog() is closed/exited?

Posted: Fri Oct 11, 2013 7:21 am
by Vladimir
Hello,

You can use this code:

Code: Select all

var viewer: StiViewerFx = report.showDialog();

// The dialog is closed (Close and Exit buttons)
viewer.parent.addEventListener(StiWindowFormEvent.FORM_CLOSE, onViewerDialogClose);

// The viewer is closed (only Exit button)
viewer.addEventListener(StiViewerEvent.EXIT, onViewerExit);


private function onViewerDialogClose(event: StiWindowFormEvent): void
{
	StiMessageBox.showMessage("Viewer", "Form Close OK!");
}

private function onViewerExit(event: StiViewerEvent): void
{
	StiMessageBox.showMessage("Viewer", "Exit OK!");
}
Thank you.

Re: How to tell when showdialog() is closed/exited?

Posted: Fri Oct 11, 2013 1:15 pm
by pcady
D'oh. I completely missed the EXIT event.

Thanks for your help.
-pc

Re: How to tell when showdialog() is closed/exited?

Posted: Mon Oct 14, 2013 5:12 am
by HighAley
Hello.

We are always glad to help you.
Let us know if you need any additional help.

Thank you.