Forums de discussion

Warning Displayed "The form component needs to have a UIForm..."

Scott Selvia, modifié il y a 10 années.

Warning Displayed "The form component needs to have a UIForm..."

New Member Publications: 10 Date d'inscription: 01/08/13 Publications récentes
I'm getting this displayed in my JSF Primefaces Portlet when it is displayed within my portal.

The form component needs to have a UIForm in its ancestry. Suggestion: enclose the necessary components within <h:form>

I'm just not sure how to solve the problem?

<?xml version="1.0" encoding="UTF-8"?>
<f:view xmlns="http://www.w3.org/1999/xhtml"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head />
<h:body>
<h:form id="netEffectForm">
<p:messages id="formMessages" showDetail="true" autoUpdate="true" closable="true" />

<p:tabView id="netEffectTabView">
<p:tab id="matchingTab" title="Matching">
<h:panelGrid columns="3" style="margin-bottom:10px" >

<h:outputText value="Matching Options:" />
<p:spacer width="5" height="20" />
<p:selectOneButton value="1">
<f:selectItem itemLabel="All" itemValue="1" />
<f:selectItem itemLabel="Customer" itemValue="2" />
<f:selectItem itemLabel="Consumer" itemValue="3" />
<f:selectItem itemLabel="Business" itemValue="4" />
</p:selectOneButton>

</h:panelGrid>

<p:separator />

<h:panelGrid id="matchFieldsGrid" columns="2" columnClasses="ne-panel-col-1, ne-panel-col-2" >
<p:panel id="stdMatchFieldsPanel" header="Standard Match Fields" >
<h:panelGrid id="stdMatchFields"
columns="4"
columnClasses="ne-column-right, ne-column-left, ne-column-left, ne-column-left"
styleClass="ne-panel-grid-cellspacing">
<h:outputLabel for="primaryName" value="Primary Name: *" />
<p:inputText id="primaryName" value="" required="true" label="Primary Name" size="50" >
<f:validateLength minimum="1" maximum="50" />
<p:ajax update="msgPrimaryName" event="keyup" />
</p:inputText>
<p:message for="primaryName" id="msgPrimaryName" display="icon" />
<p:watermark for="primaryName" value="Enter a Primary/Company Name" />

<h:outputLabel for="secondaryName" value="Secondary Name:" />
<p:inputText id="secondaryName" value="" label="Secondary Name" size="50">
<f:validateLength maximum="50" />
<p:ajax update="msgSecondaryName" event="keyup" />
</p:inputText>
<p:message for="secondaryName" id="msgSecondaryName" display="icon" />
<p:watermark for="secondaryName" value="Enter a Secondary/Contact Name" />

<h:outputLabel for="address1" value="Address 1: *" />
<p:inputText id="address1" value="" required="true" label="Address 1" size="50" >
<f:validateLength minimum="1" maximum="50" />
<p:ajax update="msgAddress1" event="keyup" />
</p:inputText>
<p:message for="address1" id="msgAddress1" display="icon" />
<p:watermark for="address1" value="Enter an Address" />

<h:outputLabel for="address2" value="Address 2:" />
<p:inputText id="address2" value="" label="Address 2" size="50">
<f:validateLength maximum="50" />
<p:ajax update="msgAddress2" event="keyup" />
</p:inputText>
<p:message for="address2" id="msgAddress2" display="icon" />
<p:watermark for="address2" value="Enter a Suite or Apartment" />

<h:outputLabel for="city" value="City: *" />
<p:inputText id="city" value="" required="true" label="City" size="28" >
<f:validateLength minimum="1" maximum="28" />
<p:ajax update="msgCity" event="keyup" />
</p:inputText>
<p:message for="city" id="msgCity" display="icon" />
<p:watermark for="city" value="Enter the City" />

<h:outputLabel for="state" value="State/Province: *" />
<p:inputText id="state" value="" required="true" label="State/Province" size="2" >
<f:validateLength minimum="1" maximum="2" />
<p:ajax update="msgState" event="keyup" />
</p:inputText>
<p:message for="state" id="msgState" display="icon" />
<p:watermark for="state" value="" />

<h:outputLabel for="postalCode" value="Postal Code:" />
<p:inputText id="postalCode" value="" label="Postal Code" size="10" >
<f:validateLength minimum="1" maximum="10" />
<p:ajax update="msgPostalCode" event="keyup" />
</p:inputText>
<p:message for="postalCode" id="msgPostalCode" display="icon" />
<p:watermark for="postalCode" value="" />

<h:outputLabel for="phone" value="Phone:" />
<p:inputMask id="phone" value="" mask="(999) 999-9999" size="15" >
<f:validateLength minimum="1" maximum="10" />
<p:ajax update="msgPhone" event="keyup" />
</p:inputMask>
<p:message for="phone" id="msgPhone" display="icon" />
<p:watermark for="phone" value="" />

<h:outputLabel for="email" value="Email Address:" />
<p:inputText id="email" value="" label="Email Address" size="50" >
<f:validateLength minimum="1" maximum="50" />
<f:validateRegex pattern="^[_A-Za-z0-9-\+]+(\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\.[A-Za-z0-9]+)*(\.[A-Za-z]{2,})$" />
<p:ajax update="msgEmail" event="keyup" />
</p:inputText>
<p:message for="email" id="msgEmail" display="icon" />
<p:watermark for="email" value="Enter an Email Address" />
</h:panelGrid>
</p:panel>

<p:dataTable id="custMatchFieldsTable" var="field" value="#{netEffectBean.fields}" editable="true">
<f:facet name="header">
Custom Match Fields
</f:facet>

<p:ajax event="rowEdit" listener="#{netEffectBean.onEdit}" update=":A0876:netEffectForm:formMessages" />
<p:ajax event="rowEditCancel" listener="#{netEffectBean.onCancel}" update=":A0876:netEffectForm:formMessages" />

<p:column headerText="Field" style="width: 34%" >
<h:outputText value="#{field.name}" />
</p:column>

<p:column headerText="Content" style="width: 60%">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{field.value}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{field.value}" style="width:100%"/>
</f:facet>
</p:cellEditor>
</p:column>

<p:column style="width:6%">
<p:rowEditor />
</p:column>
</p:dataTable>

</h:panelGrid>

<p:separator />

<div align="center" style="padding: 5px;">
<p:commandButton id="matchButton" value="Match" update="stdMatchFields" />
</div>

<p:separator />

<p:tabView id="netEffectResultsTabView">
<p:tab id="customerTab" title="Customer Results">
</p:tab>
<p:tab id="consumerTab" title="Consumer Results">
</p:tab>
<p:tab id="businessTab" title="Business Results">
</p:tab>
<p:tab id="validationTab" title="Validation Details">
</p:tab>
</p:tabView>
</p:tab>

<p:tab id="searchingTab" title="Searching">
<h:panelGrid columns="2" cellpadding="10">
<h:outputText id="tab2Text" value="Tab2"/>
</h:panelGrid>
</p:tab>
</p:tabView>
</h:form>
</h:body>
</f:view>
thumbnail
Neil Griffin, modifié il y a 10 années.

RE: Warning Displayed "The form component needs to have a UIForm..."

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
What version of Mojarra are you using? I would recommend that you upgrade to Mojarra 2.1.21 and see if the problem goes away.