Opening a Rich Modal Panel on Button Click
I m trying to open a rich modal panel with populated data on a button click
tried
<h:commandButton id="btn_search" value="#{text['button.add']}"
action="#{cartBean.search}"
oncomplete="#{rich:component('dlg_results')}.show()">
</h:commandButton>
and
<h:commandButton id="btn_search" value="#{text['button.add']}"
action="#{cartBean.search}" immediate="true">
<rich:componentControl for="dlg_results" attachTo="bt开发者_如何学运维n_search" operation="show" event="onclick"/>
</h:commandButton>
This code opens the model panel on button click but when response is sent back from the server the whole page gets refreshed
can some one suggest a way to handle this ???
Use <a4j:commandButton>
instead of h:commandButton
.
Thanks, this was helpful information.
I used showWhenRendered
tag in rich:modalpanel
to solve my problem. I added a variable in my bean and set its value to true on click of button if records are found.
精彩评论