You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Stefan Malmesjö <s....@gmail.com> on 2009/07/07 08:23:51 UTC

Re: Can I make AjaxFormSubmitBehavior submit raw form data but not validate it?

I just realized that maybe you need to extend your validators, too, at 
least if you want your modelobject to be updated. And how you do that on 
a textfield that is required, I don't really know.

Maybe that path is too complicated.

/Stefan

On 2009-07-06 22:55, Stefan Malmesjö wrote:
> Could setting visibility for the FeedbackPanel to false until the form 
> has been "properly" submitted with a press of a submit button work?
>
> /Stefan
>
> On Mon, Jul 6, 2009 at 8:42 PM, Thierry Leveque <tleveque@gmail.com 
> <ma...@gmail.com>> wrote:
>
>     Any following on that?
>
>     Daniel, have you been able to solve your problem? Did you wrote
>     your own
>     behavior?
>
>     I have the same requirement as you and I am trying to find a quick
>     way to
>     solve my problem.
>
>     Can someone point me to some examples on how to write my own Ajax
>     behavior?
>
>     Thanks
>
>     Thierry
>
>
>     On Tue, Jun 2, 2009 at 12:21, Igor Vaynberg
>     <igor.vaynberg@gmail.com <ma...@gmail.com>> wrote:
>
>     > well, if you do not want to *submit* the form then dont use
>     > ajaxformSUBMITbehavior :)
>     >
>     > with little work you can roll your own behavior that does a simple
>     > ajax get and appends whatever values you need from formcomponents to
>     > the url. that way the form is not submitted and you have access
>     to the
>     > raw values.
>     >
>     > -igor
>     >
>     >
>     >
>     > On Tue, Jun 2, 2009 at 9:16 AM, dfernandez
>     > <dfernandez@users.sourceforge.net
>     <ma...@users.sourceforge.net>> wrote:
>     > >
>     > >
>     > > Yes, I know it is tricky, but the fact is I don't think I
>     would really
>     > need
>     > > type conversion in this case.
>     > >
>     > > I will try to explain myself. I have the following UI:
>     > >
>     > >    |OPERATOR |V|
>     > >
>     > >    |INPUT1="aBc"        |     |INPUT2="DeF"          |
>     > >
>     > > ...being "OPERATOR" the DropDownChoice, and both INPUT1 and
>     INPUT2 two
>     > > TextFields (String TextFields, to be precise). Both INPUT1 and
>     INPUT2 are
>     > > required (when they are visible, of course).
>     > >
>     > > When I change the value on "OPERATOR", the UI will change,
>     hiding INPUT1
>     > and
>     > > INPUT2 but showing INPUT3, another TextField which should have
>     the same
>     > > contents that were on INPUT1 before:
>     > >
>     > >    |OPERATOR |V|
>     > >
>     > >    |INPUT3="aBc"        |
>     > >
>     > > The problem is that, when changing OPERATOR, I need to read
>     the value
>     > from
>     > > INPUT1 to set it into INPUT3, but if INPUT2 is empty I will
>     receive a
>     > > validation message telling me that it is required... which it
>     is, but I
>     > just
>     > > want Wicket to validate that when I want to *really* submit
>     the form, and
>     > > not now that I am only changing the operator.
>     > >
>     > > Thanks.
>     > >
>     > > Regards,
>     > > Daniel.
>     > >
>     > >
>     > >
>     > >
>     > >
>     > > igor.vaynberg wrote:
>     > >>
>     > >> how are you planning on reading the other values? you cannot
>     access
>     > >> the model so you will have to call getinput(), are you also
>     planning
>     > >> on doing type conversion yourself then?
>     > >>
>     > >> -igor
>     > >>
>     > >> 2009/6/2 Daniel Fernández <dfernandez@users.sourceforge.net
>     <ma...@users.sourceforge.net>>:
>     > >>> Hello,
>     > >>>
>     > >>> I have a form with a DropDownChoice, on which "onchange"
>     event I want
>     > to
>     > >>> update some form components. But I need to read data from
>     other fields
>     > of
>     > >>> the form for doing so, and so I added an
>     AjaxFormSubmitBehavior to the
>     > >>> DropDownChoice.
>     > >>>
>     > >>> My intention is to read the data from the drop down and from
>     the other
>     > >>> fields, and depending on these data, update some other
>     components...
>     > but
>     > >>> the
>     > >>> problem is that AjaxFormSubmitBehavior not only sends the
>     form data,
>     > but
>     > >>> also *validates it*, which I don't want (I don't want validation
>     > messages
>     > >>> to
>     > >>> appear when changing the value of the drop down).
>     > >>>
>     > >>> If it where an AjaxButton I would be able to just
>     > >>> setDefaultFormProcessing(false), but I don't see anything
>     like that in
>     > >>> AjaxFormSubmitBehavior...
>     > >>>
>     > >>> Is there a way to do this?
>     > >>>
>     > >>> Regards,
>     > >>> Daniel.
>     > >>>
>     > >>
>     > >>
>     ---------------------------------------------------------------------
>     > >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>     <ma...@wicket.apache.org>
>     > >> For additional commands, e-mail: users-help@wicket.apache.org
>     <ma...@wicket.apache.org>
>     > >>
>     > >>
>     > >>
>     > >
>     > > --
>     > > View this message in context:
>     >
>     http://www.nabble.com/Can-I-make-AjaxFormSubmitBehavior-submit-raw-form-data-but-not--validate-it--tp23830542p23835836.html
>     > > Sent from the Wicket - User mailing list archive at Nabble.com.
>     > >
>     > >
>     > >
>     ---------------------------------------------------------------------
>     > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>     <ma...@wicket.apache.org>
>     > > For additional commands, e-mail: users-help@wicket.apache.org
>     <ma...@wicket.apache.org>
>     > >
>     > >
>     >
>     >
>     ---------------------------------------------------------------------
>     > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>     <ma...@wicket.apache.org>
>     > For additional commands, e-mail: users-help@wicket.apache.org
>     <ma...@wicket.apache.org>
>     >
>     >
>
>


Re: Can I make AjaxFormSubmitBehavior submit raw form data but not validate it?

Posted by Vladimir K <ko...@gmail.com>.
Wicket has strong rules how to handle ajax form submit. Therefore partial
form submitting should be handled differently on the server side.
Anyway we could handle raw strings or invoke converter ourselves.


