You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Patrick Davids <pa...@nubologic.com> on 2014/04/23 15:01:19 UTC

Evaluating wickets ajax-response programatically

Hi all,

due to a very complex gui panel with many javascript we are using a 
quite pure AbstractAjaxBehavior.

I print out a callback url, I call it, and so on... and having an 
onRequest() what nearly does the same as AbstractAjaxDefaultBehaviors 
(just a bit different).
Its copy-paste, but I dont know how to solve it in a better way.

Everything looks good, so far...

BUT...
when I add some components to the AjaxRequestTarget, the client-side 
does not evaluate it.

So, I had another look at wicket javascripts and found a js method 
named, which is used on success:

self.processAjaxResponse(data, textStatus, jqXHR, data, textStatus);

"Hmm... should do what I want"...

So I put it in my manuall Ajax.Calling scripts as success function, but 
still nothing happens.


Is there any magic evaluating the ajax-responses?
Can someone give my an hint?

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


Re: Evaluating wickets ajax-response programatically

Posted by Martin Grigorov <mg...@apache.org>.
On Wed, Apr 23, 2014 at 4:37 PM, Patrick Davids <
patrick.davids@nubologic.com> wrote:

> Hi Ernesto,
>
> I read the url-member by script from an attribute, we prev. added via
> AttributeAppender.
>
>
> This is how I execute my ajax call:
> $.ajax({
>                                         url : url,
>                                         type : 'POST',
> .
> .
> .
>                                         success: function(data,
> textStatus, jqXHR){
>
> self.processAjaxResponse(data, textStatus, jqXHR, data, textStatus);
>

What is 'self' here ?



>                                         },
>                                         error: function() {
> alert("error"); }
>
>                                 });
>
> Patrick
>
> Am 23.04.2014 15:09, schrieb Ernesto Reinaldo Barreiro:
> > How do you "call" server side AJAX behavior?
> >
> >
> > On Wed, Apr 23, 2014 at 3:01 PM, Patrick Davids <
> > patrick.davids@nubologic.com> wrote:
> >
> >> Hi all,
> >>
> >> due to a very complex gui panel with many javascript we are using a
> >> quite pure AbstractAjaxBehavior.
> >>
> >> I print out a callback url, I call it, and so on... and having an
> >> onRequest() what nearly does the same as AbstractAjaxDefaultBehaviors
> >> (just a bit different).
> >> Its copy-paste, but I dont know how to solve it in a better way.
> >>
> >> Everything looks good, so far...
> >>
> >> BUT...
> >> when I add some components to the AjaxRequestTarget, the client-side
> >> does not evaluate it.
> >>
> >> So, I had another look at wicket javascripts and found a js method
> >> named, which is used on success:
> >>
> >> self.processAjaxResponse(data, textStatus, jqXHR, data, textStatus);
> >>
> >> "Hmm... should do what I want"...
> >>
> >> So I put it in my manuall Ajax.Calling scripts as success function, but
> >> still nothing happens.
> >>
> >>
> >> Is there any magic evaluating the ajax-responses?
> >> Can someone give my an hint?
> >>
> >> Thanx a lot
> >> Patrick
> >> ---------------------------------------------------------------------
> >> 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: Evaluating wickets ajax-response programatically

Posted by Patrick Davids <pa...@nubologic.com>.
Hi Ernesto,

I read the url-member by script from an attribute, we prev. added via 
AttributeAppender.


This is how I execute my ajax call:
$.ajax({
					url : url,
					type : 'POST',
.
.
.
					success: function(data, textStatus, jqXHR){
						self.processAjaxResponse(data, textStatus, jqXHR, data, textStatus);
					},
					error: function() { alert("error"); }
					
				});

Patrick

Am 23.04.2014 15:09, schrieb Ernesto Reinaldo Barreiro:
> How do you "call" server side AJAX behavior?
>
>
> On Wed, Apr 23, 2014 at 3:01 PM, Patrick Davids <
> patrick.davids@nubologic.com> wrote:
>
>> Hi all,
>>
>> due to a very complex gui panel with many javascript we are using a
>> quite pure AbstractAjaxBehavior.
>>
>> I print out a callback url, I call it, and so on... and having an
>> onRequest() what nearly does the same as AbstractAjaxDefaultBehaviors
>> (just a bit different).
>> Its copy-paste, but I dont know how to solve it in a better way.
>>
>> Everything looks good, so far...
>>
>> BUT...
>> when I add some components to the AjaxRequestTarget, the client-side
>> does not evaluate it.
>>
>> So, I had another look at wicket javascripts and found a js method
>> named, which is used on success:
>>
>> self.processAjaxResponse(data, textStatus, jqXHR, data, textStatus);
>>
>> "Hmm... should do what I want"...
>>
>> So I put it in my manuall Ajax.Calling scripts as success function, but
>> still nothing happens.
>>
>>
>> Is there any magic evaluating the ajax-responses?
>> Can someone give my an hint?
>>
>> Thanx a lot
>> Patrick
>> ---------------------------------------------------------------------
>> 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: Evaluating wickets ajax-response programatically

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
How do you "call" server side AJAX behavior?


