`

jsf实现关闭跳出窗口并刷新主窗口

    博客分类:
  • Jsf
阅读更多
在action中加入如下代码即可:
         //Refresh main page   
        FacesContext facesContext = FacesContext.getCurrentInstance();   
        String javaScriptText =    
"window.opener.location.href=window.opener.location.href; window.close();";   
        // Add the Javascript to the rendered page's header for immediate execution   
        AddResource addResource = AddResourceFactory.getInstance(facesContext);   
        addResource.addInlineScriptAtPosition(facesContext,    
AddResource.HEADER_BEGIN, javaScriptText);
分享到:
评论
3 楼 gotosuzhou 2012-12-07  
这里面的AddResource 对象是什么呀,自己定义的吗  希望楼主给大家说说 
2 楼 zhoulei984623 2011-08-24  
GOOGLE
1 楼 llcold2004 2011-08-23  
这里面的AddResource 对象是什么呀,自己定义的吗

相关推荐

Global site tag (gtag.js) - Google Analytics