You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Kaspar Fischer <fi...@inf.ethz.ch> on 2008/12/19 13:20:23 UTC

Turn off form validation

I have a custom component that allows the user to select one or more
tags. For this, the component has a text field and an AjaxButton "Add"
to add a tag.

All works fine if I use the component in a form without validation
errors. If, however, a text field has setRequired(true), the
AjaxButton's onSubmit() method is not called (but onError() instead).

In this case, I do not want this behaviour but want form validation
to be disabled for the "Add" AjaxButton. (I still need to get the
model values updated, though.)

Is there an easy way to achieve this?

I've read about conditional validation,

   http://cwiki.apache.org/WICKET/conditional-validation.html

but as my component does not know about the enclosing form, I am
looking for another solution.

Many thanks,
Kaspar

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


RE: Turn off form validation

Posted by "Hoover, William " <wh...@nemours.org>.
Have you tried processInput? 

-----Original Message-----
From: ywtsang [mailto:ywtsang@gmail.com] 
Sent: Monday, January 05, 2009 10:15 AM
To: users@wicket.apache.org
Subject: RE: Turn off form validation


because this will not update the model object automatically

i.e.
i cannot get the updated submitted fields values


Hoover, William wrote:
> 
> Not sure as to why you cannot use setDefaultFormProcessing?
> 
> http://cwiki.apache.org/WICKET/conditional-validation.html (see 
> "Alternative Approach")
> 
> -----Original Message-----
> From: ywtsang [mailto:ywtsang@gmail.com]
> Sent: Saturday, January 03, 2009 9:46 AM
> To: users@wicket.apache.org
> Subject: Re: Turn off form validation
> 
> 
> i also have a similar use case that requires "turning off" validation 
> for some ajax button links
> 
> e.g.
> i have a form, that may have some text fields with different/none 
> validators
> 
> and i want to do "translation" on some of the text fields by 
> ajax/dynamically, so i need to use ajax button links to "submit" the 
> form with the latest input values to backend logic
> 
> for this case, we want to supress the validation error (if any) and 
> have wicket to still propagate the form fields to our model 
> automatically
> 
> we can't use "setdefaultformprocess" to false for the ajax button link
> 
> so i go to have a look at the form processing, and copy the wicket's 
> form property propagation logic to my form's onerror:
> 
> <code>
> @Override
> protected void onError() {
>   // just for demonstration, can make it happen only for certain cases

> only
>                 
>   // before updating, call the interception method for clients
>   beforeUpdateFormComponentModels();
> 
>   // Update model using form data
>   updateFormComponentModels();
> 
>   // Persist FormComponents if requested
>   // private, can't call
> // persistFormComponentData();
>                
>    super.onError();
> }
> </code>
> 
> there may be problem in propagating the form fields to model if there 
> is validation error, but it looks ok to me because the form fields 
> with no validation error should still get their values submitted and 
> propagated nicely, event some other form fields may have validation 
> error
> 
> 
> 
> noon wrote:
>> 
>> I solved similar problem where I had some required TextField 
>> components and an AJAX component which does a AJAX submit. During 
>> this
> 
>> AJAX submit I wanted to prohibit all the form validations. I achieved

>> this by setting the AJAX components (an autocomplete TextField with 
>> custom AJAX behaviour) into its own nested form... form which is
> inside another form.
>> 
>> I'm not sure does this solve your problem. I found my solution just 
>> by
> 
>> trying differend solutions and it worked :)
>> 
>> 
>> 
>> hbf wrote:
>>> 
>>> I have a custom component that allows the user to select one or more

>>> tags. For this, the component has a text field and an AjaxButton
> "Add"
>>> to add a tag.
>>> 
>>> All works fine if I use the component in a form without validation 
>>> errors. If, however, a text field has setRequired(true), the 
>>> AjaxButton's onSubmit() method is not called (but onError()
instead).
>>> 
>>> In this case, I do not want this behaviour but want form validation 
>>> to be disabled for the "Add" AjaxButton. (I still need to get the 
>>> model values updated, though.)
>>> 
>>> Is there an easy way to achieve this?
>>> 
>>> I've read about conditional validation,
>>> 
>>>    http://cwiki.apache.org/WICKET/conditional-validation.html
>>> 
>>> but as my component does not know about the enclosing form, I am 
>>> looking for another solution.
>>> 
>>> Many thanks,
>>> Kaspar
>>> 
>>> --------------------------------------------------------------------
>>> - To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>> 
>>> 
>>> 
>> 
>> 
> 
> --
> View this message in context:
> http://www.nabble.com/Turn-off-form-validation-tp21090395p21265480.htm
> l Sent from the Wicket - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

--
View this message in context:
http://www.nabble.com/Turn-off-form-validation-tp21090395p21292775.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


RE: Turn off form validation

Posted by ywtsang <yw...@gmail.com>.
because this will not update the model object automatically

i.e.
i cannot get the updated submitted fields values


Hoover, William wrote:
> 
> Not sure as to why you cannot use setDefaultFormProcessing?
> 
> http://cwiki.apache.org/WICKET/conditional-validation.html (see
> "Alternative Approach")
> 
> -----Original Message-----
> From: ywtsang [mailto:ywtsang@gmail.com] 
> Sent: Saturday, January 03, 2009 9:46 AM
> To: users@wicket.apache.org
> Subject: Re: Turn off form validation
> 
> 
> i also have a similar use case that requires "turning off" validation
> for some ajax button links
> 
> e.g.
> i have a form, that may have some text fields with different/none
> validators
> 
> and i want to do "translation" on some of the text fields by
> ajax/dynamically, so i need to use ajax button links to "submit" the
> form with the latest input values to backend logic
> 
> for this case, we want to supress the validation error (if any) and have
> wicket to still propagate the form fields to our model automatically
> 
> we can't use "setdefaultformprocess" to false for the ajax button link
> 
> so i go to have a look at the form processing, and copy the wicket's
> form property propagation logic to my form's onerror:
> 
> <code>
> @Override
> protected void onError() {
>   // just for demonstration, can make it happen only for certain cases
> only
>                 
>   // before updating, call the interception method for clients
>   beforeUpdateFormComponentModels();
> 
>   // Update model using form data
>   updateFormComponentModels();
> 
>   // Persist FormComponents if requested
>   // private, can't call
> // persistFormComponentData();
>                
>    super.onError();
> }
> </code>
> 
> there may be problem in propagating the form fields to model if there is
> validation error, but it looks ok to me because the form fields with no
> validation error should still get their values submitted and propagated
> nicely, event some other form fields may have validation error
> 
> 
> 
> noon wrote:
>> 
>> I solved similar problem where I had some required TextField 
>> components and an AJAX component which does a AJAX submit. During this
> 
>> AJAX submit I wanted to prohibit all the form validations. I achieved 
>> this by setting the AJAX components (an autocomplete TextField with 
>> custom AJAX behaviour) into its own nested form... form which is
> inside another form.
>> 
>> I'm not sure does this solve your problem. I found my solution just by
> 
>> trying differend solutions and it worked :)
>> 
>> 
>> 
>> hbf wrote:
>>> 
>>> I have a custom component that allows the user to select one or more 
>>> tags. For this, the component has a text field and an AjaxButton
> "Add"
>>> to add a tag.
>>> 
>>> All works fine if I use the component in a form without validation 
>>> errors. If, however, a text field has setRequired(true), the 
>>> AjaxButton's onSubmit() method is not called (but onError() instead).
>>> 
>>> In this case, I do not want this behaviour but want form validation 
>>> to be disabled for the "Add" AjaxButton. (I still need to get the 
>>> model values updated, though.)
>>> 
>>> Is there an easy way to achieve this?
>>> 
>>> I've read about conditional validation,
>>> 
>>>    http://cwiki.apache.org/WICKET/conditional-validation.html
>>> 
>>> but as my component does not know about the enclosing form, I am 
>>> looking for another solution.
>>> 
>>> Many thanks,
>>> Kaspar
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>> 
>>> 
>>> 
>> 
>> 
> 
> --
> View this message in context:
> http://www.nabble.com/Turn-off-form-validation-tp21090395p21265480.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Turn-off-form-validation-tp21090395p21292775.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


RE: Turn off form validation

Posted by "Hoover, William " <wh...@nemours.org>.
Not sure as to why you cannot use setDefaultFormProcessing?

http://cwiki.apache.org/WICKET/conditional-validation.html (see
"Alternative Approach")

-----Original Message-----
From: ywtsang [mailto:ywtsang@gmail.com] 
Sent: Saturday, January 03, 2009 9:46 AM
To: users@wicket.apache.org
Subject: Re: Turn off form validation


i also have a similar use case that requires "turning off" validation
for some ajax button links

e.g.
i have a form, that may have some text fields with different/none
validators

and i want to do "translation" on some of the text fields by
ajax/dynamically, so i need to use ajax button links to "submit" the
form with the latest input values to backend logic

for this case, we want to supress the validation error (if any) and have
wicket to still propagate the form fields to our model automatically

we can't use "setdefaultformprocess" to false for the ajax button link

so i go to have a look at the form processing, and copy the wicket's
form property propagation logic to my form's onerror:

<code>
@Override
protected void onError() {
  // just for demonstration, can make it happen only for certain cases
only
                
  // before updating, call the interception method for clients
  beforeUpdateFormComponentModels();

  // Update model using form data
  updateFormComponentModels();

  // Persist FormComponents if requested
  // private, can't call
// persistFormComponentData();
               
   super.onError();
}
</code>

there may be problem in propagating the form fields to model if there is
validation error, but it looks ok to me because the form fields with no
validation error should still get their values submitted and propagated
nicely, event some other form fields may have validation error



noon wrote:
> 
> I solved similar problem where I had some required TextField 
> components and an AJAX component which does a AJAX submit. During this

> AJAX submit I wanted to prohibit all the form validations. I achieved 
> this by setting the AJAX components (an autocomplete TextField with 
> custom AJAX behaviour) into its own nested form... form which is
inside another form.
> 
> I'm not sure does this solve your problem. I found my solution just by

> trying differend solutions and it worked :)
> 
> 
> 
> hbf wrote:
>> 
>> I have a custom component that allows the user to select one or more 
>> tags. For this, the component has a text field and an AjaxButton
"Add"
>> to add a tag.
>> 
>> All works fine if I use the component in a form without validation 
>> errors. If, however, a text field has setRequired(true), the 
>> AjaxButton's onSubmit() method is not called (but onError() instead).
>> 
>> In this case, I do not want this behaviour but want form validation 
>> to be disabled for the "Add" AjaxButton. (I still need to get the 
>> model values updated, though.)
>> 
>> Is there an easy way to achieve this?
>> 
>> I've read about conditional validation,
>> 
>>    http://cwiki.apache.org/WICKET/conditional-validation.html
>> 
>> but as my component does not know about the enclosing form, I am 
>> looking for another solution.
>> 
>> Many thanks,
>> Kaspar
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>> 
>> 
>> 
> 
> 

--
View this message in context:
http://www.nabble.com/Turn-off-form-validation-tp21090395p21265480.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Turn off form validation

Posted by ywtsang <yw...@gmail.com>.
i also have a similar use case that requires "turning off" validation for
some ajax button links

e.g.
i have a form, that may have some text fields with different/none validators

and i want to do "translation" on some of the text fields by
ajax/dynamically,
so i need to use ajax button links to "submit" the form with the latest
input values to backend logic

for this case, we want to supress the validation error (if any) and have
wicket to still propagate the form fields to our model automatically

we can't use "setdefaultformprocess" to false for the ajax button link

so i go to have a look at the form processing, and copy the wicket's form
property propagation logic to my form's onerror:

<code>
@Override
protected void onError() {
  // just for demonstration, can make it happen only for certain cases only
                
  // before updating, call the interception method for clients
  beforeUpdateFormComponentModels();

  // Update model using form data
  updateFormComponentModels();

  // Persist FormComponents if requested
  // private, can't call
// persistFormComponentData();
               
   super.onError();
}
</code>

there may be problem in propagating the form fields to model if there is
validation error,
but it looks ok to me because the form fields with no validation error
should still get their values submitted and propagated nicely, event some
other form fields may have validation error



noon wrote:
> 
> I solved similar problem where I had some required TextField components
> and an AJAX component which does a AJAX submit. During this AJAX submit I
> wanted to prohibit all the form validations. I achieved this by setting
> the AJAX components (an autocomplete TextField with custom AJAX behaviour)
> into its own nested form... form which is inside another form.
> 
> I'm not sure does this solve your problem. I found my solution just by
> trying differend solutions and it worked :)
> 
> 
> 
> hbf wrote:
>> 
>> I have a custom component that allows the user to select one or more
>> tags. For this, the component has a text field and an AjaxButton "Add"
>> to add a tag.
>> 
>> All works fine if I use the component in a form without validation
>> errors. If, however, a text field has setRequired(true), the
>> AjaxButton's onSubmit() method is not called (but onError() instead).
>> 
>> In this case, I do not want this behaviour but want form validation
>> to be disabled for the "Add" AjaxButton. (I still need to get the
>> model values updated, though.)
>> 
>> Is there an easy way to achieve this?
>> 
>> I've read about conditional validation,
>> 
>>    http://cwiki.apache.org/WICKET/conditional-validation.html
>> 
>> but as my component does not know about the enclosing form, I am
>> looking for another solution.
>> 
>> Many thanks,
>> Kaspar
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Turn-off-form-validation-tp21090395p21265480.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Turn off form validation

Posted by noon <ra...@gmail.com>.
I solved similar problem where I had some required TextField components and
an AJAX component which does a AJAX submit. During this AJAX submit I wanted
to prohibit all the form validations. I achieved this by setting the AJAX
components (an autocomplete TextField with custom AJAX behaviour) into its
own nested form... form which is inside another form.

I'm not sure does this solve your problem. I found my solution just by
trying differend solutions and it worked :)



hbf wrote:
> 
> I have a custom component that allows the user to select one or more
> tags. For this, the component has a text field and an AjaxButton "Add"
> to add a tag.
> 
> All works fine if I use the component in a form without validation
> errors. If, however, a text field has setRequired(true), the
> AjaxButton's onSubmit() method is not called (but onError() instead).
> 
> In this case, I do not want this behaviour but want form validation
> to be disabled for the "Add" AjaxButton. (I still need to get the
> model values updated, though.)
> 
> Is there an easy way to achieve this?
> 
> I've read about conditional validation,
> 
>    http://cwiki.apache.org/WICKET/conditional-validation.html
> 
> but as my component does not know about the enclosing form, I am
> looking for another solution.
> 
> Many thanks,
> Kaspar
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Turn-off-form-validation-tp21090395p21113545.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Turn off form validation

Posted by Kaspar Fischer <fi...@inf.ethz.ch>.
On 19.01.2009, at 14:25, Hoover, William wrote:

> http://cwiki.apache.org/WICKET/conditional-validation.html see
> alternative approach

Thanks -- I was actually hoping for something simpler/more elegant?!

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


RE: Turn off form validation

Posted by "Hoover, William " <wh...@nemours.org>.
http://cwiki.apache.org/WICKET/conditional-validation.html see
alternative approach 

-----Original Message-----
From: Kaspar Fischer [mailto:fischerk@inf.ethz.ch] 
Sent: Monday, January 19, 2009 5:19 AM
To: users@wicket.apache.org
Subject: Re: Turn off form validation

On 19.12.2008, at 13:45, Martijn Dashorst wrote:

> Adding a new record to a list should not trigger model updates. It 
> should just add the thing and repaint the container with the added 
> item. If you use a (ajax)submit(link|button) you can
> setDefaultFormProcessing(false) on the button/link and wicket will not

> validate nor update model values, but keep the input of the user so it

> can be validated at actual form submission.

Where can I get the input if I do setDefaultFormProcessing(false) when,
as you say, model values or not updated?

> Validation is there to protect your domain objects from invalid data.
> Now you want to bypass this?

I agree. I just do not know yet how to realize this in Wicket. Let me
try to explain: I have a custom form component that allows the user to
add and remove tags. In order to add a tag, the user enters the tag's
name and clicks "Add". Obviously, when she clicks "Add", I do NOT want
the WHOLE form to be validated, as "Add" is not the form's "Submit", but
just an intermediate step in the process of filling out the form.  
Still, I want to get the new tag name she entered -- and for this, I
have to do setDefaultFormProcessing(true). Correct?

Kaspar

P.S. Noon, I think nested forms do not validate so I can't use them.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Turn off form validation

Posted by Kaspar Fischer <fi...@inf.ethz.ch>.
On 19.01.2009, at 20:22, jWeekend wrote:

> Kaspar,
>
> Will either of getInput() or getVaue() allow you to do what you want?

