Hi Hasan,

I read your blog and was quite pleased after reading it.  It it possible to
share the code? It will be nice if you can zip it up in a small sample
project. It can be very simple and Form may have just one required field
that uses JSF validator.  Later , we can enhance it to support other use
cases. I am sure it will help several others using JSF.

Appreciate your help.

Thanks,
Sanjay

On 3/20/07, Hasan Turksoy <[EMAIL PROTECTED]> wrote:

>
> I took a look on the url you provided and on the wiki I also read that
the
> 'required' validator is a special case. The JSF framework will only call
a
> Validator if a value was submitted. Usually, you would set
required="true"
> as an attribute on the input component.  If I set requied=true on the
> input
> component then JSF built in validation kicks in and Shale "required"
> validator is never processed.


as you noticed, shale's serverside required validator will never be called
by JSF... because JSF will handle (isRequired && isEmpty) case by its way
and not call any validator for such a condition..




> Is there a way to display JSF required validator?  or Is there a way to
> pass
> an argument to JSF required validator message?
>
>
There is no way to pass parameter to JSF required validator... By default,
JSF will add the ID of the field into message as parameter and send it...
you can only override the same message key (as you did)... your removing
required="true" doesn't matter.. Because commonsvalidator(type="required")
already set it inside..

This means; in either way, JSF's required validator message will be
shown..
I have faced with the same problem and found a solution by removing both
required="true" and commonsvalidator's required attribute setting code...
So, how will required attribute work?

I have implemented a workaround for this problem... Basically, remove the
required="true" and write a component that will find the "required"
commonsvalidators and call the validate method for them...
For a detailed explanation of problem, JSF's working and found alternative
solution, you can look at this
blog<
http://www.jroller.com/page/hasant?entry=jsf_bypassable_client_and_server>
(under
"Bypassing serverside required validation" title). Althogh that blog is
about bypassing validations, it is suggesting a solution for your case
too...

hasan...


On 3/20/07, Sanjay Choudhary <[EMAIL PROTECTED]> wrote:

Reply via email to