Vladimir K wrote:
> 
> From the ajax perspective it should be possible to submit any dom element
> with its descendants. I believe it is exactly what Wicket ajax submit is
> doing. IMO forms needed just for regular form submit.
> 
> We just need to change an implementation to accept a list of dom elements
> instead of just one.
> 
> I don't have an opinion about reasons to handle partial form submitting
> lifecycle on the server side.
> 
> 
> tleveque wrote:
>> 
>> Thanks, but I was not talking about using the submit behavior.
>> 
>> I was talking about the way to create my own ajax behavior to send the
>> value
>> of multiple form fields.
>> 
>> I think this should be part of Wicket. It is not the first time I
>> encounter
>> this problem. The first time, I found a workaround but this time I am
>> stuck.
>> There should be a simple way to create an ajax behavior that will send
>> the
>> values from the form components we want. Maybe with the option to
>> validate
>> them or not.
>> What do you think?
>> 
>> Thierry
>> 
>> 
>> 2009/7/7 Stefan Malmesjö <s....@gmail.com>
>> 
>>> I just realized that maybe you need to extend your validators, too, at
>>> least if you want your modelobject to be updated. And how you do that on
>>> a
>>> textfield that is required, I don't really know.
>>>
>>> Maybe that path is too complicated.
>>>
>>> /Stefan
>>>
>>> On 2009-07-06 22:55, Stefan Malmesjö wrote:
>>>
>>>> Could setting visibility for the FeedbackPanel to false until the form
>>>> has
>>>> been "properly" submitted with a press of a submit button work?
>>>>
>>>> /Stefan
>>>>
>>>> On Mon, Jul 6, 2009 at 8:42 PM, Thierry Leveque
>>>> <tleveque@gmail.com<mailto:
>>>> tleveque@gmail.com>> wrote:
>>>>
>>>>    Any following on that?
>>>>
>>>>    Daniel, have you been able to solve your problem? Did you wrote
>>>>    your own
>>>>    behavior?
>>>>
>>>>    I have the same requirement as you and I am trying to find a quick
>>>>    way to
>>>>    solve my problem.
>>>>
>>>>    Can someone point me to some examples on how to write my own Ajax
>>>>    behavior?
>>>>
>>>>    Thanks
>>>>
>>>>    Thierry
>>>>
>>>>
>>>>    On Tue, Jun 2, 2009 at 12:21, Igor Vaynberg
>>>>    <igor.vaynberg@gmail.com <ma...@gmail.com>> wrote:
>>>>
>>>>    > well, if you do not want to *submit* the form then dont use
>>>>    > ajaxformSUBMITbehavior :)
>>>>    >
>>>>    > with little work you can roll your own behavior that does a simple
>>>>    > ajax get and appends whatever values you need from formcomponents
>>>> to
>>>>    > the url. that way the form is not submitted and you have access
>>>>    to the
>>>>    > raw values.
>>>>    >
>>>>    > -igor
>>>>    >
>>>>    >
>>>>    >
>>>>    > On Tue, Jun 2, 2009 at 9:16 AM, dfernandez
>>>>    > <dfernandez@users.sourceforge.net
>>>>    <ma...@users.sourceforge.net>> wrote:
>>>>    > >
>>>>    > >
>>>>    > > Yes, I know it is tricky, but the fact is I don't think I
>>>>    would really
>>>>    > need
>>>>    > > type conversion in this case.
>>>>    > >
>>>>    > > I will try to explain myself. I have the following UI:
>>>>    > >
>>>>    > >    |OPERATOR |V|
>>>>    > >
>>>>    > >    |INPUT1="aBc"        |     |INPUT2="DeF"          |
>>>>    > >
>>>>    > > ...being "OPERATOR" the DropDownChoice, and both INPUT1 and
>>>>    INPUT2 two
>>>>    > > TextFields (String TextFields, to be precise). Both INPUT1 and
>>>>    INPUT2 are
>>>>    > > required (when they are visible, of course).
>>>>    > >
>>>>    > > When I change the value on "OPERATOR", the UI will change,
>>>>    hiding INPUT1
>>>>    > and
>>>>    > > INPUT2 but showing INPUT3, another TextField which should have
>>>>    the same
>>>>    > > contents that were on INPUT1 before:
>>>>    > >
>>>>    > >    |OPERATOR |V|
>>>>    > >
>>>>    > >    |INPUT3="aBc"        |
>>>>    > >
>>>>    > > The problem is that, when changing OPERATOR, I need to read
>>>>    the value
>>>>    > from
>>>>    > > INPUT1 to set it into INPUT3, but if INPUT2 is empty I will
>>>>    receive a
>>>>    > > validation message telling me that it is required... which it
>>>>    is, but I
>>>>    > just
>>>>    > > want Wicket to validate that when I want to *really* submit
>>>>    the form, and
>>>>    > > not now that I am only changing the operator.
>>>>    > >
>>>>    > > Thanks.
>>>>    > >
>>>>    > > Regards,
>>>>    > > Daniel.
>>>>    > >
>>>>    > >
>>>>    > >
>>>>    > >
>>>>    > >
>>>>    > > igor.vaynberg wrote:
>>>>    > >>
>>>>    > >> how are you planning on reading the other values? you cannot
>>>>    access
>>>>    > >> the model so you will have to call getinput(), are you also
>>>>    planning
>>>>    > >> on doing type conversion yourself then?
>>>>    > >>
>>>>    > >> -igor
>>>>    > >>
>>>>    > >> 2009/6/2 Daniel Fernández <dfernandez@users.sourceforge.net
>>>>    <ma...@users.sourceforge.net>>:
>>>>
>>>>    > >>> Hello,
>>>>    > >>>
>>>>    > >>> I have a form with a DropDownChoice, on which "onchange"
>>>>    event I want
>>>>    > to
>>>>    > >>> update some form components. But I need to read data from
>>>>    other fields
>>>>    > of
>>>>    > >>> the form for doing so, and so I added an
>>>>    AjaxFormSubmitBehavior to the
>>>>    > >>> DropDownChoice.
>>>>    > >>>
>>>>    > >>> My intention is to read the data from the drop down and from
>>>>    the other
>>>>    > >>> fields, and depending on these data, update some other
>>>>    components...
>>>>    > but
>>>>    > >>> the
>>>>    > >>> problem is that AjaxFormSubmitBehavior not only sends the
>>>>    form data,
>>>>    > but
>>>>    > >>> also *validates it*, which I don't want (I don't want
>>>> validation
>>>>    > messages
>>>>    > >>> to
>>>>    > >>> appear when changing the value of the drop down).
>>>>    > >>>
>>>>    > >>> If it where an AjaxButton I would be able to just
>>>>    > >>> setDefaultFormProcessing(false), but I don't see anything
>>>>    like that in
>>>>    > >>> AjaxFormSubmitBehavior...
>>>>    > >>>
>>>>    > >>> Is there a way to do this?
>>>>    > >>>
>>>>    > >>> Regards,
>>>>    > >>> Daniel.
>>>>    > >>>
>>>>    > >>
>>>>    > >>
>>>>   
>>>> ---------------------------------------------------------------------
>>>>    > >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>    <ma...@wicket.apache.org>
>>>>    > >> For additional commands, e-mail: users-help@wicket.apache.org
>>>>    <ma...@wicket.apache.org>
>>>>    > >>
>>>>    > >>
>>>>    > >>
>>>>    > >
>>>>    > > --
>>>>    > > View this message in context:
>>>>    >
>>>>
>>>> http://www.nabble.com/Can-I-make-AjaxFormSubmitBehavior-submit-raw-form-data-but-not--validate-it--tp23830542p23835836.html
>>>>    > > Sent from the Wicket - User mailing list archive at Nabble.com.
>>>>    > >
>>>>    > >
>>>>    > >
>>>>   
>>>> ---------------------------------------------------------------------
>>>>    > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>    <ma...@wicket.apache.org>
>>>>    > > For additional commands, e-mail: users-help@wicket.apache.org
>>>>    <ma...@wicket.apache.org>
>>>>    > >
>>>>    > >
>>>>    >
>>>>    >
>>>>   
>>>> ---------------------------------------------------------------------
>>>>    > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>    <ma...@wicket.apache.org>
>>>>    > For additional commands, e-mail: users-help@wicket.apache.org
>>>>    <ma...@wicket.apache.org>
>>>>    >
>>>>    >
>>>>
>>>>
>>>>
>>>
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Can-I-make-AjaxFormSubmitBehavior-submit-raw-form-data-but-not--validate-it--tp23830542p24376992.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: Can I make AjaxFormSubmitBehavior submit raw form data but not validate it?

Posted by Vladimir K <ko...@gmail.com>.
>From the ajax perspective it should be possible to submit any dom element
with its descendants. I believe it is exactly what Wicket ajax submit is
doing. IMO forms needed just for regular form submit.

We just need to change an implementation to accept a list of dom elements
instead of just one.

I don't have an opinion about reasons to handle partial form submitting
lifecycle on the server side.


