我解决了创建自己的复合组件的问题......这样我可以更好地控制验证发生的时间。
单元格编辑器:
<c:interface>
<c:attribute name="id" required="false" targets="celula"/>
<c:attribute name="desabilitado" required="false" default="true"/>
<c:facet name="entrada" required="true"/>
<c:facet name="saida" required="true"/>
</c:interface>
<c:implementation>
<h:panelGroup id="celula" layout="block" styleClass="hrgi-celula">
<h:panelGroup layout="block" styleClass="hrgi-celula-entrada" style="display: none">
<c:renderFacet name="entrada" required="true"/>
</h:panelGroup>
<h:panelGroup layout="block" styleClass="hrgi-celula-saida">
<c:renderFacet name="saida" required="true"/>
</h:panelGroup>
</h:panelGroup>
</c:implementation>
行编辑器:
<c:interface>
<c:attribute name="action" method-signature="void method(java.lang.Object)"/>
<c:attribute name="indice" required="true"/>
<c:attribute name="update" required="false" default=""/>
</c:interface>
<c:implementation>
<h:outputScript library="js" name="hrgiRowEditor.js" target="head"/>
<h:panelGroup layout="block">
<h:panelGroup id="painelBotaoEdicao" layout="block" style="display: inline">
<h:graphicImage library="img" name="pencil.png" onclick="ativarCamposEditaveis('#{cc.clientId}');"
style="cursor: pointer;"/>
</h:panelGroup>
<h:panelGroup id="painelBotoesSalvamento" layout="block" style="display: none">
<h:commandLink id="botaoSalvar" style="float: left;" onclick="definirIdRowEditor('#{cc.clientId}')">
<h:graphicImage library="img" name="check.png"/>
<f:param name="#{cc.attrs.indice}" value="true"/>
<p:ajax event="click" update="@form #{cc.attrs.update}" process="@form" listener="#{cc.attrs.action}"
oncomplete="desativarCamposEditaveisQuandoSucesso(xhr, status, args, this);"/>
</h:commandLink>
<h:graphicImage library="img" name="cancel.png" style="float: left; cursor: pointer;"
onclick="desativarCamposEditaveis('#{cc.clientId}');">
</h:graphicImage>
</h:panelGroup>
</h:panelGroup>
</c:implementation>
唯一的问题是我不能只更新表格中的一行......也许我会创建另一个组件......