Monday, December 17, 2012

Re: Equivalent to javascript confirmdialog ind GWT

The solution is posted her on Stackoverflow

And here is my code (it's only a extract of the full class) :

public class MainPresenter<V extends MainView>
    extends BasicPresenter<V>
    implements HistoryTokens, MainViewControl, LoginEventHandler, Window.ClosingHandler,
    CloseHandler<Window>
{
 ....
 Window.addWindowClosingHandler( this );
    Window.addCloseHandler( this );

....

  /**
   * Diese Methode wird naufgerufen wenn das Browsertab geschlossen werden soll
   */
  @Override
  public void onWindowClosing( ClosingEvent in_event )
  {
    if ( model.isUserlogin() )
    {
      in_event.setMessage( CONSTANTS.web_client_MainPresenter_AenderungenSpeichernHinweis() );
    }
  }

  /**
   * Diese Methode wird naufgerufen wenn das Browsertab geschlossen wird
   */
  @Override
  public void onClose( CloseEvent<Window> event )
  {
    if ( model.isUserlogin() )
    {
      camWebServiceAsync.logout( new AsyncCallback<Void>()
      {

        @Override
        public void onSuccess( Void in_result )
        {
          
        }

        @Override
        public void onFailure( Throwable in_caught )
        {
        }
      } );
    }
  }

}

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/NJ40WcJ3twAJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment