You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by John Krasnay <jo...@krasnay.ca> on 2008/09/25 21:04:32 UTC

Hooking AJAX requests

Hi folks,

I'm trying to integrate the Dean Edwards IE7.js script
(http://dean.edwards.name/IE7/) into my Wicket app. For those that don't
know, IE7.js helps IE6 implement certain CSS rules that it doesn't
support natively (min-height, :first-child, :hover, ...)

I've created a behavior that renders the proper header text to load
IE7.js. I add this behavior to my base page class and everything works
will until I do an AJAX operation. Any of the updated components lose
their IE7.js specialness.

Apparently, there's a script, ie7-recalc.js, that implements a recalc()
method I can call to clean up after AJAX updates. The problem is that
I'd like to have this script run after *any* AJAX update to my page
without tweaking the AjaxRequestTarget in each of my AJAX components.

Is there a way that my behavior, applied at page level, can hook any
AJAX call and inject JavaScript to call that recalc() method?

jk

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


Re: Hooking AJAX requests

Posted by Igor Vaynberg <ig...@gmail.com>.
good point, just dump that javascript out in your basepage

-igor

On Thu, Sep 25, 2008 at 12:07 PM, Matej Knopp <ma...@gmail.com> wrote:
> You can do it in javascript using
> Wicket.Ajax.registerPostCallHandler(yourhandler);
>
> -Matej
>
> On Thu, Sep 25, 2008 at 9:04 PM, John Krasnay <jo...@krasnay.ca> wrote:
>> Hi folks,
>>
>> I'm trying to integrate the Dean Edwards IE7.js script
>> (http://dean.edwards.name/IE7/) into my Wicket app. For those that don't
>> know, IE7.js helps IE6 implement certain CSS rules that it doesn't
>> support natively (min-height, :first-child, :hover, ...)
>>
>> I've created a behavior that renders the proper header text to load
>> IE7.js. I add this behavior to my base page class and everything works
>> will until I do an AJAX operation. Any of the updated components lose
>> their IE7.js specialness.
>>
>> Apparently, there's a script, ie7-recalc.js, that implements a recalc()
>> method I can call to clean up after AJAX updates. The problem is that
>> I'd like to have this script run after *any* AJAX update to my page
>> without tweaking the AjaxRequestTarget in each of my AJAX components.
>>
>> Is there a way that my behavior, applied at page level, can hook any
>> AJAX call and inject JavaScript to call that recalc() method?
>>
>> jk
>>
>> ---------------------------------------------------------------------
>> 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: Hooking AJAX requests

Posted by John Krasnay <jo...@krasnay.ca>.
Perfect! Works like a charm.

Thanks much.

jk

On Thu, Sep 25, 2008 at 09:07:26PM +0200, Matej Knopp wrote:
> You can do it in javascript using
> Wicket.Ajax.registerPostCallHandler(yourhandler);
> 
> -Matej
> 
> On Thu, Sep 25, 2008 at 9:04 PM, John Krasnay <jo...@krasnay.ca> wrote:
> > Hi folks,
> >
> > I'm trying to integrate the Dean Edwards IE7.js script
> > (http://dean.edwards.name/IE7/) into my Wicket app. For those that don't
> > know, IE7.js helps IE6 implement certain CSS rules that it doesn't
> > support natively (min-height, :first-child, :hover, ...)
> >
> > I've created a behavior that renders the proper header text to load
> > IE7.js. I add this behavior to my base page class and everything works
> > will until I do an AJAX operation. Any of the updated components lose
> > their IE7.js specialness.
> >
> > Apparently, there's a script, ie7-recalc.js, that implements a recalc()
> > method I can call to clean up after AJAX updates. The problem is that
> > I'd like to have this script run after *any* AJAX update to my page
> > without tweaking the AjaxRequestTarget in each of my AJAX components.
> >
> > Is there a way that my behavior, applied at page level, can hook any
> > AJAX call and inject JavaScript to call that recalc() method?
> >
> > jk
> >
> > ---------------------------------------------------------------------
> > 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: Hooking AJAX requests

Posted by Matej Knopp <ma...@gmail.com>.
You can do it in javascript using
Wicket.Ajax.registerPostCallHandler(yourhandler);

-Matej

On Thu, Sep 25, 2008 at 9:04 PM, John Krasnay <jo...@krasnay.ca> wrote:
> Hi folks,
>
> I'm trying to integrate the Dean Edwards IE7.js script
> (http://dean.edwards.name/IE7/) into my Wicket app. For those that don't
> know, IE7.js helps IE6 implement certain CSS rules that it doesn't
> support natively (min-height, :first-child, :hover, ...)
>
> I've created a behavior that renders the proper header text to load
> IE7.js. I add this behavior to my base page class and everything works
> will until I do an AJAX operation. Any of the updated components lose
> their IE7.js specialness.
>
> Apparently, there's a script, ie7-recalc.js, that implements a recalc()
> method I can call to clean up after AJAX updates. The problem is that
> I'd like to have this script run after *any* AJAX update to my page
> without tweaking the AjaxRequestTarget in each of my AJAX components.
>
> Is there a way that my behavior, applied at page level, can hook any
> AJAX call and inject JavaScript to call that recalc() method?
>
> jk
>
> ---------------------------------------------------------------------
> 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: Hooking AJAX requests

Posted by Igor Vaynberg <ig...@gmail.com>.
there is ajaxrequesttarget.addlistener() that can do what you want,
but you would have to add it every time. there is no global listeners
yet. feel free to add an rfe.

-igor

On Thu, Sep 25, 2008 at 12:04 PM, John Krasnay <jo...@krasnay.ca> wrote:
> Hi folks,
>
> I'm trying to integrate the Dean Edwards IE7.js script
> (http://dean.edwards.name/IE7/) into my Wicket app. For those that don't
> know, IE7.js helps IE6 implement certain CSS rules that it doesn't
> support natively (min-height, :first-child, :hover, ...)
>
> I've created a behavior that renders the proper header text to load
> IE7.js. I add this behavior to my base page class and everything works
> will until I do an AJAX operation. Any of the updated components lose
> their IE7.js specialness.
>
> Apparently, there's a script, ie7-recalc.js, that implements a recalc()
> method I can call to clean up after AJAX updates. The problem is that
> I'd like to have this script run after *any* AJAX update to my page
> without tweaking the AjaxRequestTarget in each of my AJAX components.
>
> Is there a way that my behavior, applied at page level, can hook any
> AJAX call and inject JavaScript to call that recalc() method?
>
> jk
>
> ---------------------------------------------------------------------
> 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: Hooking AJAX requests

Posted by Nino Saturnino Martinez Vazquez Wael <ni...@jayway.dk>.
None that I know of. And I think it's something Wicket are lacking... A 
way to control js behavior of ajax components from behaviors them selfs.

John Krasnay wrote:
> Hi folks,
>
> I'm trying to integrate the Dean Edwards IE7.js script
> (http://dean.edwards.name/IE7/) into my Wicket app. For those that don't
> know, IE7.js helps IE6 implement certain CSS rules that it doesn't
> support natively (min-height, :first-child, :hover, ...)
>
> I've created a behavior that renders the proper header text to load
> IE7.js. I add this behavior to my base page class and everything works
> will until I do an AJAX operation. Any of the updated components lose
> their IE7.js specialness.
>
> Apparently, there's a script, ie7-recalc.js, that implements a recalc()
> method I can call to clean up after AJAX updates. The problem is that
> I'd like to have this script run after *any* AJAX update to my page
> without tweaking the AjaxRequestTarget in each of my AJAX components.
>
> Is there a way that my behavior, applied at page level, can hook any
> AJAX call and inject JavaScript to call that recalc() method?
>
> jk
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>   

-- 
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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