Cancel "closing of dynamic application"

Apr 19, 2013 at 10:25 AM
Hi Guys,

Is there any way to cancel the closing of the dynamic application. This is related to one of the question asked over here. The requirement is, When the user clicks on the Close button, I should check if it has any changes and warn user that the changes will lost.

I was able to do up to, warning user. But after this, when the user selects not to close, I want to avoid the closing the application. But I'm not getting how to do that?

I hope many of you have already came across some situations like this. Did you found any work around / Please share your thoughts. (I'm open with any other possible solutions too if any one can suggest).

Thanks ,

Apr 19, 2013 at 12:15 PM
Hi Srikanth,

ive thought that could be easily done by a CustomAdapter. But overriding the Close() method and return false didnt prevent the HostedApplication from closing ... thats strange.

Where do you hook your "Should Close Dialog" ??


Apr 19, 2013 at 12:38 PM
Hi Niklas -

I found this event "CloseApplicationClick" for MainPanel control, which tells me whenever a hostedapplication's Close button is clicked.

From there, I'm getting adapter and was able to call a java script method (which gives me form.isDirty). Now, I know, My form is dirty. So user should not close the application now. I want him to go and hit on "Save & Close" on the form and will choose "Ignore"/"Save" as per his requirement.

That is the idea. Did you find any such difficulties?


Apr 19, 2013 at 1:38 PM
as per CCA SDK, Adapter's "Close()" method "may not run if the application closes itself" .. I didn't understand "Application closes itself", can some body explain this?

HostedApplicationAdapter.Close() => Called when the application this is working with is being closed by the UII application host. This may not run if the application closes itself.