0

I'm having a problem with JSF CommandButton action not working. I have a managed bean merchantController and I'm using following code in controller to display popUpURL page.

RequestContext
                .getCurrentInstance()
                .execute(
                        "document.getElementById('viewForm:actionHref').href='"
                                + popUpURL
                                + "';document.getElementById('viewForm:actionHref').click();");

I am getting popUpURL at code while debugging.but it doesn't works.

Now I'm using jsf code for button as follows

<div class="table-footer">
                        <div class="control-group">
                            <h:outputLabel value=" " styleClass="control-label" />

                            <div class="mBtm10 mTop20" >
                                <h:commandButton id="modifyBtn" value="MODIFY" styleClass="btn01 btn actionBtn" 
                                     update=":msg"
                                    disabled="#{merchantController.status eq 'B' ? 'true' : merchantController.status eq 'I' ? 'true' : merchantController.merchantDataModel.getRowCount() eq 0 ? 'true' : 'false'}"
                                    actionListener="#{merchantController.manipulateUsers('Modify')}" />
                                <h:outputText value="&#160;" />
                            </div>
                        </div>
                    </div>
                    <h:outputLink value="#1" id="actionHref" style="display:none;"
                        styleClass="link02 group1" />

But When I use p:commandbutton instead of h:commandbutton ,it works fine. What should be the problem?

piyushj
  • 1,546
  • 5
  • 21
  • 29
Gaurav
  • 9
  • 4
  • 1
    Your question is not clear ? Are you trying to open modal popup of PF on button click ? – Subodh Joshi Jul 18 '16 at 05:57
  • Debug the network traffic and content and pay attention to the differences... Then read about the basic fundamental differences between a normal `h:commandButton` and a `p:commandButton` – Kukeltje Jul 18 '16 at 10:48
  • Thanks....................................................................... – Gaurav Jul 19 '16 at 05:33

0 Answers0