On Wed, Apr 23, 2014 at 3:01 PM, Patrick Davids <
patrick.davids@nubologic.com> wrote:

> Hi all,
>
> due to a very complex gui panel with many javascript we are using a
> quite pure AbstractAjaxBehavior.
>
> I print out a callback url, I call it, and so on... and having an
> onRequest() what nearly does the same as AbstractAjaxDefaultBehaviors
> (just a bit different).
> Its copy-paste, but I dont know how to solve it in a better way.
>
> Everything looks good, so far...
>
> BUT...
> when I add some components to the AjaxRequestTarget, the client-side
> does not evaluate it.
>
> So, I had another look at wicket javascripts and found a js method
> named, which is used on success:
>
> self.processAjaxResponse(data, textStatus, jqXHR, data, textStatus);
>
> "Hmm... should do what I want"...
>
> So I put it in my manuall Ajax.Calling scripts as success function, but
> still nothing happens.
>
>
> Is there any magic evaluating the ajax-responses?
> Can someone give my an hint?
>
> Thanx a lot
> Patrick
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Regards - Ernesto Reinaldo Barreiro

SOLVED / Re: Evaluating wickets ajax-response programatically

Posted by Patrick Davids <pa...@nubologic.com>.
Martin, you made my day.

Thank you very much!
Patrick
P.s. concerning your other mail...
"self" member... dont really know, but does not lead into any script 
errors, so I thought it might be correct. Was just a try... ;-)

Am 23.04.2014 15:19, schrieb Martin Grigorov:
> Hi,
>
> See
> https://github.com/apache/wicket/blob/master/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/jquery.wicketatmosphere.js#L31
>
> Martin Grigorov
> Wicket Training and Consulting
>
>
> On Wed, Apr 23, 2014 at 4:01 PM, Patrick Davids <
> patrick.davids@nubologic.com> wrote:
>
>> Hi all,
>>
>> due to a very complex gui panel with many javascript we are using a
>> quite pure AbstractAjaxBehavior.
>>
>> I print out a callback url, I call it, and so on... and having an
>> onRequest() what nearly does the same as AbstractAjaxDefaultBehaviors
>> (just a bit different).
>> Its copy-paste, but I dont know how to solve it in a better way.
>>
>> Everything looks good, so far...
>>
>> BUT...
>> when I add some components to the AjaxRequestTarget, the client-side
>> does not evaluate it.
>>
>> So, I had another look at wicket javascripts and found a js method
>> named, which is used on success:
>>
>> self.processAjaxResponse(data, textStatus, jqXHR, data, textStatus);
>>
>> "Hmm... should do what I want"...
>>
>> So I put it in my manuall Ajax.Calling scripts as success function, but
>> still nothing happens.
>>
>>
>> Is there any magic evaluating the ajax-responses?
>> Can someone give my an hint?
>>
>> Thanx a lot
>> Patrick
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>

-- 
Mit freundlichen Grüßen,

Patrick Davids

nuboLOGIC GmbH & Co. KG
Kieler Str. 103-107 • 25474 Bönningstedt

Tel.: +49 40 228539 732
Email: patrick.davids@nubologic.com

http://www.nubologic.com

Handelsregister: HRA6819 Pi  | Amtsgericht Pinneberg

Geschäftsführung der Verwaltungsgesellschaft
Daniel Fraga Zander

HRB10145Pi | Amtsgericht Pinneberg

Re: Evaluating wickets ajax-response programatically

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

See
https://github.com/apache/wicket/blob/master/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/jquery.wicketatmosphere.js#L31

Martin Grigorov
Wicket Training and Consulting


On Wed, Apr 23, 2014 at 4:01 PM, Patrick Davids <
patrick.davids@nubologic.com> wrote:

> Hi all,
>
> due to a very complex gui panel with many javascript we are using a
> quite pure AbstractAjaxBehavior.
>
> I print out a callback url, I call it, and so on... and having an
> onRequest() what nearly does the same as AbstractAjaxDefaultBehaviors
> (just a bit different).
> Its copy-paste, but I dont know how to solve it in a better way.
>
> Everything looks good, so far...
>
> BUT...
> when I add some components to the AjaxRequestTarget, the client-side
> does not evaluate it.
>
> So, I had another look at wicket javascripts and found a js method
> named, which is used on success:
>
> self.processAjaxResponse(data, textStatus, jqXHR, data, textStatus);
>
> "Hmm... should do what I want"...
>
> So I put it in my manuall Ajax.Calling scripts as success function, but
> still nothing happens.
>
>
> Is there any magic evaluating the ajax-responses?
> Can someone give my an hint?
>
> Thanx a lot
> Patrick
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>