In my application, I have the following form
<h:form id="addItemForm" enctype="multipart/form-data">
<h:panelGrid columns="3" border="1">
<h:outputText value="Name: " />
<h:inputText label="name"
id="name" value="#{addItem.name}"
required="true" requiredMessage="Name is required." />
<h:message styleClass="errorMsg" for="name" />
<h:outputText value="Description: " />
<h:inputText label="description"
id="description" value="#{addItem.description}"
required="true" requiredMessage="Description is required." />
<h:message styleClass="errorMsg" for="description" />
<h:outputText style="font-weight: bold" value="Picture : " />
<t:inputFileUpload label="picture"
id="picture" value="#{addItem.picture}"
required="true" requiredMessage="Picture is required." />
<h:message styleClass="errorMsg" for="picture" />
</h:panelGrid>
<h:commandButton value="Confirm" actionListener="#{addItem.addItem}"/>
<h:outputText id="status" value="#{addItem.statusMsg}" />
</h:form>
If I enter the description & leave the name as blank and I click the Confirm button, I don't see any error message for the missing name. One weird thing is that my page seems to be refreshed because anything that I typed in for description was gone. Besides, even if I typed in both name and description, the addItem function in the actionListener was never called.
Yesterday, everything was working. I'd be very grateful if someone could tell me what I might have done wrong here.