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=" " />
</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?