tags:

views:

113

answers:

3

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 ???

+1  A: 

Use <a4j:commandButton> instead of h:commandButton.

FRotthowe
+1. `h:commandButton` doesn't even have oncomplete.
Bozho
A: 

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 it's value to true on click of button if records are found

Vipin
A: 

Hi m getting same problem and also my bean is not called when i click on command button,while panel opened for few second and page refresh plz guide me i m trying to resolve this issue from past 1 week but i m not able to find the solution thanks

subodh
Vipin