【问题标题】:Dialog box close not working in primefaces对话框关闭在primefaces中不起作用
【发布时间】:2014-01-24 09:44:12
【问题描述】:

我正在通过

打开对话框
    public void openDialogRegionList() {        
    RequestContext.getCurrentInstance().openDialog("RegionList");       

}

我有一个commandLink onClick,我需要关闭对话框。

    public void setId(ActionEvent event){

        UIComponent component = event.getComponent();
        String value = (String) component.getAttributes().get("value");         
        this.regionId = value;              
        RequestContext.getCurrentInstance().closeDialog("RegionList");      

}

但是对话框没有关闭。 提前致谢

【问题讨论】:

  • 您使用的是什么版本的 Primefaces?我找不到任何具有openDialogcloseDialog 方法的RequestContext 版本。除此之外,您的问题缺乏很多背景。没有显示对话框或 UI 组件命名的代码。
  • 我使用 primefaces 4.0 RegionList 是一个 .xhtml 文件,在调用打开对话框时会打开

标签: jsf primefaces


【解决方案1】:

您可以将oncomplete="PF('dialogName').close()" 属性添加到您的html 按钮。如果不起作用,其他解决方案是调用hide()方法。

【讨论】:

    猜你喜欢
    • 2015-02-12
    • 2023-03-29
    • 2013-09-10
    • 1970-01-01
    • 1970-01-01
    • 2012-09-20
    • 1970-01-01
    • 1970-01-01
    • 2013-02-19
    相关资源
    最近更新 更多