Jsf 单击按钮打开丰富的模式面板

Jsf 单击按钮打开丰富的模式面板,jsf,Jsf,我正试图打开一个丰富的模式面板,在一个按钮点击填充数据 尝试 <h:commandButton id="btn_search" value="#{text['button.add']}" action="#{cartBean.search}" oncomplete="#{rich:component('dlg_results')}.show()">

我正试图打开一个丰富的模式面板,在一个按钮点击填充数据

尝试

<h:commandButton id="btn_search" value="#{text['button.add']}" 
                    action="#{cartBean.search}"
                    oncomplete="#{rich:component('dlg_results')}.show()">                            
                    </h:commandButton>


此代码在单击按钮时打开模型面板,但当响应从服务器发回时,整个页面将刷新


有人能建议一种处理方法吗?

使用
而不是
h:commandButton

使用
而不是
h:commandButton
谢谢,这是有用的信息


我在
rich:modalpanel
中使用了
showWhenRendered
标记来解决我的问题。我在bean中添加了一个变量,并在找到记录时单击按钮将其值设置为true。

谢谢,这是有用的信息

我在
rich:modalpanel
中使用了
showWhenRendered
标记来解决我的问题。我在bean中添加了一个变量,并在找到记录时单击按钮将其值设置为true

<h:commandButton id="btn_search" value="#{text['button.add']}" 
                    action="#{cartBean.search}" immediate="true">
                        <rich:componentControl for="dlg_results" attachTo="btn_search" operation="show" event="onclick"/>
                    </h:commandButton>