SHARE
TWEET

LoginModal

smallufo Jul 8th, 2014 182 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class LoginModal extends ModalWindow
  2. {
  3.   Logger logger = LoggerFactory.getLogger(LoginModal.class);
  4.  
  5.  
  6.   public LoginModal(String id , final PageParameters pps)
  7.   {
  8.     super(id);
  9.    
  10.     setResizable(false);
  11.  
  12.    
  13.     final Page page = new LoginPage(pps , this);
  14.     final PageReference pageRef = page.getPageReference();
  15.  
  16.     setPageCreator(new PageCreator() {
  17.       @Override
  18.       public Page createPage() {return page;}
  19.     });
  20.  
  21.     setCloseButtonCallback(new CloseButtonCallback() {
  22.       @Override
  23.       public boolean onCloseButtonClicked(AjaxRequestTarget target) {
  24.         return true;
  25.       }
  26.     });
  27.    
  28.    
  29.     setWindowClosedCallback(new WindowClosedCallback() {
  30.       @Override
  31.       public void onClose(AjaxRequestTarget target) {
  32.    
  33.         LoginPage loginPage = (LoginPage) pageRef.getPage();
  34.  
  35.         if (loginPage.isSuccessful()) {
  36.           // do something.
  37.         }
  38.       }
  39.     });
  40.   }
  41.  
  42.  
  43. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top