Help

Controls

PermLinkWikiLink

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. Apr 2008, 14:33 CET | Link

Hi everyone.

I've a question about validation and showing validation messages in Seam 2.0.1 GA and JBoss 4.2.2 GA.

I want to display a custom validation message if a required field is not set. But not by defining a custom text in messages.properties for all missing required values:

javax.faces.component.UIInput.REQUIRED=custom message for all required fields

because I want to set explicit messages for each missing property (with hibernate valdation ?). Like:

@NotNull(message="CardId is required!")
public String getCardId()
{
   return cardId;
}

Unfortunately I get the custom defined message if there is no value entered on the screen for the specific property.

<h:inputText id="cardId" value="#{acquisition.cardId}" required="true"/>

Does anyone know how i can see the specific message ?

Regards

Lars

3 Replies:
19. Apr 2008, 14:19 CET | Link

Hi

Do you use

<s:valudate/>

or

<s:validateAll/>
?

19. Apr 2008, 18:10 CET | Link

I tried both, with same result (jsf message for required fields).

Lars

20. Apr 2008, 12:33 CET | Link

Lars,

JSF will not call out validators if no value is entered in the field. So hibernate validator is not called.