开发者

Popup window - perform the action and close

I'm using popup window for code authentification, where are only foll开发者_如何转开发owing components:

<h:inputText value="#{bean.masterKey.code}" />
<h:commandButton action="#{bean.checkMaster}" value="OK" type="submit"/>

Button calls method checkMaster() which set the boolean variable true or false

public void checkMaster(){
  if (findMasterKey(masterKey.getCode())) Settings.ONCOST = true;
  else Settings.ONCOST = false;
}

But I would like to close popup window after perform the action (every time button is pressed).

But don't know how.. could you help me?

Update:

public static boolean findMasterKey(String key)
{
  Session session = DaoSF.getSessionFactory('R').openSession();
  Criteria criteria = session.createCriteria(MasterType.class);
  criteria.add(Restrictions.eq("code", key));
  MasterType foundMT = (MasterType)criteria.uniqueResult();

  if (foundMT != null) return true;
  else return false;   
}


After on action performed navigate this page to some page say Foo

on page load of Foo execute windows.close() javascript

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