내 Java 메소드가 false 또는 true를 반환 할 경우 대화 상자를 표시해야하는 내 명령 버튼 (Primefaces 6.0)에 조건문이 필요합니다. 뭐 그런 : 내가 그것을 삭제할 수 있다면 내가 그것을 삭제하고 사실 수없는 경우 primefaces commandbutton 조건문
<p:commandButton onclick="(myJavaMethod) ? deleteDialog.show() : confirmDialog.show()">
<p:confirm header="Deleting Branch" message="Do you want to delete the Branch?"/>
</p:commandButton>
내 대화 상자는 다음과 같다 :
<!-- DELETE-DIALOG -->
<p:dialog id="deleteDialog" widgetVar="deleteDialog">
<h:form id="deleteDialogForm">
<h:panelGrid columns="1" border="0">
<p:outputLabel value="Branch could not be deleted"/>
<p:commandButton icon="ui-icon-close" id="doCloseDialog" oncomplete="PF('deleteDialog').hide()" value="OK" class="btn-confirm"/>
</h:panelGrid>
</h:form>
</p:dialog>
문제가 해결 되나요? –