tleveque wrote:
> 
> Thanks, but I was not talking about using the submit behavior.
> 
> I was talking about the way to create my own ajax behavior to send the
> value
> of multiple form fields.
> 
> I think this should be part of Wicket. It is not the first time I
> encounter
> this problem. The first time, I found a workaround but this time I am
> stuck.
> There should be a simple way to create an ajax behavior that will send the
> values from the form components we want. Maybe with the option to validate
> them or not.
> What do you think?
> 
> Thierry
> 
> 
> 2009/7/7 Stefan Malmesjö <s....@gmail.com>
> 
>> I just realized that maybe you need to extend your validators, too, at
>> least if you want your modelobject to be updated. And how you do that on
>> a
>> textfield that is required, I don't really know.
>>
>> Maybe that path is too complicated.
>>
>> /Stefan
>>
>> On 2009-07-06 22:55, Stefan Malmesjö wrote:
>>
>>> Could setting visibility for the FeedbackPanel to false until the form
>>> has
>>> been "properly" submitted with a press of a submit button work?
>>>
>>> /Stefan
>>>
>>> On Mon, Jul 6, 2009 at 8:42 PM, Thierry Leveque
>>> <tleveque@gmail.com<mailto:
>>> tleveque@gmail.com>> wrote:
>>>
>>>    Any following on that?
>>>
>>>    Daniel, have you been able to solve your problem? Did you wrote
>>>    your own
>>>    behavior?
>>>
>>>    I have the same requirement as you and I am trying to find a quick
>>>    way to
>>>    solve my problem.
>>>
>>>    Can someone point me to some examples on how to write my own Ajax
>>>    behavior?
>>>
>>>    Thanks
>>>
>>>    Thierry
>>>
>>>
>>>    On Tue, Jun 2, 2009 at 12:21, Igor Vaynberg
>>>    <igor.vaynberg@gmail.com <ma...@gmail.com>> wrote:
>>>
>>>    > well, if you do not want to *submit* the form then dont use
>>>    > ajaxformSUBMITbehavior :)
>>>    >
>>>    > with little work you can roll your own behavior that does a simple
>>>    > ajax get and appends whatever values you need from formcomponents
>>> to
>>>    > the url. that way the form is not submitted and you have access
>>>    to the
>>>    > raw values.
>>>    >
>>>    > -igor
>>>    >
>>>    >
>>>    >
>>>    > On Tue, Jun 2, 2009 at 9:16 AM, dfernandez
>>>    > <dfernandez@users.sourceforge.net
>>>    <ma...@users.sourceforge.net>> wrote:
>>>    > >
>>>    > >
>>>    > > Yes, I know it is tricky, but the fact is I don't think I
>>>    would really
>>>    > need
>>>    > > type conversion in this case.
>>>    > >
>>>    > > I will try to explain myself. I have the following UI:
>>>    > >
>>>    > >    |OPERATOR |V|
>>>    > >
>>>    > >    |INPUT1="aBc"        |     |INPUT2="DeF"          |
>>>    > >
>>>    > > ...being "OPERATOR" the DropDownChoice, and both INPUT1 and
>>>    INPUT2 two
>>>    > > TextFields (String TextFields, to be precise). Both INPUT1 and
>>>    INPUT2 are
>>>    > > required (when they are visible, of course).
>>>    > >
>>>    > > When I change the value on "OPERATOR", the UI will change,
>>>    hiding INPUT1
>>>    > and
>>>    > > INPUT2 but showing INPUT3, another TextField which should have
>>>    the same
>>>    > > contents that were on INPUT1 before:
>>>    > >
>>>    > >    |OPERATOR |V|
>>>    > >
>>>    > >    |INPUT3="aBc"        |
>>>    > >
>>>    > > The problem is that, when changing OPERATOR, I need to read
>>>    the value
>>>    > from
>>>    > > INPUT1 to set it into INPUT3, but if INPUT2 is empty I will
>>>    receive a
>>>    > > validation message telling me that it is required... which it
>>>    is, but I
>>>    > just
>>>    > > want Wicket to validate that when I want to *really* submit
>>>    the form, and
>>>    > > not now that I am only changing the operator.
>>>    > >
>>>    > > Thanks.
>>>    > >
>>>    > > Regards,
>>>    > > Daniel.
>>>    > >
>>>    > >
>>>    > >
>>>    > >
>>>    > >
>>>    > > igor.vaynberg wrote:
>>>    > >>
>>>    > >> how are you planning on reading the other values? you cannot
>>>    access
>>>    > >> the model so you will have to call getinput(), are you also
>>>    planning
>>>    > >> on doing type conversion yourself then?
>>>    > >>
>>>    > >> -igor
>>>    > >>
>>>    > >> 2009/6/2 Daniel Fernández <dfernandez@users.sourceforge.net
>>>    <ma...@users.sourceforge.net>>:
>>>
>>>    > >>> Hello,
>>>    > >>>
>>>    > >>> I have a form with a DropDownChoice, on which "onchange"
>>>    event I want
>>>    > to
>>>    > >>> update some form components. But I need to read data from
>>>    other fields
>>>    > of
>>>    > >>> the form for doing so, and so I added an
>>>    AjaxFormSubmitBehavior to the
>>>    > >>> DropDownChoice.
>>>    > >>>
>>>    > >>> My intention is to read the data from the drop down and from
>>>    the other
>>>    > >>> fields, and depending on these data, update some other
>>>    components...
>>>    > but
>>>    > >>> the
>>>    > >>> problem is that AjaxFormSubmitBehavior not only sends the
>>>    form data,
>>>    > but
>>>    > >>> also *validates it*, which I don't want (I don't want
>>> validation
>>>    > messages
>>>    > >>> to
>>>    > >>> appear when changing the value of the drop down).
>>>    > >>>
>>>    > >>> If it where an AjaxButton I would be able to just
>>>    > >>> setDefaultFormProcessing(false), but I don't see anything
>>>    like that in
>>>    > >>> AjaxFormSubmitBehavior...
>>>    > >>>
>>>    > >>> Is there a way to do this?
>>>    > >>>
>>>    > >>> Regards,
>>>    > >>> Daniel.
>>>    > >>>
>>>    > >>
>>>    > >>
>>>    ---------------------------------------------------------------------
>>>    > >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>    <ma...@wicket.apache.org>
>>>    > >> For additional commands, e-mail: users-help@wicket.apache.org
>>>    <ma...@wicket.apache.org>
>>>    > >>
>>>    > >>
>>>    > >>
>>>    > >
>>>    > > --
>>>    > > View this message in context:
>>>    >
>>>
>>> http://www.nabble.com/Can-I-make-AjaxFormSubmitBehavior-submit-raw-form-data-but-not--validate-it--tp23830542p23835836.html
>>>    > > Sent from the Wicket - User mailing list archive at Nabble.com.
>>>    > >
>>>    > >
>>>    > >
>>>    ---------------------------------------------------------------------
>>>    > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>    <ma...@wicket.apache.org>
>>>    > > For additional commands, e-mail: users-help@wicket.apache.org
>>>    <ma...@wicket.apache.org>
>>>    > >
>>>    > >
>>>    >
>>>    >
>>>    ---------------------------------------------------------------------
>>>    > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>    <ma...@wicket.apache.org>
>>>    > For additional commands, e-mail: users-help@wicket.apache.org
>>>    <ma...@wicket.apache.org>
>>>    >
>>>    >
>>>
>>>
>>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Can-I-make-AjaxFormSubmitBehavior-submit-raw-form-data-but-not--validate-it--tp23830542p24376917.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: Can I make AjaxFormSubmitBehavior submit raw form data but not validate it?

Posted by Vladimir K <ko...@gmail.com>.
Igor, for now I'm concerned about how can I make sure that my code that
mimics form submitting lifecycles and wicket code in coming version do the
same things?

For instance the AjaxFormComponentUpdatingBehavior:

	@Override
	protected final void onEvent(final AjaxRequestTarget target)
	{
		final FormComponent<?> formComponent = getFormComponent();

		if (getEvent().toLowerCase().equals("onblur") && disableFocusOnBlur())
		{
			target.focusComponent(null);
		}

		try
		{
			formComponent.inputChanged();
			formComponent.validate();
			if (formComponent.hasErrorMessage())
			{
				formComponent.invalid();

				onError(target, null);
			}
			else
			{
				formComponent.valid();
				if (getUpdateModel())
				{
					formComponent.updateModel();
				}

				onUpdate(target);
			}
		}
		catch (RuntimeException e)
		{
			onError(target, e);

		}
	}

I should do something similar but for the list of components the behavior
takes.
If the coming version of Wicket does it a bit different I would have to
insert a fork in my code that does version check:

switch(wicketVersion) {
case ...:
case ...:
}

If wicket sources had the form processing code extracted into utility class
I would employ it and be sure it should work in the new wicket version.


