You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "Brown, Berlin [GCG-PFS]" <Be...@Primerica.com> on 2012/01/12 18:45:20 UTC

Serialize form for wicket ajax call

I was trying to understand the wicket serialize method call.
 
Does it serialize the entire form?  Does it serialize fields that are
NOT "blank"?
 
I noticed that sometimes post body content only contains the field that
I clicked on and then other times it looks like all of the elements on
the form are submitted.
 
Somtimes for the same onclick of a radio button:
 
Example Click1 (clicking on a radio button '<input
onclick="wicketAjaxPost...." />':
 
Body Content:
myRadioButton=1234
...
 
Example Click1 (clicking on the SAME radio button '<input
onclick="wicketAjaxPost...." />':
 
Body Content:
myRadioButton=1234
someOtherData=abc
someOtherData2=xyc
 
 
... Why would clicking on the same button generate different behavior,
submit different content?
 
Example wicket ajax post call on a radio button, onclick:

window.scrollTo( 0, 0 );
var wcall=wicketAjaxPost(
[PARM1]
'?wicket:interface=:2:contentPanelContainer....IBehaviorListener:0:-1'  
[PARM2],  wicketSerialize(Wicket.$('id307'))
[PARM3],  function() { hideWaitAndShadow( 'mainShadow' )}.bind(this)
[PARM4],  function() { hideWaitAndShadow( 'mainShadow' )}.bind(this)
[PARM5],  function() {return Wicket.$('id307') != null;}.bind(this));;
showWait(); 
">

My intent is to convert some wicketAjaxPost calls to wicketAjaxGet and
then serialize the data in the form and attach it to the URL (as a get
request) and I was trying to understand how the wicketAjaxPost works.

Re: Serialize form for wicket ajax call

Posted by Andrea Del Bene <an...@gmail.com>.
Hi,

have a look at function Wicket.Form.doSerialize inside wicket-ajax.js. 
Try to debug it with your browser.
> I was trying to understand the wicket serialize method call.
>
> Does it serialize the entire form?  Does it serialize fields that are
> NOT "blank"?
>
> I noticed that sometimes post body content only contains the field that
> I clicked on and then other times it looks like all of the elements on
> the form are submitted.
>
> Somtimes for the same onclick of a radio button:
>
> Example Click1 (clicking on a radio button '<input
> onclick="wicketAjaxPost...." />':
>
> Body Content:
> myRadioButton=1234
> ...
>
> Example Click1 (clicking on the SAME radio button '<input
> onclick="wicketAjaxPost...." />':
>
> Body Content:
> myRadioButton=1234
> someOtherData=abc
> someOtherData2=xyc
>
>
> ... Why would clicking on the same button generate different behavior,
> submit different content?
>
> Example wicket ajax post call on a radio button, onclick:
>
> window.scrollTo( 0, 0 );
> var wcall=wicketAjaxPost(
> [PARM1]
> '?wicket:interface=:2:contentPanelContainer....IBehaviorListener:0:-1'
> [PARM2],  wicketSerialize(Wicket.$('id307'))
> [PARM3],  function() { hideWaitAndShadow( 'mainShadow' )}.bind(this)
> [PARM4],  function() { hideWaitAndShadow( 'mainShadow' )}.bind(this)
> [PARM5],  function() {return Wicket.$('id307') != null;}.bind(this));;
> showWait();
> ">
>
> My intent is to convert some wicketAjaxPost calls to wicketAjaxGet and
> then serialize the data in the form and attach it to the URL (as a get
> request) and I was trying to understand how the wicketAjaxPost works.
>


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