Brian Wheeler wrote:Hey Everyone,
I got my client side validation to work using this example provided here RichFaces Client Side Validation
Notice, that there is no validation errors until you type and click out of that input form. Not a use case I want.
I'm trying to validate the input forms during an on submit action. Similar to to example provided here. rich:message demo
Using the above example source code, the problem I'm having is when I click the submit button nothing happens. No validation error and no submit action. Am I missing something? Can someone experienced with what I'm trying to do give me some feedback?
Thanks in Advance.
Tim McGuire wrote:
Brian Wheeler wrote:Hey Everyone,
I got my client side validation to work using this example provided here RichFaces Client Side Validation
Notice, that there is no validation errors until you type and click out of that input form. Not a use case I want.
I'm trying to validate the input forms during an on submit action. Similar to to example provided here. rich:message demo
Using the above example source code, the problem I'm having is when I click the submit button nothing happens. No validation error and no submit action. Am I missing something? Can someone experienced with what I'm trying to do give me some feedback?
Thanks in Advance.
To be clear, you want validation to happen when you click submit button? I can't give feedback unless I see the code you use. Can you post the code that you are using?
Brian Wheeler wrote:
Tim McGuire wrote:
Brian Wheeler wrote:Hey Everyone,
I got my client side validation to work using this example provided here RichFaces Client Side Validation
Notice, that there is no validation errors until you type and click out of that input form. Not a use case I want.
I'm trying to validate the input forms during an on submit action. Similar to to example provided here. rich:message demo
Using the above example source code, the problem I'm having is when I click the submit button nothing happens. No validation error and no submit action. Am I missing something? Can someone experienced with what I'm trying to do give me some feedback?
Thanks in Advance.
To be clear, you want validation to happen when you click submit button? I can't give feedback unless I see the code you use. Can you post the code that you are using?
Hey Tim,
Yes, I would like it to validate on the client side on submit, if validation pass submit form. Currently, it validates when you type text and move focus outside the form. I think this is default behavior. Here's the code snippet.
xhtml
bean
Experience keeps a dear School, but Fools will learn in no other.
---
Benjamin Franklin - Postal official and Weather observer
Tim Holloway wrote:JSF validators are done at the GUI level. JSR-303 validations are executable at multiple levels. For example, I use them on ORM record fields to catch bad data before it commits to the database. You can also mix and match, which can be good, for example, if you are connected to an ORM record, but for the particular task in the GUI, you want additional restrictions above and beyond the default ORM validations.
Web clients don't care about "moving outside the form", but if you move outside the control, a JavaScript onblur event is fired to indicate that the control has lost focus. Normally you have to explicitly code any AJAX handling of that event, but if you use appropriate AJAX-friendly tags, they can handle the job for you. The base JSF tags do not do any javascript events without external help.
Experience keeps a dear School, but Fools will learn in no other.
---
Benjamin Franklin - Postal official and Weather observer
Tim Holloway wrote:ALL form submits are validated. That's a fundamental part of the JSF contract.
RichFaces offers two extensions to the standard form validation process. One is client-based, using generated Javascript and one is server-based, using AJAX.
This element:
runs client-side validation. There is an implied (default) 'event="change"' on the validator tag. I've had occasional grief with change events, so I tend to use the blur event, instead.
This tag is ONLY available on RichFaces 4 and will be silently ignored if you're using RichFaces 3.
The other extension is the "ajaxValidator" tag. It is available for RichFaces 3 and it basically submits the form as though the containing control was the only control on the form, JSF runs the validation, then short-circuits past the update and action phases, so that only validation is done.
Actually, RF3 also supports a beanValidator, but that's another story.
Experience keeps a dear School, but Fools will learn in no other.
---
Benjamin Franklin - Postal official and Weather observer
Experience keeps a dear School, but Fools will learn in no other.
---
Benjamin Franklin - Postal official and Weather observer
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |