Я этот код:метод ActionListener не вызывается из диалогового CommandButton
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui" >
<h:form>
<h1 class="page-header "> <i class="fa fa-tachometer"></i> Dashboard</h1>
<p:outputPanel id="contentPanel">
<p:commandButton value="Añadir caso de prueba" actionListener="#{testCaseBean.prepareCreateTestCase}" oncomplete="PF('addTestCaseDialog').show();" process="@this" update=":dialog"/>
<p:dataTable>
</p:dataTable>
</p:outputPanel>
</h:form>
<p:dialog header="Crear caso de prueba" modal="true" id="dialog" widgetVar="addTestCaseDialog" closable="false">
<h:form id="addTestCaseDialogForm">
<p:panelGrid columns="4" styleClass="ui-noborder">
<p:outputLabel for="testCaseName" value="Nombre del caso de prueba:"/>
<p:inputText id="testCaseName" value="#{testCaseBean.testCase.testCaseName}" required="true"/>
<p:outputLabel for="assignedTask" value="Tarea relacionada:"/>
<p:inputText id="assignedTask" value="#{testCaseBean.testCase.assignedTask}" required="true"/>
<p:outputLabel for="isRegressive" value="Regresivo:" />
<p:selectBooleanCheckbox id="isRegressive" value="#{testCaseBean.testCase.isRegressive}"/>
</p:panelGrid>
<p:commandButton value="Guardar" actionListener="#{testCaseBean.createTestCase}" oncomplete="PF('addTestCaseDialog').hide()" process="addTestCaseDialogForm"/>
<p:commandButton value="Cancelar" onclick="PF('addTestCaseDialog').hide()" immediate="true" />
</h:form>
</p:dialog>
И у меня проблема: метод ActionListener из диалогового CommandButton не вызывается, и я не» Знаю почему. Если поместить это в то CommandButton:
<p:commandButton value="Guardar" actionListener="# {testCaseBean.createTestCase}" oncomplete="PF('addTestCaseDialog').hide()" process="@this"/>
Метод вызывается, но форма не обрабатывается.
Любая помощь?
Спасибо!
Это была ошибка проверки, которая не отображалась. Я видел это перед тем, как вы ответили. Спасибо, в любом случае! – rlopezo