You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by freak182 <em...@gmail.com> on 2008/03/28 05:48:03 UTC

bypass required field during form processing

Hello,
I have a problem about bypassing some textfields during form process.I know
how bypass form processing through adding a method to
button.setDefaultFormProcessing(false);. Now my problem is to bypass only 1
or 3 requiredtextfields during form processing because what im concerned is
only the value of radiogroup attach to the form...e.g.. i have to REMOVE
only the radio button which is selected in the form, thats means no more
inputs needed.Of course, when i have to add items in listview i should
validate if there is value in textfield which required...Thanks a
lot..Cheers.
-- 
View this message in context: http://www.nabble.com/bypass-required-field-during-form-processing-tp16345749p16345749.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: bypass required field during form processing

Posted by freak182 <em...@gmail.com>.
Thanks Igor. It worked for me. Nwei, for reference here is my code snippet:
final RadioGroup rgrp = new RadioGroup("rGrp", new Model()){
			@Override
			protected boolean wantOnSelectionChangedNotifications() {
				// TODO Auto-generated method stub
				return true;
			}
		};
...........
rgrp.add(wc);
form.add(rgrp);

final IndicatingAjaxButton rmvDeno = new IndicatingAjaxButton("rmvDen",
form){
			@Override
			protected void onSubmit(AjaxRequestTarget target, Form form) {
				final Den den = (Den) rgrp.getModelObject();
					getService().delete(den);
				target.addComponent(wc);
			}
		};
rmvDeno.setDefaultFormProcessing(false);
form.add(rmvDeno);

Even if its in form it bypasses the validation and only get the selected
radio buttons values. I think this also applicable to checkgroup? :)


igor.vaynberg wrote:
> 
> add(new RadioGroup(...) { protected
> wantOnSelectionChangedNotifications() { return true; }}
> 
> will make it invoke RadioGroup.onSelectionChanged anytime a selection
> changes
> 
> -igor
> 
> 
> On Thu, Mar 27, 2008 at 10:48 PM, freak182 <em...@gmail.com> wrote:
>>
>>  Nice idea, but i dont know how to implement it. Validator or Behavior?
>> any
>>  codes..thanks a lot..cheers
>>
>>
>>
>>
>>  Martin Makundi wrote:
>>  >
>>  > Ofcourse this does not work if javascript is disabled.
>>  >
>>  > I wonder if it is possible to switch the required fields in a
>>  > validator (one which can be configured to run before the required
>>  > checks).
>>  >
>>  > **
>>  > Martin
>>  >
>>  > 2008/3/28, Martin Makundi <ma...@koodaripalvelut.com>:
>>  >> You could use onchange events to attach ajax behavior that changes
>> the
>>  >>  required fields?
>>  >>
>>  >>  **
>>  >>  Martin
>>  >>
>>  >>  2008/3/28, freak182 <em...@gmail.com>:
>>  >>
>>  >> >
>>  >>  >  Hello,
>>  >>  >  I have a problem about bypassing some textfields during form
>>  >> process.I know
>>  >>  >  how bypass form processing through adding a method to
>>  >>  >  button.setDefaultFormProcessing(false);. Now my problem is to
>> bypass
>>  >> only 1
>>  >>  >  or 3 requiredtextfields during form processing because what im
>>  >> concerned is
>>  >>  >  only the value of radiogroup attach to the form...e.g.. i have to
>>  >> REMOVE
>>  >>  >  only the radio button which is selected in the form, thats means
>> no
>>  >> more
>>  >>  >  inputs needed.Of course, when i have to add items in listview i
>>  >> should
>>  >>  >  validate if there is value in textfield which required...Thanks a
>>  >>  >  lot..Cheers.
>>  >>  >
>>  >>  > --
>>  >>  >  View this message in context:
>>  >>
>> http://www.nabble.com/bypass-required-field-during-form-processing-tp16345749p16345749.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/bypass-required-field-during-form-processing-tp16345749p16346215.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/bypass-required-field-during-form-processing-tp16345749p16347640.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: bypass required field during form processing

Posted by Martin Makundi <ma...@koodaripalvelut.com>.
What if javascript fails? Can the selections be checked again when the
form is submitted?

**
Martin

2008/3/28, Igor Vaynberg <ig...@gmail.com>:
> add(new RadioGroup(...) { protected
>  wantOnSelectionChangedNotifications() { return true; }}
>
>  will make it invoke RadioGroup.onSelectionChanged anytime a selection changes
>
>
>  -igor
>
>
>
>  On Thu, Mar 27, 2008 at 10:48 PM, freak182 <em...@gmail.com> wrote:
>  >
>  >  Nice idea, but i dont know how to implement it. Validator or Behavior? any
>  >  codes..thanks a lot..cheers
>  >
>  >
>  >
>  >
>  >  Martin Makundi wrote:
>  >  >
>  >  > Ofcourse this does not work if javascript is disabled.
>  >  >
>  >  > I wonder if it is possible to switch the required fields in a
>  >  > validator (one which can be configured to run before the required
>  >  > checks).
>  >  >
>  >  > **
>  >  > Martin
>  >  >
>  >  > 2008/3/28, Martin Makundi <ma...@koodaripalvelut.com>:
>  >  >> You could use onchange events to attach ajax behavior that changes the
>  >  >>  required fields?
>  >  >>
>  >  >>  **
>  >  >>  Martin
>  >  >>
>  >  >>  2008/3/28, freak182 <em...@gmail.com>:
>  >  >>
>  >  >> >
>  >  >>  >  Hello,
>  >  >>  >  I have a problem about bypassing some textfields during form
>  >  >> process.I know
>  >  >>  >  how bypass form processing through adding a method to
>  >  >>  >  button.setDefaultFormProcessing(false);. Now my problem is to bypass
>  >  >> only 1
>  >  >>  >  or 3 requiredtextfields during form processing because what im
>  >  >> concerned is
>  >  >>  >  only the value of radiogroup attach to the form...e.g.. i have to
>  >  >> REMOVE
>  >  >>  >  only the radio button which is selected in the form, thats means no
>  >  >> more
>  >  >>  >  inputs needed.Of course, when i have to add items in listview i
>  >  >> should
>  >  >>  >  validate if there is value in textfield which required...Thanks a
>  >  >>  >  lot..Cheers.
>  >  >>  >
>  >  >>  > --
>  >  >>  >  View this message in context:
>  >  >> http://www.nabble.com/bypass-required-field-during-form-processing-tp16345749p16345749.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/bypass-required-field-during-form-processing-tp16345749p16346215.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
>
>

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


Re: bypass required field during form processing

Posted by Igor Vaynberg <ig...@gmail.com>.
add(new RadioGroup(...) { protected
wantOnSelectionChangedNotifications() { return true; }}

will make it invoke RadioGroup.onSelectionChanged anytime a selection changes

-igor


On Thu, Mar 27, 2008 at 10:48 PM, freak182 <em...@gmail.com> wrote:
>
>  Nice idea, but i dont know how to implement it. Validator or Behavior? any
>  codes..thanks a lot..cheers
>
>
>
>
>  Martin Makundi wrote:
>  >
>  > Ofcourse this does not work if javascript is disabled.
>  >
>  > I wonder if it is possible to switch the required fields in a
>  > validator (one which can be configured to run before the required
>  > checks).
>  >
>  > **
>  > Martin
>  >
>  > 2008/3/28, Martin Makundi <ma...@koodaripalvelut.com>:
>  >> You could use onchange events to attach ajax behavior that changes the
>  >>  required fields?
>  >>
>  >>  **
>  >>  Martin
>  >>
>  >>  2008/3/28, freak182 <em...@gmail.com>:
>  >>
>  >> >
>  >>  >  Hello,
>  >>  >  I have a problem about bypassing some textfields during form
>  >> process.I know
>  >>  >  how bypass form processing through adding a method to
>  >>  >  button.setDefaultFormProcessing(false);. Now my problem is to bypass
>  >> only 1
>  >>  >  or 3 requiredtextfields during form processing because what im
>  >> concerned is
>  >>  >  only the value of radiogroup attach to the form...e.g.. i have to
>  >> REMOVE
>  >>  >  only the radio button which is selected in the form, thats means no
>  >> more
>  >>  >  inputs needed.Of course, when i have to add items in listview i
>  >> should
>  >>  >  validate if there is value in textfield which required...Thanks a
>  >>  >  lot..Cheers.
>  >>  >
>  >>  > --
>  >>  >  View this message in context:
>  >> http://www.nabble.com/bypass-required-field-during-form-processing-tp16345749p16345749.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/bypass-required-field-during-form-processing-tp16345749p16346215.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: bypass required field during form processing

Posted by freak182 <em...@gmail.com>.
Nice idea, but i dont know how to implement it. Validator or Behavior? any
codes..thanks a lot..cheers


Martin Makundi wrote:
> 
> Ofcourse this does not work if javascript is disabled.
> 
> I wonder if it is possible to switch the required fields in a
> validator (one which can be configured to run before the required
> checks).
> 
> **
> Martin
> 
> 2008/3/28, Martin Makundi <ma...@koodaripalvelut.com>:
>> You could use onchange events to attach ajax behavior that changes the
>>  required fields?
>>
>>  **
>>  Martin
>>
>>  2008/3/28, freak182 <em...@gmail.com>:
>>
>> >
>>  >  Hello,
>>  >  I have a problem about bypassing some textfields during form
>> process.I know
>>  >  how bypass form processing through adding a method to
>>  >  button.setDefaultFormProcessing(false);. Now my problem is to bypass
>> only 1
>>  >  or 3 requiredtextfields during form processing because what im
>> concerned is
>>  >  only the value of radiogroup attach to the form...e.g.. i have to
>> REMOVE
>>  >  only the radio button which is selected in the form, thats means no
>> more
>>  >  inputs needed.Of course, when i have to add items in listview i
>> should
>>  >  validate if there is value in textfield which required...Thanks a
>>  >  lot..Cheers.
>>  >
>>  > --
>>  >  View this message in context:
>> http://www.nabble.com/bypass-required-field-during-form-processing-tp16345749p16345749.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/bypass-required-field-during-form-processing-tp16345749p16346215.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: bypass required field during form processing

Posted by Martin Makundi <ma...@koodaripalvelut.com>.
Ofcourse this does not work if javascript is disabled.

I wonder if it is possible to switch the required fields in a
validator (one which can be configured to run before the required
checks).

**
Martin

2008/3/28, Martin Makundi <ma...@koodaripalvelut.com>:
> You could use onchange events to attach ajax behavior that changes the
>  required fields?
>
>  **
>  Martin
>
>  2008/3/28, freak182 <em...@gmail.com>:
>
> >
>  >  Hello,
>  >  I have a problem about bypassing some textfields during form process.I know
>  >  how bypass form processing through adding a method to
>  >  button.setDefaultFormProcessing(false);. Now my problem is to bypass only 1
>  >  or 3 requiredtextfields during form processing because what im concerned is
>  >  only the value of radiogroup attach to the form...e.g.. i have to REMOVE
>  >  only the radio button which is selected in the form, thats means no more
>  >  inputs needed.Of course, when i have to add items in listview i should
>  >  validate if there is value in textfield which required...Thanks a
>  >  lot..Cheers.
>  >
>  > --
>  >  View this message in context: http://www.nabble.com/bypass-required-field-during-form-processing-tp16345749p16345749.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: bypass required field during form processing

Posted by Martin Makundi <ma...@koodaripalvelut.com>.
You could use onchange events to attach ajax behavior that changes the
required fields?

**
Martin

2008/3/28, freak182 <em...@gmail.com>:
>
>  Hello,
>  I have a problem about bypassing some textfields during form process.I know
>  how bypass form processing through adding a method to
>  button.setDefaultFormProcessing(false);. Now my problem is to bypass only 1
>  or 3 requiredtextfields during form processing because what im concerned is
>  only the value of radiogroup attach to the form...e.g.. i have to REMOVE
>  only the radio button which is selected in the form, thats means no more
>  inputs needed.Of course, when i have to add items in listview i should
>  validate if there is value in textfield which required...Thanks a
>  lot..Cheers.
>
> --
>  View this message in context: http://www.nabble.com/bypass-required-field-during-form-processing-tp16345749p16345749.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