igor.vaynberg wrote:
> 
> you can see how the submit behavior does it and replicate the parts
> you need. all these things are not using some magical internal apis.
> you are meant to build your own things when the default
> implementations do not do what you want.
> 
> -igor
> 
> On Tue, Jul 7, 2009 at 6:35 AM, Thierry Leveque<tl...@gmail.com> wrote:
>> Thanks, but I was not talking about using the submit behavior.
>>
>> I was talking about the way to create my own ajax behavior to send the
>> value
>> of multiple form fields.
>>
>> I think this should be part of Wicket. It is not the first time I
>> encounter
>> this problem. The first time, I found a workaround but this time I am
>> stuck.
>> There should be a simple way to create an ajax behavior that will send
>> the
>> values from the form components we want. Maybe with the option to
>> validate
>> them or not.
>> What do you think?
>>
>> Thierry
>>
>>
>> 2009/7/7 Stefan Malmesjö <s....@gmail.com>
>>
>>> I just realized that maybe you need to extend your validators, too, at
>>> least if you want your modelobject to be updated. And how you do that on
>>> a
>>> textfield that is required, I don't really know.
>>>
>>> Maybe that path is too complicated.
>>>
>>> /Stefan
>>>
>>> On 2009-07-06 22:55, Stefan Malmesjö wrote:
>>>
>>>> Could setting visibility for the FeedbackPanel to false until the form
>>>> has
>>>> been "properly" submitted with a press of a submit button work?
>>>>
>>>> /Stefan
>>>>
>>>> On Mon, Jul 6, 2009 at 8:42 PM, Thierry Leveque
>>>> <tleveque@gmail.com<mailto:
>>>> tleveque@gmail.com>> wrote:
>>>>
>>>>    Any following on that?
>>>>
>>>>    Daniel, have you been able to solve your problem? Did you wrote
>>>>    your own
>>>>    behavior?
>>>>
>>>>    I have the same requirement as you and I am trying to find a quick
>>>>    way to
>>>>    solve my problem.
>>>>
>>>>    Can someone point me to some examples on how to write my own Ajax
>>>>    behavior?
>>>>
>>>>    Thanks
>>>>
>>>>    Thierry
>>>>
>>>>
>>>>    On Tue, Jun 2, 2009 at 12:21, Igor Vaynberg
>>>>    <igor.vaynberg@gmail.com <ma...@gmail.com>> wrote:
>>>>
>>>>    > well, if you do not want to *submit* the form then dont use
>>>>    > ajaxformSUBMITbehavior :)
>>>>    >
>>>>    > with little work you can roll your own behavior that does a simple
>>>>    > ajax get and appends whatever values you need from formcomponents
>>>> to
>>>>    > the url. that way the form is not submitted and you have access
>>>>    to the
>>>>    > raw values.
>>>>    >
>>>>    > -igor
>>>>    >
>>>>    >
>>>>    >
>>>>    > On Tue, Jun 2, 2009 at 9:16 AM, dfernandez
>>>>    > <dfernandez@users.sourceforge.net
>>>>    <ma...@users.sourceforge.net>> wrote:
>>>>    > >
>>>>    > >
>>>>    > > Yes, I know it is tricky, but the fact is I don't think I
>>>>    would really
>>>>    > need
>>>>    > > type conversion in this case.
>>>>    > >
>>>>    > > I will try to explain myself. I have the following UI:
>>>>    > >
>>>>    > >    |OPERATOR |V|
>>>>    > >
>>>>    > >    |INPUT1="aBc"        |     |INPUT2="DeF"          |
>>>>    > >
>>>>    > > ...being "OPERATOR" the DropDownChoice, and both INPUT1 and
>>>>    INPUT2 two
>>>>    > > TextFields (String TextFields, to be precise). Both INPUT1 and
>>>>    INPUT2 are
>>>>    > > required (when they are visible, of course).
>>>>    > >
>>>>    > > When I change the value on "OPERATOR", the UI will change,
>>>>    hiding INPUT1
>>>>    > and
>>>>    > > INPUT2 but showing INPUT3, another TextField which should have
>>>>    the same
>>>>    > > contents that were on INPUT1 before:
>>>>    > >
>>>>    > >    |OPERATOR |V|
>>>>    > >
>>>>    > >    |INPUT3="aBc"        |
>>>>    > >
>>>>    > > The problem is that, when changing OPERATOR, I need to read
>>>>    the value
>>>>    > from
>>>>    > > INPUT1 to set it into INPUT3, but if INPUT2 is empty I will
>>>>    receive a
>>>>    > > validation message telling me that it is required... which it
>>>>    is, but I
>>>>    > just
>>>>    > > want Wicket to validate that when I want to *really* submit
>>>>    the form, and
>>>>    > > not now that I am only changing the operator.
>>>>    > >
>>>>    > > Thanks.
>>>>    > >
>>>>    > > Regards,
>>>>    > > Daniel.
>>>>    > >
>>>>    > >
>>>>    > >
>>>>    > >
>>>>    > >
>>>>    > > igor.vaynberg wrote:
>>>>    > >>
>>>>    > >> how are you planning on reading the other values? you cannot
>>>>    access
>>>>    > >> the model so you will have to call getinput(), are you also
>>>>    planning
>>>>    > >> on doing type conversion yourself then?
>>>>    > >>
>>>>    > >> -igor
>>>>    > >>
>>>>    > >> 2009/6/2 Daniel Fernández <dfernandez@users.sourceforge.net
>>>>    <ma...@users.sourceforge.net>>:
>>>>
>>>>    > >>> Hello,
>>>>    > >>>
>>>>    > >>> I have a form with a DropDownChoice, on which "onchange"
>>>>    event I want
>>>>    > to
>>>>    > >>> update some form components. But I need to read data from
>>>>    other fields
>>>>    > of
>>>>    > >>> the form for doing so, and so I added an
>>>>    AjaxFormSubmitBehavior to the
>>>>    > >>> DropDownChoice.
>>>>    > >>>
>>>>    > >>> My intention is to read the data from the drop down and from
>>>>    the other
>>>>    > >>> fields, and depending on these data, update some other
>>>>    components...
>>>>    > but
>>>>    > >>> the
>>>>    > >>> problem is that AjaxFormSubmitBehavior not only sends the
>>>>    form data,
>>>>    > but
>>>>    > >>> also *validates it*, which I don't want (I don't want
>>>> validation
>>>>    > messages
>>>>    > >>> to
>>>>    > >>> appear when changing the value of the drop down).
>>>>    > >>>
>>>>    > >>> If it where an AjaxButton I would be able to just
>>>>    > >>> setDefaultFormProcessing(false), but I don't see anything
>>>>    like that in
>>>>    > >>> AjaxFormSubmitBehavior...
>>>>    > >>>
>>>>    > >>> Is there a way to do this?
>>>>    > >>>
>>>>    > >>> Regards,
>>>>    > >>> Daniel.
>>>>    > >>>
>>>>    > >>
>>>>    > >>
>>>>  
>>>>  ---------------------------------------------------------------------
>>>>    > >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>    <ma...@wicket.apache.org>
>>>>    > >> For additional commands, e-mail: users-help@wicket.apache.org
>>>>    <ma...@wicket.apache.org>
>>>>    > >>
>>>>    > >>
>>>>    > >>
>>>>    > >
>>>>    > > --
>>>>    > > View this message in context:
>>>>    >
>>>>
>>>> http://www.nabble.com/Can-I-make-AjaxFormSubmitBehavior-submit-raw-form-data-but-not--validate-it--tp23830542p23835836.html
>>>>    > > Sent from the Wicket - User mailing list archive at Nabble.com.
>>>>    > >
>>>>    > >
>>>>    > >
>>>>  
>>>>  ---------------------------------------------------------------------
>>>>    > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>    <ma...@wicket.apache.org>
>>>>    > > For additional commands, e-mail: users-help@wicket.apache.org
>>>>    <ma...@wicket.apache.org>
>>>>    > >
>>>>    > >
>>>>    >
>>>>    >
>>>>  
>>>>  ---------------------------------------------------------------------
>>>>    > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>    <ma...@wicket.apache.org>
>>>>    > For additional commands, e-mail: users-help@wicket.apache.org
>>>>    <ma...@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/Can-I-make-AjaxFormSubmitBehavior-submit-raw-form-data-but-not--validate-it--tp23830542p24387062.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: Can I make AjaxFormSubmitBehavior submit raw form data but not validate it?

Posted by Igor Vaynberg <ig...@gmail.com>.
no, the goal of a framework is to make the 90% usecase easy and the
10% usecase possible.

there arent many threads on this list requesting this particular
feature so i guess its not that common a usecase. of course, you can
always add a jira ticket with a patch.

-igor

On Tue, Jul 7, 2009 at 1:08 PM, Thierry Leveque<tl...@gmail.com> wrote:
> Of course, but the goal of using a framework like Wicket is just that: avoid
> having to write everything by myself. No?
>
> So it is a suggestion to add in a future release. I think a lot of people
> need that kind of functionality. If it could be generic enough.
>
> I think Ajax is rarely used to submit a form. It is more to make it dynamic.
> Like adapting the form content based on other fields values. I can see tons
> of examples for that.
> It would be very nice to be able to do that kind of stuff without having to
> rewrite part of the code ourselves.
>
> I I find time to write it myself I will be glad to give my code to the
> Wicket team...
>
> Thierry
>
>
> On Tue, Jul 7, 2009 at 15:40, Igor Vaynberg <ig...@gmail.com> wrote:
>
>> you can see how the submit behavior does it and replicate the parts
>> you need. all these things are not using some magical internal apis.
>> you are meant to build your own things when the default
>> implementations do not do what you want.
>>
>> -igor
>>
>> On Tue, Jul 7, 2009 at 6:35 AM, Thierry Leveque<tl...@gmail.com> wrote:
>> > Thanks, but I was not talking about using the submit behavior.
>> >
>> > I was talking about the way to create my own ajax behavior to send the
>> value
>> > of multiple form fields.
>> >
>> > I think this should be part of Wicket. It is not the first time I
>> encounter
>> > this problem. The first time, I found a workaround but this time I am
>> stuck.
>> > There should be a simple way to create an ajax behavior that will send
>> the
>> > values from the form components we want. Maybe with the option to
>> validate
>> > them or not.
>> > What do you think?
>> >
>> > Thierry
>> >
>> >
>> > 2009/7/7 Stefan Malmesjö <s....@gmail.com>
>> >
>> >> I just realized that maybe you need to extend your validators, too, at
>> >> least if you want your modelobject to be updated. And how you do that on
>> a
>> >> textfield that is required, I don't really know.
>> >>
>> >> Maybe that path is too complicated.
>> >>
>> >> /Stefan
>> >>
>> >> On 2009-07-06 22:55, Stefan Malmesjö wrote:
>> >>
>> >>> Could setting visibility for the FeedbackPanel to false until the form
>> has
>> >>> been "properly" submitted with a press of a submit button work?
>> >>>
>> >>> /Stefan
>> >>>
>> >>> On Mon, Jul 6, 2009 at 8:42 PM, Thierry Leveque <tleveque@gmail.com
>> <mailto:
>> >>> tleveque@gmail.com>> wrote:
>> >>>
>> >>>    Any following on that?
>> >>>
>> >>>    Daniel, have you been able to solve your problem? Did you wrote
>> >>>    your own
>> >>>    behavior?
>> >>>
>> >>>    I have the same requirement as you and I am trying to find a quick
>> >>>    way to
>> >>>    solve my problem.
>> >>>
>> >>>    Can someone point me to some examples on how to write my own Ajax
>> >>>    behavior?
>> >>>
>> >>>    Thanks
>> >>>
>> >>>    Thierry
>> >>>
>> >>>
>> >>>    On Tue, Jun 2, 2009 at 12:21, Igor Vaynberg
>> >>>    <igor.vaynberg@gmail.com <ma...@gmail.com>> wrote:
>> >>>
>> >>>    > well, if you do not want to *submit* the form then dont use
>> >>>    > ajaxformSUBMITbehavior :)
>> >>>    >
>> >>>    > with little work you can roll your own behavior that does a simple
>> >>>    > ajax get and appends whatever values you need from formcomponents
>> to
>> >>>    > the url. that way the form is not submitted and you have access
>> >>>    to the
>> >>>    > raw values.
>> >>>    >
>> >>>    > -igor
>> >>>    >
>> >>>    >
>> >>>    >
>> >>>    > On Tue, Jun 2, 2009 at 9:16 AM, dfernandez
>> >>>    > <dfernandez@users.sourceforge.net
>> >>>    <ma...@users.sourceforge.net>> wrote:
>> >>>    > >
>> >>>    > >
>> >>>    > > Yes, I know it is tricky, but the fact is I don't think I
>> >>>    would really
>> >>>    > need
>> >>>    > > type conversion in this case.
>> >>>    > >
>> >>>    > > I will try to explain myself. I have the following UI:
>> >>>    > >
>> >>>    > >    |OPERATOR |V|
>> >>>    > >
>> >>>    > >    |INPUT1="aBc"        |     |INPUT2="DeF"          |
>> >>>    > >
>> >>>    > > ...being "OPERATOR" the DropDownChoice, and both INPUT1 and
>> >>>    INPUT2 two
>> >>>    > > TextFields (String TextFields, to be precise). Both INPUT1 and
>> >>>    INPUT2 are
>> >>>    > > required (when they are visible, of course).
>> >>>    > >
>> >>>    > > When I change the value on "OPERATOR", the UI will change,
>> >>>    hiding INPUT1
>> >>>    > and
>> >>>    > > INPUT2 but showing INPUT3, another TextField which should have
>> >>>    the same
>> >>>    > > contents that were on INPUT1 before:
>> >>>    > >
>> >>>    > >    |OPERATOR |V|
>> >>>    > >
>> >>>    > >    |INPUT3="aBc"        |
>> >>>    > >
>> >>>    > > The problem is that, when changing OPERATOR, I need to read
>> >>>    the value
>> >>>    > from
>> >>>    > > INPUT1 to set it into INPUT3, but if INPUT2 is empty I will
>> >>>    receive a
>> >>>    > > validation message telling me that it is required... which it
>> >>>    is, but I
>> >>>    > just
>> >>>    > > want Wicket to validate that when I want to *really* submit
>> >>>    the form, and
>> >>>    > > not now that I am only changing the operator.
>> >>>    > >
>> >>>    > > Thanks.
>> >>>    > >
>> >>>    > > Regards,
>> >>>    > > Daniel.
>> >>>    > >
>> >>>    > >
>> >>>    > >
>> >>>    > >
>> >>>    > >
>> >>>    > > igor.vaynberg wrote:
>> >>>    > >>
>> >>>    > >> how are you planning on reading the other values? you cannot
>> >>>    access
>> >>>    > >> the model so you will have to call getinput(), are you also
>> >>>    planning
>> >>>    > >> on doing type conversion yourself then?
>> >>>    > >>
>> >>>    > >> -igor
>> >>>    > >>
>> >>>    > >> 2009/6/2 Daniel Fernández <dfernandez@users.sourceforge.net
>> >>>    <ma...@users.sourceforge.net>>:
>> >>>
>> >>>    > >>> Hello,
>> >>>    > >>>
>> >>>    > >>> I have a form with a DropDownChoice, on which "onchange"
>> >>>    event I want
>> >>>    > to
>> >>>    > >>> update some form components. But I need to read data from
>> >>>    other fields
>> >>>    > of
>> >>>    > >>> the form for doing so, and so I added an
>> >>>    AjaxFormSubmitBehavior to the
>> >>>    > >>> DropDownChoice.
>> >>>    > >>>
>> >>>    > >>> My intention is to read the data from the drop down and from
>> >>>    the other
>> >>>    > >>> fields, and depending on these data, update some other
>> >>>    components...
>> >>>    > but
>> >>>    > >>> the
>> >>>    > >>> problem is that AjaxFormSubmitBehavior not only sends the
>> >>>    form data,
>> >>>    > but
>> >>>    > >>> also *validates it*, which I don't want (I don't want
>> validation
>> >>>    > messages
>> >>>    > >>> to
>> >>>    > >>> appear when changing the value of the drop down).
>> >>>    > >>>
>> >>>    > >>> If it where an AjaxButton I would be able to just
>> >>>    > >>> setDefaultFormProcessing(false), but I don't see anything
>> >>>    like that in
>> >>>    > >>> AjaxFormSubmitBehavior...
>> >>>    > >>>
>> >>>    > >>> Is there a way to do this?
>> >>>    > >>>
>> >>>    > >>> Regards,
>> >>>    > >>> Daniel.
>> >>>    > >>>
>> >>>    > >>
>> >>>    > >>
>> >>>
>>  ---------------------------------------------------------------------
>> >>>    > >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> >>>    <ma...@wicket.apache.org>
>> >>>    > >> For additional commands, e-mail: users-help@wicket.apache.org
>> >>>    <ma...@wicket.apache.org>
>> >>>    > >>
>> >>>    > >>
>> >>>    > >>
>> >>>    > >
>> >>>    > > --
>> >>>    > > View this message in context:
>> >>>    >
>> >>>
>> >>>
>> http://www.nabble.com/Can-I-make-AjaxFormSubmitBehavior-submit-raw-form-data-but-not--validate-it--tp23830542p23835836.html
>> >>>    > > Sent from the Wicket - User mailing list archive at Nabble.com.
>> >>>    > >
>> >>>    > >
>> >>>    > >
>> >>>
>>  ---------------------------------------------------------------------
>> >>>    > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> >>>    <ma...@wicket.apache.org>
>> >>>    > > For additional commands, e-mail: users-help@wicket.apache.org
>> >>>    <ma...@wicket.apache.org>
>> >>>    > >
>> >>>    > >
>> >>>    >
>> >>>    >
>> >>>
>>  ---------------------------------------------------------------------
>> >>>    > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> >>>    <ma...@wicket.apache.org>
>> >>>    > For additional commands, e-mail: users-help@wicket.apache.org
>> >>>    <ma...@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: Can I make AjaxFormSubmitBehavior submit raw form data but not validate it?

Posted by Thierry Leveque <tl...@gmail.com>.
Of course, but the goal of using a framework like Wicket is just that: avoid
having to write everything by myself. No?

So it is a suggestion to add in a future release. I think a lot of people
need that kind of functionality. If it could be generic enough.

I think Ajax is rarely used to submit a form. It is more to make it dynamic.
Like adapting the form content based on other fields values. I can see tons
of examples for that.
It would be very nice to be able to do that kind of stuff without having to
rewrite part of the code ourselves.

I I find time to write it myself I will be glad to give my code to the
Wicket team...

Thierry


On Tue, Jul 7, 2009 at 15:40, Igor Vaynberg <ig...@gmail.com> wrote:

> you can see how the submit behavior does it and replicate the parts
> you need. all these things are not using some magical internal apis.
> you are meant to build your own things when the default
> implementations do not do what you want.
>
> -igor
>
> On Tue, Jul 7, 2009 at 6:35 AM, Thierry Leveque<tl...@gmail.com> wrote:
> > Thanks, but I was not talking about using the submit behavior.
> >
> > I was talking about the way to create my own ajax behavior to send the
> value
> > of multiple form fields.
> >
> > I think this should be part of Wicket. It is not the first time I
> encounter
> > this problem. The first time, I found a workaround but this time I am
> stuck.
> > There should be a simple way to create an ajax behavior that will send
> the
> > values from the form components we want. Maybe with the option to
> validate
> > them or not.
> > What do you think?
> >
> > Thierry
> >
> >
> > 2009/7/7 Stefan Malmesjö <s....@gmail.com>
> >
> >> I just realized that maybe you need to extend your validators, too, at
> >> least if you want your modelobject to be updated. And how you do that on
> a
> >> textfield that is required, I don't really know.
> >>
> >> Maybe that path is too complicated.
> >>
> >> /Stefan
> >>
> >> On 2009-07-06 22:55, Stefan Malmesjö wrote:
> >>
> >>> Could setting visibility for the FeedbackPanel to false until the form
> has
> >>> been "properly" submitted with a press of a submit button work?
> >>>
> >>> /Stefan
> >>>
> >>> On Mon, Jul 6, 2009 at 8:42 PM, Thierry Leveque <tleveque@gmail.com
> <mailto:
> >>> tleveque@gmail.com>> wrote:
> >>>
> >>>    Any following on that?
> >>>
> >>>    Daniel, have you been able to solve your problem? Did you wrote
> >>>    your own
> >>>    behavior?
> >>>
> >>>    I have the same requirement as you and I am trying to find a quick
> >>>    way to
> >>>    solve my problem.
> >>>
> >>>    Can someone point me to some examples on how to write my own Ajax
> >>>    behavior?
> >>>
> >>>    Thanks
> >>>
> >>>    Thierry
> >>>
> >>>
> >>>    On Tue, Jun 2, 2009 at 12:21, Igor Vaynberg
> >>>    <igor.vaynberg@gmail.com <ma...@gmail.com>> wrote:
> >>>
> >>>    > well, if you do not want to *submit* the form then dont use
> >>>    > ajaxformSUBMITbehavior :)
> >>>    >
> >>>    > with little work you can roll your own behavior that does a simple
> >>>    > ajax get and appends whatever values you need from formcomponents
> to
> >>>    > the url. that way the form is not submitted and you have access
> >>>    to the
> >>>    > raw values.
> >>>    >
> >>>    > -igor
> >>>    >
> >>>    >
> >>>    >
> >>>    > On Tue, Jun 2, 2009 at 9:16 AM, dfernandez
> >>>    > <dfernandez@users.sourceforge.net
> >>>    <ma...@users.sourceforge.net>> wrote:
> >>>    > >
> >>>    > >
> >>>    > > Yes, I know it is tricky, but the fact is I don't think I
> >>>    would really
> >>>    > need
> >>>    > > type conversion in this case.
> >>>    > >
> >>>    > > I will try to explain myself. I have the following UI:
> >>>    > >
> >>>    > >    |OPERATOR |V|
> >>>    > >
> >>>    > >    |INPUT1="aBc"        |     |INPUT2="DeF"          |
> >>>    > >
> >>>    > > ...being "OPERATOR" the DropDownChoice, and both INPUT1 and
> >>>    INPUT2 two
> >>>    > > TextFields (String TextFields, to be precise). Both INPUT1 and
> >>>    INPUT2 are
> >>>    > > required (when they are visible, of course).
> >>>    > >
> >>>    > > When I change the value on "OPERATOR", the UI will change,
> >>>    hiding INPUT1
> >>>    > and
> >>>    > > INPUT2 but showing INPUT3, another TextField which should have
> >>>    the same
> >>>    > > contents that were on INPUT1 before:
> >>>    > >
> >>>    > >    |OPERATOR |V|
> >>>    > >
> >>>    > >    |INPUT3="aBc"        |
> >>>    > >
> >>>    > > The problem is that, when changing OPERATOR, I need to read
> >>>    the value
> >>>    > from
> >>>    > > INPUT1 to set it into INPUT3, but if INPUT2 is empty I will
> >>>    receive a
> >>>    > > validation message telling me that it is required... which it
> >>>    is, but I
> >>>    > just
> >>>    > > want Wicket to validate that when I want to *really* submit
> >>>    the form, and
> >>>    > > not now that I am only changing the operator.
> >>>    > >
> >>>    > > Thanks.
> >>>    > >
> >>>    > > Regards,
> >>>    > > Daniel.
> >>>    > >
> >>>    > >
> >>>    > >
> >>>    > >
> >>>    > >
> >>>    > > igor.vaynberg wrote:
> >>>    > >>
> >>>    > >> how are you planning on reading the other values? you cannot
> >>>    access
> >>>    > >> the model so you will have to call getinput(), are you also
> >>>    planning
> >>>    > >> on doing type conversion yourself then?
> >>>    > >>
> >>>    > >> -igor
> >>>    > >>
> >>>    > >> 2009/6/2 Daniel Fernández <dfernandez@users.sourceforge.net
> >>>    <ma...@users.sourceforge.net>>:
> >>>
> >>>    > >>> Hello,
> >>>    > >>>
> >>>    > >>> I have a form with a DropDownChoice, on which "onchange"
> >>>    event I want
> >>>    > to
> >>>    > >>> update some form components. But I need to read data from
> >>>    other fields
> >>>    > of
> >>>    > >>> the form for doing so, and so I added an
> >>>    AjaxFormSubmitBehavior to the
> >>>    > >>> DropDownChoice.
> >>>    > >>>
> >>>    > >>> My intention is to read the data from the drop down and from
> >>>    the other
> >>>    > >>> fields, and depending on these data, update some other
> >>>    components...
> >>>    > but
> >>>    > >>> the
> >>>    > >>> problem is that AjaxFormSubmitBehavior not only sends the
> >>>    form data,
> >>>    > but
> >>>    > >>> also *validates it*, which I don't want (I don't want
> validation
> >>>    > messages
> >>>    > >>> to
> >>>    > >>> appear when changing the value of the drop down).
> >>>    > >>>
> >>>    > >>> If it where an AjaxButton I would be able to just
> >>>    > >>> setDefaultFormProcessing(false), but I don't see anything
> >>>    like that in
> >>>    > >>> AjaxFormSubmitBehavior...
> >>>    > >>>
> >>>    > >>> Is there a way to do this?
> >>>    > >>>
> >>>    > >>> Regards,
> >>>    > >>> Daniel.
> >>>    > >>>
> >>>    > >>
> >>>    > >>
> >>>
>  ---------------------------------------------------------------------
> >>>    > >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >>>    <ma...@wicket.apache.org>
> >>>    > >> For additional commands, e-mail: users-help@wicket.apache.org
> >>>    <ma...@wicket.apache.org>
> >>>    > >>
> >>>    > >>
> >>>    > >>
> >>>    > >
> >>>    > > --
> >>>    > > View this message in context:
> >>>    >
> >>>
> >>>
> http://www.nabble.com/Can-I-make-AjaxFormSubmitBehavior-submit-raw-form-data-but-not--validate-it--tp23830542p23835836.html
> >>>    > > Sent from the Wicket - User mailing list archive at Nabble.com.
> >>>    > >
> >>>    > >
> >>>    > >
> >>>
>  ---------------------------------------------------------------------
> >>>    > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >>>    <ma...@wicket.apache.org>
> >>>    > > For additional commands, e-mail: users-help@wicket.apache.org
> >>>    <ma...@wicket.apache.org>
> >>>    > >
> >>>    > >
> >>>    >
> >>>    >
> >>>
>  ---------------------------------------------------------------------
> >>>    > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >>>    <ma...@wicket.apache.org>
> >>>    > For additional commands, e-mail: users-help@wicket.apache.org
> >>>    <ma...@wicket.apache.org>
> >>>    >
> >>>    >
> >>>
> >>>
> >>>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Can I make AjaxFormSubmitBehavior submit raw form data but not validate it?

Posted by Igor Vaynberg <ig...@gmail.com>.
you can see how the submit behavior does it and replicate the parts
you need. all these things are not using some magical internal apis.
you are meant to build your own things when the default
implementations do not do what you want.

-igor

On Tue, Jul 7, 2009 at 6:35 AM, Thierry Leveque<tl...@gmail.com> wrote:
> Thanks, but I was not talking about using the submit behavior.
>
> I was talking about the way to create my own ajax behavior to send the value
> of multiple form fields.
>
> I think this should be part of Wicket. It is not the first time I encounter
> this problem. The first time, I found a workaround but this time I am stuck.
> There should be a simple way to create an ajax behavior that will send the
> values from the form components we want. Maybe with the option to validate
> them or not.
> What do you think?
>
> Thierry
>
>
> 2009/7/7 Stefan Malmesjö <s....@gmail.com>
>
>> I just realized that maybe you need to extend your validators, too, at
>> least if you want your modelobject to be updated. And how you do that on a
>> textfield that is required, I don't really know.
>>
>> Maybe that path is too complicated.
>>
>> /Stefan
>>
>> On 2009-07-06 22:55, Stefan Malmesjö wrote:
>>
>>> Could setting visibility for the FeedbackPanel to false until the form has
>>> been "properly" submitted with a press of a submit button work?
>>>
>>> /Stefan
>>>
>>> On Mon, Jul 6, 2009 at 8:42 PM, Thierry Leveque <tleveque@gmail.com<mailto:
>>> tleveque@gmail.com>> wrote:
>>>
>>>    Any following on that?
>>>
>>>    Daniel, have you been able to solve your problem? Did you wrote
>>>    your own
>>>    behavior?
>>>
>>>    I have the same requirement as you and I am trying to find a quick
>>>    way to
>>>    solve my problem.
>>>
>>>    Can someone point me to some examples on how to write my own Ajax
>>>    behavior?
>>>
>>>    Thanks
>>>
>>>    Thierry
>>>
>>>
>>>    On Tue, Jun 2, 2009 at 12:21, Igor Vaynberg
>>>    <igor.vaynberg@gmail.com <ma...@gmail.com>> wrote:
>>>
>>>    > well, if you do not want to *submit* the form then dont use
>>>    > ajaxformSUBMITbehavior :)
>>>    >
>>>    > with little work you can roll your own behavior that does a simple
>>>    > ajax get and appends whatever values you need from formcomponents to
>>>    > the url. that way the form is not submitted and you have access
>>>    to the
>>>    > raw values.
>>>    >
>>>    > -igor
>>>    >
>>>    >
>>>    >
>>>    > On Tue, Jun 2, 2009 at 9:16 AM, dfernandez
>>>    > <dfernandez@users.sourceforge.net
>>>    <ma...@users.sourceforge.net>> wrote:
>>>    > >
>>>    > >
>>>    > > Yes, I know it is tricky, but the fact is I don't think I
>>>    would really
>>>    > need
>>>    > > type conversion in this case.
>>>    > >
>>>    > > I will try to explain myself. I have the following UI:
>>>    > >
>>>    > >    |OPERATOR |V|
>>>    > >
>>>    > >    |INPUT1="aBc"        |     |INPUT2="DeF"          |
>>>    > >
>>>    > > ...being "OPERATOR" the DropDownChoice, and both INPUT1 and
>>>    INPUT2 two
>>>    > > TextFields (String TextFields, to be precise). Both INPUT1 and
>>>    INPUT2 are
>>>    > > required (when they are visible, of course).
>>>    > >
>>>    > > When I change the value on "OPERATOR", the UI will change,
>>>    hiding INPUT1
>>>    > and
>>>    > > INPUT2 but showing INPUT3, another TextField which should have
>>>    the same
>>>    > > contents that were on INPUT1 before:
>>>    > >
>>>    > >    |OPERATOR |V|
>>>    > >
>>>    > >    |INPUT3="aBc"        |
>>>    > >
>>>    > > The problem is that, when changing OPERATOR, I need to read
>>>    the value
>>>    > from
>>>    > > INPUT1 to set it into INPUT3, but if INPUT2 is empty I will
>>>    receive a
>>>    > > validation message telling me that it is required... which it
>>>    is, but I
>>>    > just
>>>    > > want Wicket to validate that when I want to *really* submit
>>>    the form, and
>>>    > > not now that I am only changing the operator.
>>>    > >
>>>    > > Thanks.
>>>    > >
>>>    > > Regards,
>>>    > > Daniel.
>>>    > >
>>>    > >
>>>    > >
>>>    > >
>>>    > >
>>>    > > igor.vaynberg wrote:
>>>    > >>
>>>    > >> how are you planning on reading the other values? you cannot
>>>    access
>>>    > >> the model so you will have to call getinput(), are you also
>>>    planning
>>>    > >> on doing type conversion yourself then?
>>>    > >>
>>>    > >> -igor
>>>    > >>
>>>    > >> 2009/6/2 Daniel Fernández <dfernandez@users.sourceforge.net
>>>    <ma...@users.sourceforge.net>>:
>>>
>>>    > >>> Hello,
>>>    > >>>
>>>    > >>> I have a form with a DropDownChoice, on which "onchange"
>>>    event I want
>>>    > to
>>>    > >>> update some form components. But I need to read data from
>>>    other fields
>>>    > of
>>>    > >>> the form for doing so, and so I added an
>>>    AjaxFormSubmitBehavior to the
>>>    > >>> DropDownChoice.
>>>    > >>>
>>>    > >>> My intention is to read the data from the drop down and from
>>>    the other
>>>    > >>> fields, and depending on these data, update some other
>>>    components...
>>>    > but
>>>    > >>> the
>>>    > >>> problem is that AjaxFormSubmitBehavior not only sends the
>>>    form data,
>>>    > but
>>>    > >>> also *validates it*, which I don't want (I don't want validation
>>>    > messages
>>>    > >>> to
>>>    > >>> appear when changing the value of the drop down).
>>>    > >>>
>>>    > >>> If it where an AjaxButton I would be able to just
>>>    > >>> setDefaultFormProcessing(false), but I don't see anything
>>>    like that in
>>>    > >>> AjaxFormSubmitBehavior...
>>>    > >>>
>>>    > >>> Is there a way to do this?
>>>    > >>>
>>>    > >>> Regards,
>>>    > >>> Daniel.
>>>    > >>>
>>>    > >>
>>>    > >>
>>>    ---------------------------------------------------------------------
>>>    > >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>    <ma...@wicket.apache.org>
>>>    > >> For additional commands, e-mail: users-help@wicket.apache.org
>>>    <ma...@wicket.apache.org>
>>>    > >>
>>>    > >>
>>>    > >>
>>>    > >
>>>    > > --
>>>    > > View this message in context:
>>>    >
>>>
>>> http://www.nabble.com/Can-I-make-AjaxFormSubmitBehavior-submit-raw-form-data-but-not--validate-it--tp23830542p23835836.html
>>>    > > Sent from the Wicket - User mailing list archive at Nabble.com.
>>>    > >
>>>    > >
>>>    > >
>>>    ---------------------------------------------------------------------
>>>    > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>    <ma...@wicket.apache.org>
>>>    > > For additional commands, e-mail: users-help@wicket.apache.org
>>>    <ma...@wicket.apache.org>
>>>    > >
>>>    > >
>>>    >
>>>    >
>>>    ---------------------------------------------------------------------
>>>    > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>    <ma...@wicket.apache.org>
>>>    > For additional commands, e-mail: users-help@wicket.apache.org
>>>    <ma...@wicket.apache.org>
>>>    >
>>>    >
>>>
>>>
>>>
>>
>

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


