Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Preventing a form or page being closed
Preventing a form or page being closed [message #1277923] Wed, 26 March 2014 12:51 Go to next message
Dominic Hanlan is currently offline Dominic Hanlan
Messages: 98
Registered: July 2009
Member
Is there a form of veto on page or forms being closed or of hiding the close icon?

Regards
Re: Preventing a form or page being closed [message #1286984 is a reply to message #1277923] Mon, 07 April 2014 05:09 Go to previous message
Matthias Nick is currently offline Matthias Nick
Messages: 163
Registered: August 2013
Senior Member
Hi Dominic,
sorry for the late response.

Yes, you can intercept the close event. Below, there is an example which shows a "Yes/No" dialog when the user wants to close the form. If the user selects "Yes" the form closes, if the user selects "No" the form stays open:

  @Override
  public void doClose() throws ProcessingException {
    int result = MessageBox.showYesNoMessage("Close", "Close", "Do you really want to close the form?");
    if (result == MessageBox.YES_OPTION) {
      super.doClose();
    }
    else {
      //do nothing
    }
  }


Basically, you need to override
public void doClose() throws ProcessingException

in your AbstractForm


(I wanted to attach an image, however the Eclipse Forum does not let me do so Sad )

Hope this helps,
Best regards
Matthias
Previous Topic:Multiline text in colum
Next Topic:Using @ColumnData(SdkColumnCommand.IGNORE)
Goto Forum:
  


Current Time: Fri Aug 22 02:09:25 EDT 2014

Powered by FUDForum. Page generated in 0.01831 seconds