there is something wrong with commandButton-Renderer. In the following case it will not render correctly under the right position.
I have downstripped the example to the minimum, so please do not ask why i put only a form into this custom component
Using a composite component (form.xhtml):
Code: Select all
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:composite="http://xmlns.jcp.org/jsf/composite">
<composite:interface name="form" displayName="form">
<composite:facet name="functions" />
</composite:interface>
<composite:implementation>
<h:form>
<composite:renderFacet name="functions" />
</h:form>
</composite:implementation>
</html>
Working:
Code: Select all
<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
xmlns:cc="http://xmlns.jcp.org/jsf/composite/cc"
<cc:form>
<f:facet name="functions">
<p:button value="Reload 1 (works)" />
<h:commandButton value="Reload 2 (works)" />
<h:commandButton value="Reload 3 (works)">
<f:ajax execute="@this" resetValues="true" render="@form" />
</h:commandButton>
</f:facet>
</cc:form>
</ui:composition>
Code: Select all
<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
xmlns:cc="http://xmlns.jcp.org/jsf/composite/cc"
<cc:form>
<f:facet name="functions">
<p:commandButton value="Reload (failed)" ajax="false" />
<p:commandButton value="Reload 2 (failed)" process="@this" update="@form" />
</f:facet>
</cc:form>
</ui:composition>
Does anybody else had this problem and know what caused it or better how to fix it?CommandButton : "2017-11-06 15:44:54,399 SEVERE [org.primefaces.application.exceptionhandler.PrimeExceptionHandler] (default task-58) CommandButton : "j_idt90:j_idt91" must be inside a form element: javax.faces.FacesException: CommandButton : "j_idt90:j_idt91" must be inside a form element
at org.primefaces.component.commandbutton.CommandButtonRenderer.buildRequest(CommandButtonRenderer.java:136)
at org.primefaces.component.commandbutton.CommandButtonRenderer.encodeMarkup(CommandButtonRenderer.java:69)
at org.primefaces.component.commandbutton.CommandButtonRenderer.encodeEnd(CommandButtonRenderer.java:54)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:920)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
...
Wbr,
Daniel