Reputation: 398
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="btn_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 ???
Upvotes: 0
Views: 4127
Reputation: 398
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.
Upvotes: 1