Sorry, I've been on vacation the last week.

The default for the Optional Validation Framework is hard, so it's
just a matter of setting validation to "none" for your command links,
and wrapping all of your validators/converters.

Note that if validation is set to none, your model isn't going to be
updated.  You'll  need to pull out any values with
getSubmittedValue().

Note that you can't have it both ways -- if you're not validating
data, then you can't update the model since the data may not be valid.
  You really want to be preserving your submitted values, not your
model values.

-Mike

On 8/24/05, Richard Wallace <[EMAIL PROTECTED]> wrote:
> Hey everyone,
> 
> I've got a form that has a couple of optional command links on it.  They
> are basically "quick add" buttons so a user can quickly add things to
> drop downs if they aren't there.  When these "quick add" buttons are
> clicked the user is sent to an add page, the user enters the new info
> and is then redirected back to the original page where the new entry is
> selected and all the other data is preserved from before they clicked
> the "quick add" button.  The backing beans involved are request scoped
> and the values filled in before clicking the "quick add" button are
> preserved through the process using the <t:saveState> element.
> 
> I'm trying to get the validation correct. I want all the form elements
> to be required when the user clicks the submit button, but when they hit
> the "quick add" link the validation should be bypassed.   I thought of
> doing this with the immediate attribute set to true on the "quick add"
> command links but if I do that then any data the user entered on that
> page load (contact info type stuff) is lost.  So I kind of need to
> bypass the validation but still update the model values if one of the
> command links are clicked, but have full validation done when the
> command button is pressed.
> 
> I was looking at the new OptionalValidation Framework but I'm not sure
> exactly how to apply it in this case.  I mean, what I really want is to
> have the validation type be none when command links are used and hard
> otherwise.
> 
> Any ideas?
> 
> Thanks,
> Rich
>

Reply via email to