You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by bglynn <bg...@machenergy.com> on 2011/06/18 01:35:31 UTC

callback versioning issue

I have a use case that requires a non-wicket client side ajax invoked on my
page. The client side request comes after a form submit has been made on the
model. For the client side ajax, I'm using a AbstractDefaultAjaxBehavior and
using it's getCallbackUrl to preform a wicketAjaxGet with additional
parameters to update my page model. Functionally, this is working, but the
page state is reset to the default model when the client side ajax is
invoked, as if its a new page request. What is required in order for the
non-wicket invoke to be aware of the latest page version? 

Thanks in advance!

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/callback-versioning-issue-tp3606799p3606799.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: Handle selection changing on Palette

Posted by Duy Do <do...@gmail.com>.
Hi Andrea,

It works now. Thanks for your help.

Cheers,
Duy

On 6/18/11 7:55 PM, Andrea Del Bene wrote:
> HI,
>
> have you tried with AjaxFormComponentUpdatingBehavior? As Palette's 
> JavaDoc says:
>
> " Ajaxifying the palette: The palette itself cannot be ajaxified 
> because it is a panel and therefore does not receive any javascript 
> events. Instead ajax behaviors can be attached to the recorder 
> component which supports the javascript onchange event. The behavior 
> should be attached by overriding newRecorderComponent() Example:
>
>   Form form=new Form(...);
>   Palette palette=new Palette(...) {
>     protected Recorder newRecorderComponent()
>     {
>       Recorder recorder=super.newRecorderComponent();
>       recorder.add(new AjaxFormComponentUpdatingBehavior("onchange") 
> {...});
>       return recorder;
>     }
>   } "
>
>> Hi Wicketers,
>>
>> How can I handle selection changing on Palette? I would like to save 
>> item into database once it is selected from "Available" list.
>>
>> Thanks,
>> Duy
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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: Handle selection changing on Palette

Posted by Andrea Del Bene <an...@libero.it>.
HI,

have you tried with AjaxFormComponentUpdatingBehavior? As Palette's 
JavaDoc says:

" Ajaxifying the palette: The palette itself cannot be ajaxified because 
it is a panel and therefore does not receive any javascript events. 
Instead ajax behaviors can be attached to the recorder component which 
supports the javascript onchange event. The behavior should be attached 
by overriding newRecorderComponent() Example:

   Form form=new Form(...);
   Palette palette=new Palette(...) {
     protected Recorder newRecorderComponent()
     {
       Recorder recorder=super.newRecorderComponent();
       recorder.add(new AjaxFormComponentUpdatingBehavior("onchange") 
{...});
       return recorder;
     }
   } "

> Hi Wicketers,
>
> How can I handle selection changing on Palette? I would like to save 
> item into database once it is selected from "Available" list.
>
> Thanks,
> Duy
>
>
>
>
>
> ---------------------------------------------------------------------
> 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


Handle selection changing on Palette

Posted by Duy Do <do...@gmail.com>.
Hi Wicketers,

How can I handle selection changing on Palette? I would like to save 
item into database once it is selected from "Available" list.

Thanks,
Duy





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


Re: callback versioning issue

Posted by kiranduba <ki...@gmail.com>.
Hi,
I'm facing the same issue in Wicket 6. Please let me know how you solved
this problem.

Thanks,
Kiran Duba



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/callback-versioning-issue-tp3606799p4661250.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: callback versioning issue

Posted by bglynn <bg...@machenergy.com>.
I ended up figuring out the issue. It appears that the callback url needs to
be updated on ever state change, otherwise it uses a old version of the
model object. 

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/callback-versioning-issue-tp3606799p3614693.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: callback versioning issue

Posted by Igor Vaynberg <ig...@gmail.com>.
You need to set a header, not a url param

-igor
On Jun 18, 2011 11:53 AM, "bglynn" <bg...@machenergy.com> wrote:
> Hi Igor,
>
> Thanks for getting back to me. Can you provide an example? I tried adding
> '&Wicket-Ajax=true to my wicketAjaxGet method, but still getting the same
> result.
>
> Many Thanks
>
> Brian
>
> --
> View this message in context:
http://apache-wicket.1842946.n4.nabble.com/callback-versioning-issue-tp3606799p3608020.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: callback versioning issue

Posted by bglynn <bg...@machenergy.com>.
Hi Igor,

Thanks for getting back to me. Can you provide an example? I tried adding
'&Wicket-Ajax=true to my wicketAjaxGet method, but still getting the same
result. 

Many Thanks

Brian

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/callback-versioning-issue-tp3606799p3608020.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: callback versioning issue

Posted by Igor Vaynberg <ig...@gmail.com>.
make sure your callback sets the Wicket-Ajax header so wicket knows
its an ajax request, otherwise it thinks you pressed refresh in the
browser.

-igor

On Fri, Jun 17, 2011 at 4:35 PM, bglynn <bg...@machenergy.com> wrote:
> I have a use case that requires a non-wicket client side ajax invoked on my
> page. The client side request comes after a form submit has been made on the
> model. For the client side ajax, I'm using a AbstractDefaultAjaxBehavior and
> using it's getCallbackUrl to preform a wicketAjaxGet with additional
> parameters to update my page model. Functionally, this is working, but the
> page state is reset to the default model when the client side ajax is
> invoked, as if its a new page request. What is required in order for the
> non-wicket invoke to be aware of the latest page version?
>
> Thanks in advance!
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/callback-versioning-issue-tp3606799p3606799.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
>
>

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