You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.
| Online: | 13 Members of 9199 |
| Forum: Seam Users |
08. Dec 2009, 11:00 America/New_York | Link |
On form submit some validation is performed and a validation message is enqued:
facesMessages.addToControlFromResourceBundle("username", Severity.ERROR, "user.uniqueUsername");
The view is redisplayed but no message is rendered next to the control. A warning messages is displayed instead on the console:
sourceId=null[severity=(ERROR 2), summary=(Existing username), detail=(Existing username!)]
The responsible view part is bellow:
<h:form>
...
<s:decorate id="usernameDecoration" template="layout/edit.xhtml">
<ui:define name="label"><h:outputText value="#{messages['account.username']}"/>:</ui:define>
<h:inputText id="username" value="#{register.username}" required="true"/>
<ui:define name="errMessage">
<rich:message for="username" styleClass="error">
<ui:include src="layout/valid-err.xhtml"/>
</rich:message>
</ui:define>
</s:decorate>
...
</h:form>
A rich:messages or h:messages tag displays the message. It seems that the control with the specified id is not found and the message is treated as global one. What happens?
Same issue here, anyone could help?
What I did was returning null in the action method to show the same view and the message was correctly displayed in the field.
Now it is possible to use model validation together with manual validation and not screwing the ui.