Help

Controls

PermLinkWikiLink
Switch Workspace

Built with Seam

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.

Forum: Seam Users Forum ListTopic List
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?

2 Replies:
09. Mar 2010, 08:01 America/New_York | Link

Same issue here, anyone could help?

19. Mar 2010, 21:32 America/New_York | Link
The method addToControl finally worked for me.

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.