Set the nome
field by using p:inputText
to receive values, it is a field . How do I display a message showing that this field is required, using p:messages
? I'm also using JSF.
Follow my HTML:
<h:form>
<p:messages/>
<p:panelGrid columns="2">
<f:facet name="header">
Cadastro de Pessoas
</f:facet>
<h:outputLabel value="Nome" for="nome"/>
<p:inputText id="nome" required="true"/>
<f:facet name="footer">
<p:commandButton value="Cadastrar" icon="ui-icon-disk"
iconPos="right"/>
</f:facet>
</p:panelGrid>
</h:form>
Follow the Image of the Form: