You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Rakesh A <ia...@rediffmail.com> on 2015/12/09 13:49:07 UTC

Wicket Ajax adding all form component values to request parameters

Hi,
We tried (upgrade from 6.20.0) Wicket 6.21.0, and observe a change in the
way Wicket ajax calls are made. Upon looking into it further, we see it due
to the fix for "https://issues.apache.org/jira/browse/WICKET-5948".

We've some custom Ajax behaviors added to a normal DOM elements (div) which
has as form in it, Ajax behavior is triggered on a custom event (like
click/drag mouse events on one of the child DOM elements).

With the fix for WICKET-5948, the above Ajax call is made after appending
all form field values to the Ajax request; in our case its quite a big form
with lot of fields, the Ajax behavior uses GET method, and all form fields
are getting added as url parameters, resulting a long GET url.

Because of this in some cases we even get a 400 bad request as a response
from our tomcat.

Is this usecase considered while fixing the above mentioned call ?
Is there a suggested way to avoid this behavior?

Regards,
Rakesh.A



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-Ajax-adding-all-form-component-values-to-request-parameters-tp4672911.html
Sent from the Users forum 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: Wicket Ajax adding all form component values to request parameters

Posted by Rakesh A <ia...@rediffmail.com>.
Created JIRA ticket: https://issues.apache.org/jira/browse/WICKET-6050

Regards,
Rakesh.A

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-Ajax-adding-all-form-component-values-to-request-parameters-tp4672911p4672968.html
Sent from the Users forum 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: Wicket Ajax adding all form component values to request parameters

Posted by Martin Grigorov <mg...@apache.org>.
Please create a ticket in JIRA.
Thanks!

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Mon, Dec 14, 2015 at 8:42 AM, Rakesh A <ia...@rediffmail.com>
wrote:

> Hi,
>
> I see in the fix for WICKET-6006, it is specific to ModalWindow
> implementation.
>
> Please find the attached quick start with the another usecase.
>
> WICKET-5948-2.7z
> <http://apache-wicket.1842946.n4.nabble.com/file/n4672966/WICKET-5948-2.7z
> >
>
> This is an update to earlier quickstart. Here I am trying to use JQuery
> UI's
> resizable behavior, use case is when resizing of a DOM element stops, I'd
> like to make an Ajax call by sending the new width back to server.
> On the home page I added a Panel with same two form feilds, to which an
> Ajax
> behavior is added to enable JQuery UI's resizable and the Ajax call when
> resizing stops - Try resizing the panel and check the network call.
>
> By adding Wicket.Form.excludeFromAjaxSerialization[markupId] = 'true'; it
> probably can be avoided, but this needs to be done to all behaviors that
> were written earlier (consider behaviors written for UI component
> integration - WiQuery, etc).
>
> This change in 6.21.0 has more impact I think.
>
> Regards,
> Rakesh.A
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Wicket-Ajax-adding-all-form-component-values-to-request-parameters-tp4672911p4672966.html
> Sent from the Users forum 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: Wicket Ajax adding all form component values to request parameters

Posted by Rakesh A <ia...@rediffmail.com>.
Hi,

I see in the fix for WICKET-6006, it is specific to ModalWindow
implementation. 

Please find the attached quick start with the another usecase.

WICKET-5948-2.7z
<http://apache-wicket.1842946.n4.nabble.com/file/n4672966/WICKET-5948-2.7z>  

This is an update to earlier quickstart. Here I am trying to use JQuery UI's
resizable behavior, use case is when resizing of a DOM element stops, I'd
like to make an Ajax call by sending the new width back to server.
On the home page I added a Panel with same two form feilds, to which an Ajax
behavior is added to enable JQuery UI's resizable and the Ajax call when
resizing stops - Try resizing the panel and check the network call.

By adding Wicket.Form.excludeFromAjaxSerialization[markupId] = 'true'; it
probably can be avoided, but this needs to be done to all behaviors that
were written earlier (consider behaviors written for UI component
integration - WiQuery, etc).

This change in 6.21.0 has more impact I think.

Regards,
Rakesh.A



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-Ajax-adding-all-form-component-values-to-request-parameters-tp4672911p4672966.html
Sent from the Users forum 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: Wicket Ajax adding all form component values to request parameters

Posted by Martin Grigorov <mg...@apache.org>.
https://issues.apache.org/jira/browse/WICKET-6006

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Sat, Dec 12, 2015 at 8:31 PM, Martin Grigorov <mg...@apache.org>
wrote:

> The problem is in ModalWindow#closeCurrent().
> #close() works well.
> I'll investigate further.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Fri, Dec 11, 2015 at 9:36 AM, Rakesh A <ia...@rediffmail.com>
> wrote:
>
>> Please find the attached quick start, which shows the mentioned behavior.
>>
>> WICKET-5948.7z
>> <http://apache-wicket.1842946.n4.nabble.com/file/n4672942/WICKET-5948.7z>
>>
>> After deploying
>> 1. Click on the link (on home page) to open modal dialog, with few form
>> fields in it.
>> 2. Click on the 'Ajax submit button' to submit form
>>
>> Check the network calls for Step#2 mentioned above.
>>
>> Regards,
>> Rakesh.A
>>
>> --
>> View this message in context:
>> http://apache-wicket.1842946.n4.nabble.com/Wicket-Ajax-adding-all-form-component-values-to-request-parameters-tp4672911p4672942.html
>> Sent from the Users forum 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: Wicket Ajax adding all form component values to request parameters