Re: Can I make AjaxFormSubmitBehavior submit raw form data but not validate it?

Posted by Thierry Leveque <tl...@gmail.com>.
Thanks, but I was not talking about using the submit behavior.

I was talking about the way to create my own ajax behavior to send the value
of multiple form fields.

I think this should be part of Wicket. It is not the first time I encounter
this problem. The first time, I found a workaround but this time I am stuck.
There should be a simple way to create an ajax behavior that will send the
values from the form components we want. Maybe with the option to validate
them or not.
What do you think?

Thierry


2009/7/7 Stefan Malmesjö <s....@gmail.com>

> I just realized that maybe you need to extend your validators, too, at
> least if you want your modelobject to be updated. And how you do that on a
> textfield that is required, I don't really know.
>
> Maybe that path is too complicated.
>
> /Stefan
>
> On 2009-07-06 22:55, Stefan Malmesjö wrote:
>
>> Could setting visibility for the FeedbackPanel to false until the form has
>> been "properly" submitted with a press of a submit button work?
>>
>> /Stefan
>>
>> On Mon, Jul 6, 2009 at 8:42 PM, Thierry Leveque <tleveque@gmail.com<mailto:
>> tleveque@gmail.com>> wrote:
>>
>>    Any following on that?
>>
>>    Daniel, have you been able to solve your problem? Did you wrote
>>    your own
>>    behavior?
>>
>>    I have the same requirement as you and I am trying to find a quick
>>    way to
>>    solve my problem.
>>
>>    Can someone point me to some examples on how to write my own Ajax
>>    behavior?
>>
>>    Thanks
>>
>>    Thierry
>>
>>
>>    On Tue, Jun 2, 2009 at 12:21, Igor Vaynberg
>>    <igor.vaynberg@gmail.com <ma...@gmail.com>> wrote:
>>
>>    > well, if you do not want to *submit* the form then dont use
>>    > ajaxformSUBMITbehavior :)
>>    >
>>    > with little work you can roll your own behavior that does a simple
>>    > ajax get and appends whatever values you need from formcomponents to
>>    > the url. that way the form is not submitted and you have access
>>    to the
>>    > raw values.
>>    >
>>    > -igor
>>    >
>>    >
>>    >
>>    > On Tue, Jun 2, 2009 at 9:16 AM, dfernandez
>>    > <dfernandez@users.sourceforge.net
>>    <ma...@users.sourceforge.net>> wrote:
>>    > >
>>    > >
>>    > > Yes, I know it is tricky, but the fact is I don't think I
>>    would really
>>    > need
>>    > > type conversion in this case.
>>    > >
>>    > > I will try to explain myself. I have the following UI:
>>    > >
>>    > >    |OPERATOR |V|
>>    > >
>>    > >    |INPUT1="aBc"        |     |INPUT2="DeF"          |
>>    > >
>>    > > ...being "OPERATOR" the DropDownChoice, and both INPUT1 and
>>    INPUT2 two
>>    > > TextFields (String TextFields, to be precise). Both INPUT1 and
>>    INPUT2 are
>>    > > required (when they are visible, of course).
>>    > >
>>    > > When I change the value on "OPERATOR", the UI will change,
>>    hiding INPUT1
>>    > and
>>    > > INPUT2 but showing INPUT3, another TextField which should have
>>    the same
>>    > > contents that were on INPUT1 before:
>>    > >
>>    > >    |OPERATOR |V|
>>    > >
>>    > >    |INPUT3="aBc"        |
>>    > >
>>    > > The problem is that, when changing OPERATOR, I need to read
>>    the value
>>    > from
>>    > > INPUT1 to set it into INPUT3, but if INPUT2 is empty I will
>>    receive a
>>    > > validation message telling me that it is required... which it
>>    is, but I
>>    > just
>>    > > want Wicket to validate that when I want to *really* submit
>>    the form, and
>>    > > not now that I am only changing the operator.
>>    > >
>>    > > Thanks.
>>    > >
>>    > > Regards,
>>    > > Daniel.
>>    > >
>>    > >
>>    > >
>>    > >
>>    > >
>>    > > igor.vaynberg wrote:
>>    > >>
>>    > >> how are you planning on reading the other values? you cannot
>>    access
>>    > >> the model so you will have to call getinput(), are you also
>>    planning
>>    > >> on doing type conversion yourself then?
>>    > >>
>>    > >> -igor
>>    > >>
>>    > >> 2009/6/2 Daniel Fernández <dfernandez@users.sourceforge.net
>>    <ma...@users.sourceforge.net>>:
>>
>>    > >>> Hello,
>>    > >>>
>>    > >>> I have a form with a DropDownChoice, on which "onchange"
>>    event I want
>>    > to
>>    > >>> update some form components. But I need to read data from
>>    other fields
>>    > of
>>    > >>> the form for doing so, and so I added an
>>    AjaxFormSubmitBehavior to the
>>    > >>> DropDownChoice.
>>    > >>>
>>    > >>> My intention is to read the data from the drop down and from
>>    the other
>>    > >>> fields, and depending on these data, update some other
>>    components...
>>    > but
>>    > >>> the
>>    > >>> problem is that AjaxFormSubmitBehavior not only sends the
>>    form data,
>>    > but
>>    > >>> also *validates it*, which I don't want (I don't want validation
>>    > messages
>>    > >>> to
>>    > >>> appear when changing the value of the drop down).
>>    > >>>
>>    > >>> If it where an AjaxButton I would be able to just
>>    > >>> setDefaultFormProcessing(false), but I don't see anything
>>    like that in
>>    > >>> AjaxFormSubmitBehavior...
>>    > >>>
>>    > >>> Is there a way to do this?
>>    > >>>
>>    > >>> Regards,
>>    > >>> Daniel.
>>    > >>>
>>    > >>
>>    > >>
>>    ---------------------------------------------------------------------
>>    > >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>    <ma...@wicket.apache.org>
>>    > >> For additional commands, e-mail: users-help@wicket.apache.org
>>    <ma...@wicket.apache.org>
>>    > >>
>>    > >>
>>    > >>
>>    > >
>>    > > --
>>    > > View this message in context:
>>    >
>>
>> http://www.nabble.com/Can-I-make-AjaxFormSubmitBehavior-submit-raw-form-data-but-not--validate-it--tp23830542p23835836.html
>>    > > Sent from the Wicket - User mailing list archive at Nabble.com.
>>    > >
>>    > >
>>    > >
>>    ---------------------------------------------------------------------
>>    > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>    <ma...@wicket.apache.org>
>>    > > For additional commands, e-mail: users-help@wicket.apache.org
>>    <ma...@wicket.apache.org>
>>    > >
>>    > >
>>    >
>>    >
>>    ---------------------------------------------------------------------
>>    > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>    <ma...@wicket.apache.org>
>>    > For additional commands, e-mail: users-help@wicket.apache.org
>>    <ma...@wicket.apache.org>
>>    >
>>    >
>>
>>
>>
>