You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Richard Wallace <rw...@thewallacepack.net> on 2006/02/02 05:53:44 UTC

[shale] Better validation messages

I've starting working with the commonsValidator components in Shale.  
I'm just getting started but one thing I was hoping this could solve was 
better error message handling.  The error message handling in JSF is 
probably one of it's weakest areas because you can only define a single 
message to be used across an entire application for each component 
type.  For what I'm working on now, this is inadequate. 

I'm implementing an assessment with 12 questions on a page.   The user 
is required to select an answer for all questions.  When a user doesn't 
select a question I'd like to display a message in the global messages 
that says something like, "You must answer question {0}."  The actual 
question should get an asterisk next to the question number.

The commons validators helps to ensure client side validation, but does 
anyone have any ideas how I can accomplish the rest?  Or am I going to 
need to implement this into my backing beans?

Thanks,
Rich

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [shale] Better validation messages

Posted by Wendy Smoak <ws...@gmail.com>.
On 2/1/06, Richard Wallace <rw...@thewallacepack.net> wrote:

> I'm implementing an assessment with 12 questions on a page.   The user
> is required to select an answer for all questions.  When a user doesn't
> select a question I'd like to display a message in the global messages
> that says something like, "You must answer question {0}."

Take a look at the example of validation on the wiki:
   http://wiki.apache.org/struts/ShaleValidation

I'm not entirely sure how much of this you can do with plain JSF, but
with Shale's Commons Validator integration, you can define custom
rules, including the message that should be used.

--
Wendy

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org