Posted by Martin Grigorov <mg...@apache.org>.
The problem is in ModalWindow#closeCurrent().
#close() works well.
I'll investigate further.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Fri, Dec 11, 2015 at 9:36 AM, Rakesh A <ia...@rediffmail.com>
wrote:

> Please find the attached quick start, which shows the mentioned behavior.
>
> WICKET-5948.7z
> <http://apache-wicket.1842946.n4.nabble.com/file/n4672942/WICKET-5948.7z>
>
> After deploying
> 1. Click on the link (on home page) to open modal dialog, with few form
> fields in it.
> 2. Click on the 'Ajax submit button' to submit form
>
> Check the network calls for Step#2 mentioned above.
>
> Regards,
> Rakesh.A
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Wicket-Ajax-adding-all-form-component-values-to-request-parameters-tp4672911p4672942.html
> Sent from the Users forum 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: Wicket Ajax adding all form component values to request parameters

Posted by Rakesh A <ia...@rediffmail.com>.
Please find the attached quick start, which shows the mentioned behavior.

WICKET-5948.7z
<http://apache-wicket.1842946.n4.nabble.com/file/n4672942/WICKET-5948.7z>  

After deploying
1. Click on the link (on home page) to open modal dialog, with few form
fields in it.
2. Click on the 'Ajax submit button' to submit form

Check the network calls for Step#2 mentioned above.

Regards,
Rakesh.A

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-Ajax-adding-all-form-component-values-to-request-parameters-tp4672911p4672942.html
Sent from the Users forum 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: Wicket Ajax adding all form component values to request parameters

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

Sorry, but it is still not clear to me.

On Thu, Dec 10, 2015 at 5:47 AM, Rakesh A <ia...@rediffmail.com>
wrote:

> One use-case is, we've a modal window with a form (with lot of form fields
> -
> 50 to 200 ) in it, dialog has 'Ok' button which, submits form field values
> using Wicket Ajax POST call.
> Modal window also has a 'onClose' Ajax callback. When I click on the 'Ok'
> button it results
> 1. POST call with all form feild values, in this case the
> "Wicket.Form.serializeElement(el)" call at line#656 of
> 'wicket-ajax-jquery.js', results empty array as the modal window DOM is
> empty.
>

The 'close' link triggers POST request ?!
Is this Wicket's ModalWindow or some custom Modal implementation?


> 2. GET call (dialog close callback - settings.onClose property of modal
> window), in this case "Wicket.Form.serializeElement(el)" call at line#656
> of
> 'wicket-ajax-jquery.js', results array with all form fields in the dialog;
> I
> see that the DOM for modal window gets changed before this call.
>

The 'close' link usually is something like "<a id="someId12">Close</a>",
i.e it doesn't wrap a <form> (or any form elements) and
thus has nothing to serialize.
It is interesting to me how this 'close' button looks like. Both its Java
code and HTML code.


>
> The second call in our case results a GET URL with all the form field
> values
> appended to URL, resulting a http status code 400 - bad request.
>
> Regards,
> Rakesh.A
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Wicket-Ajax-adding-all-form-component-values-to-request-parameters-tp4672911p4672916.html
> Sent from the Users forum 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: Wicket Ajax adding all form component values to request parameters

Posted by Rakesh A <ia...@rediffmail.com>.
One use-case is, we've a modal window with a form (with lot of form fields -
50 to 200 ) in it, dialog has 'Ok' button which, submits form field values
using Wicket Ajax POST call.
Modal window also has a 'onClose' Ajax callback. When I click on the 'Ok'
button it results
1. POST call with all form feild values, in this case the
"Wicket.Form.serializeElement(el)" call at line#656 of
'wicket-ajax-jquery.js', results empty array as the modal window DOM is
empty.
2. GET call (dialog close callback - settings.onClose property of modal
window), in this case "Wicket.Form.serializeElement(el)" call at line#656 of
'wicket-ajax-jquery.js', results array with all form fields in the dialog; I
see that the DOM for modal window gets changed before this call.

The second call in our case results a GET URL with all the form field values
appended to URL, resulting a http status code 400 - bad request.

Regards,
Rakesh.A

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-Ajax-adding-all-form-component-values-to-request-parameters-tp4672911p4672916.html
Sent from the Users forum 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: Wicket Ajax adding all form component values to request parameters

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

What is the purpose of your Ajax behavior ?
What kind of behavior it is and what JavaScript event it listens to ?

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Wed, Dec 9, 2015 at 1:49 PM, Rakesh A <ia...@rediffmail.com> wrote:

> Hi,
> We tried (upgrade from 6.20.0) Wicket 6.21.0, and observe a change in the
> way Wicket ajax calls are made. Upon looking into it further, we see it due
> to the fix for "https://issues.apache.org/jira/browse/WICKET-5948".
>
> We've some custom Ajax behaviors added to a normal DOM elements (div) which
> has as form in it, Ajax behavior is triggered on a custom event (like
> click/drag mouse events on one of the child DOM elements).
>
> With the fix for WICKET-5948, the above Ajax call is made after appending
> all form field values to the Ajax request; in our case its quite a big form
> with lot of fields, the Ajax behavior uses GET method, and all form fields
> are getting added as url parameters, resulting a long GET url.
>
> Because of this in some cases we even get a 400 bad request as a response
> from our tomcat.
>
> Is this usecase considered while fixing the above mentioned call ?
> Is there a suggested way to avoid this behavior?
>
> Regards,
> Rakesh.A
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Wicket-Ajax-adding-all-form-component-values-to-request-parameters-tp4672911.html
> Sent from the Users forum 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
>
>