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

Stimulsoft Reports.Flex discussion
Locked
pcady
Posts: 6
Joined: Mon Dec 17, 2012 4:31 pm

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

Post 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!
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

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

Post 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.
pcady
Posts: 6
Joined: Mon Dec 17, 2012 4:31 pm

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

Post by pcady »

D'oh. I completely missed the EXIT event.

Thanks for your help.
-pc
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

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

Post by HighAley »

Hello.

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

Thank you.
Locked