Yup, JSF validation is really lacking.

I don't think you have a chance to get that desired behavior with
JSF validation.
The most pragmatic solution is probably to "manually" do the validation
in your action handler, instead of using JSF's validation concept.

(Yes, I just hate that, even more so because I use Seam to enable
entity beans as backing beans for my forms. However now I can't do
that any longer and have to use artificial value objects instead -
no validation => invalid values get written to the entities, because
those entities are still managed, they would be written to the DB
on next flush. What a mess.)

jhomuth wrote:
Hi List,

I've tried a lot to validate my selectManyListBox. This validation would be very simple, because I only want to validate if the user selected something in that listbox. But as I know now, that a custom validator will not called if the field, which you want to validate is empty. WTF. Someone would say, why not use the "required" Attribute of that UIComponent. But that's f******g bad, because there only will a standard message displayed and that not what I want to do. Ok I can customize the Message but only to a standard required message which could not be customized for different fields. Is there any workaround, that my custom validator will be called if the damm required attribute is not set and the field to validate has no input.

Please help me before I get real crazy.

Thx for suggestions

Reply via email to