Dear Cemal,

getInput() did it: even with default form processing disabled,  
getInput() gives me the form input.

Thanks a lot.
Kaspar

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Turn off form validation

Posted by jWeekend <jw...@cabouge.com>.
Kaspar,

Will either of getInput() or getVaue() allow you to do what you want?

Regards - Cemal
http://www.jWeekend.co.uk jWeekend 



hbf wrote:
> 
> On 19.12.2008, at 13:45, Martijn Dashorst wrote:
> 
>> Adding a new record to a list should not trigger model updates. It
>> should just add the thing and repaint the container with the added
>> item. If you use a (ajax)submit(link|button) you can
>> setDefaultFormProcessing(false) on the button/link and wicket will not
>> validate nor update model values, but keep the input of the user so it
>> can be validated at actual form submission.
> 
> Where can I get the input if I do setDefaultFormProcessing(false)  
> when, as you say, model values or not updated?
> 
>> Validation is there to protect your domain objects from invalid data.
>> Now you want to bypass this?
> 
> I agree. I just do not know yet how to realize this in Wicket. Let me  
> try to explain: I have a custom form component that allows the user to  
> add and remove tags. In order to add a tag, the user enters the tag's  
> name and clicks "Add". Obviously, when she clicks "Add", I do NOT want  
> the WHOLE form to be validated, as "Add" is not the form's "Submit",  
> but just an intermediate step in the process of filling out the form.  
> Still, I want to get the new tag name she entered -- and for this, I  
> have to do setDefaultFormProcessing(true). Correct?
> 
> Kaspar
> 
> P.S. Noon, I think nested forms do not validate so I can't use them.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Turn-off-form-validation-tp21090395p21549748.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Turn off form validation

Posted by Kaspar Fischer <fi...@inf.ethz.ch>.
On 19.12.2008, at 13:45, Martijn Dashorst wrote:

> Adding a new record to a list should not trigger model updates. It
> should just add the thing and repaint the container with the added
> item. If you use a (ajax)submit(link|button) you can
> setDefaultFormProcessing(false) on the button/link and wicket will not
> validate nor update model values, but keep the input of the user so it
> can be validated at actual form submission.

Where can I get the input if I do setDefaultFormProcessing(false)  
when, as you say, model values or not updated?

> Validation is there to protect your domain objects from invalid data.
> Now you want to bypass this?

I agree. I just do not know yet how to realize this in Wicket. Let me  
try to explain: I have a custom form component that allows the user to  
add and remove tags. In order to add a tag, the user enters the tag's  
name and clicks "Add". Obviously, when she clicks "Add", I do NOT want  
the WHOLE form to be validated, as "Add" is not the form's "Submit",  
but just an intermediate step in the process of filling out the form.  
Still, I want to get the new tag name she entered -- and for this, I  
have to do setDefaultFormProcessing(true). Correct?

Kaspar

P.S. Noon, I think nested forms do not validate so I can't use them.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Turn off form validation

Posted by Martijn Dashorst <ma...@gmail.com>.
Validation is there to protect your domain objects from invalid data.
Now you want to bypass this?

Adding a new record to a list should not trigger model updates. It
should just add the thing and repaint the container with the added
item. If you use a (ajax)submit(link|button) you can
setDefaultFormProcessing(false) on the button/link and wicket will not
validate nor update model values, but keep the input of the user so it
can be validated at actual form submission.

Martijn

On Fri, Dec 19, 2008 at 1:20 PM, Kaspar Fischer <fi...@inf.ethz.ch> wrote:
> I have a custom component that allows the user to select one or more
> tags. For this, the component has a text field and an AjaxButton "Add"
> to add a tag.
>
> All works fine if I use the component in a form without validation
> errors. If, however, a text field has setRequired(true), the
> AjaxButton's onSubmit() method is not called (but onError() instead).
>
> In this case, I do not want this behaviour but want form validation
> to be disabled for the "Add" AjaxButton. (I still need to get the
> model values updated, though.)
>
> Is there an easy way to achieve this?
>
> I've read about conditional validation,
>
>  http://cwiki.apache.org/WICKET/conditional-validation.html
>
> but as my component does not know about the enclosing form, I am
> looking for another solution.
>
> Many thanks,
> Kaspar
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.4 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org