Re: [Wicket-user] Using Javascript Effects Before An Ajax Call
We've ended up using jquery (http://jquery.com) for all of our projects here and it provides queueing very elegantly.$('#myElementId').hide('slow').show('slow');It might be worth looking into integrating. -jsOn 11/15/06, cygnusx2112 <[EMAIL PROTECTED]> wrote: I agree that this is a poor solution to a problem that should really besolved on the client. I am currently investigating the use of a queue toserialize effects around the replacement. http://wiki.script.aculo.us/scriptaculous/show/EffectQueueshttp://wiki.script.aculo.us/scriptaculous/show/EffectQueues-MT igor.vaynberg wrote:>> the big problem being that you pause the server thread. now instead of> 70ms> it takes what? 3000ms? all because of _javascript_ effects? it makes it easy> for someone to ddos your site, or at the least lower your throughput > significantly.>> this is a bad solution. the blocking needs to happen on the client side. i> am no _javascript_ guru either, but i would try to find a client side> solution.>> -igor >>> On 11/15/06, cygnusx2112 <[EMAIL PROTECTED]> wrote:>> Thanks for the clarification Igor. I ended up achieving the desired >> affect>> by>> using an AjaxCallDecarator in combination with a server side pause.>> Basically I was trying to do the following:1) Run animation effect on element >>2) Use Ajax request to replace element>>3) Run another animation effect on the element As you noticed, I needed a way to block so that #2 and #3 would not step>> on >> #1. As a non-_javascript_ guru I was unable to find a way to block the>> _javascript_ "thread" without some kind of CPU beating hack loop. However,>> the>> solution I am using seems to work well. In my efforts to accomplish this I have built some pretty interesting>> subclasses of AjaxEventBehavior that might be worth contributing. They>> basically allow you to cleanly add pre/post visual effects to components >> around an Ajax event. Regards, -MT>> igor.vaynberg wrote:>> >>> >>> > the effect is clearly executed asynchronously from the rest of the >> > _javascript_ "thread" so you need to find a way to block until the effect>> is>> > complete.>> >>> > -igor>> > -- >> View this message in context:>> http://www.nabble.com/Using-_javascript_-Effects-Before-An-Ajax-Call-tf2632663.html#a7359716 >> Sent from the Wicket - User mailing list archive at Nabble.com.>> - >> Take Surveys. Earn Cash. Influence the Future of IT>> Join SourceForge.net's Techsay panel and you'll get the chance to share>> your>> opinions on IT & business topics through brief surveys - and earn cash >> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV>> ___ >> Wicket-user mailing list>> Wicket-user@lists.sourceforge.net>> https://lists.sourceforge.net/lists/listinfo/wicket-user -> Take Surveys. Earn Cash. Influence the Future of IT> Join SourceForge.net's Techsay panel and you'll get the chance to share > your> opinions on IT & business topics through brief surveys - and earn cash> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > ___> Wicket-user mailing list> Wicket-user@lists.sourceforge.net> https://lists.sourceforge.net/lists/listinfo/wicket-user>>--View this message in context: http://www.nabble.com/Using-_javascript_-Effects-Before-An-Ajax-Call-tf2632663.html#a7360638Sent from the Wicket - User mailing list archive at Nabble.com.- Take Surveys. Earn Cash. Influence the Future of ITJoin SourceForge.net's Techsay panel and you'll get the chance to share youropinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___Wicket-user mailing listWicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Using Javascript Effects Before An Ajax Call
I think the best approach to this would be to add _javascript_ before the ajax call and add additional _javascript_ in the ajax callback function. This is a little tricky but can be done. Pausing the request on the server is definitely no the way to go. I haven't looked at what _javascript_ is generated but your function for your effect needs to block so the ajax request doesn't execute until it's finished... This is usually best accomplished through callbacks. function myFx(element, callback) { if (element.pixelHeight > 0) { element.height = element.pixelHeight - 5; setTimeout(function(){myFx(element, callback)}, 150); } else { callback(); }}function doAjax() { ajaxRequest... function: response(){ ... callMyFxFunction(); ... } ...}Content to be loaded by ajax when clicked That's a very crude example (code is not tested), but shows most all of the concepts.-jsOn 11/15/06, Igor Vaynberg < [EMAIL PROTECTED]> wrote:the big problem being that you pause the server thread. now instead of 70ms it takes what? 3000ms? all because of _javascript_ effects? it makes it easy for someone to ddos your site, or at the least lower your throughput significantly. this is a bad solution. the blocking needs to happen on the client side. i am no _javascript_ guru either, but i would try to find a client side solution.-igor On 11/15/06, cygnusx2112 <[EMAIL PROTECTED]> wrote: Thanks for the clarification Igor. I ended up achieving the desired affect byusing an AjaxCallDecarator in combination with a server side pause.Basically I was trying to do the following: 1) Run animation effect on element 2) Use Ajax request to replace element 3) Run another animation effect on the elementAs you noticed, I needed a way to block so that #2 and #3 would not step on#1. As a non-_javascript_ guru I was unable to find a way to block the _javascript_ "thread" without some kind of CPU beating hack loop. However, thesolution I am using seems to work well.In my efforts to accomplish this I have built some pretty interestingsubclasses of AjaxEventBehavior that might be worth contributing. They basically allow you to cleanly add pre/post visual effects to componentsaround an Ajax event.Regards,-MTigor.vaynberg wrote:>>> the effect is clearly executed asynchronously from the rest of the > _javascript_ "thread" so you need to find a way to block until the effect is> complete.>> -igor>--View this message in context: http://www.nabble.com/Using-_javascript_-Effects-Before-An-Ajax-Call-tf2632663.html#a7359716Sent from the Wicket - User mailing list archive at Nabble.com.- Take Surveys. Earn Cash. Influence the Future of ITJoin SourceForge.net's Techsay panel and you'll get the chance to share youropinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user -Take Surveys. Earn Cash. Influence the Future of ITJoin SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___Wicket-user mailing list Wicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Using Javascript Effects Before An Ajax Call
I agree that this is a poor solution to a problem that should really be solved on the client. I am currently investigating the use of a queue to serialize effects around the replacement. http://wiki.script.aculo.us/scriptaculous/show/EffectQueues http://wiki.script.aculo.us/scriptaculous/show/EffectQueues -MT igor.vaynberg wrote: > > the big problem being that you pause the server thread. now instead of > 70ms > it takes what? 3000ms? all because of javascript effects? it makes it easy > for someone to ddos your site, or at the least lower your throughput > significantly. > > this is a bad solution. the blocking needs to happen on the client side. i > am no javascript guru either, but i would try to find a client side > solution. > > -igor > > > On 11/15/06, cygnusx2112 <[EMAIL PROTECTED]> wrote: >> >> >> Thanks for the clarification Igor. I ended up achieving the desired >> affect >> by >> using an AjaxCallDecarator in combination with a server side pause. >> Basically I was trying to do the following: >> >>1) Run animation effect on element >>2) Use Ajax request to replace element >>3) Run another animation effect on the element >> >> As you noticed, I needed a way to block so that #2 and #3 would not step >> on >> #1. As a non-Javascript guru I was unable to find a way to block the >> Javascript "thread" without some kind of CPU beating hack loop. However, >> the >> solution I am using seems to work well. >> >> In my efforts to accomplish this I have built some pretty interesting >> subclasses of AjaxEventBehavior that might be worth contributing. They >> basically allow you to cleanly add pre/post visual effects to components >> around an Ajax event. >> >> Regards, >> >> -MT >> >> >> >> >> igor.vaynberg wrote: >> > >> > >> > the effect is clearly executed asynchronously from the rest of the >> > javascript "thread" so you need to find a way to block until the effect >> is >> > complete. >> > >> > -igor >> > >> >> -- >> View this message in context: >> http://www.nabble.com/Using-Javascript-Effects-Before-An-Ajax-Call-tf2632663.html#a7359716 >> Sent from the Wicket - User mailing list archive at Nabble.com. >> >> >> - >> Take Surveys. Earn Cash. Influence the Future of IT >> Join SourceForge.net's Techsay panel and you'll get the chance to share >> your >> opinions on IT & business topics through brief surveys - and earn cash >> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV >> ___ >> Wicket-user mailing list >> Wicket-user@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/wicket-user >> > > - > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > ___ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user > > -- View this message in context: http://www.nabble.com/Using-Javascript-Effects-Before-An-Ajax-Call-tf2632663.html#a7360638 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Using Javascript Effects Before An Ajax Call
the big problem being that you pause the server thread. now instead of 70ms it takes what? 3000ms? all because of _javascript_ effects? it makes it easy for someone to ddos your site, or at the least lower your throughput significantly. this is a bad solution. the blocking needs to happen on the client side. i am no _javascript_ guru either, but i would try to find a client side solution.-igorOn 11/15/06, cygnusx2112 <[EMAIL PROTECTED]> wrote: Thanks for the clarification Igor. I ended up achieving the desired affect byusing an AjaxCallDecarator in combination with a server side pause.Basically I was trying to do the following: 1) Run animation effect on element 2) Use Ajax request to replace element 3) Run another animation effect on the elementAs you noticed, I needed a way to block so that #2 and #3 would not step on#1. As a non-_javascript_ guru I was unable to find a way to block the _javascript_ "thread" without some kind of CPU beating hack loop. However, thesolution I am using seems to work well.In my efforts to accomplish this I have built some pretty interestingsubclasses of AjaxEventBehavior that might be worth contributing. They basically allow you to cleanly add pre/post visual effects to componentsaround an Ajax event.Regards,-MTigor.vaynberg wrote:>>> the effect is clearly executed asynchronously from the rest of the > _javascript_ "thread" so you need to find a way to block until the effect is> complete.>> -igor>--View this message in context: http://www.nabble.com/Using-_javascript_-Effects-Before-An-Ajax-Call-tf2632663.html#a7359716Sent from the Wicket - User mailing list archive at Nabble.com.- Take Surveys. Earn Cash. Influence the Future of ITJoin SourceForge.net's Techsay panel and you'll get the chance to share youropinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___Wicket-user mailing listWicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Using Javascript Effects Before An Ajax Call
Thanks for the clarification Igor. I ended up achieving the desired affect by using an AjaxCallDecarator in combination with a server side pause. Basically I was trying to do the following: 1) Run animation effect on element 2) Use Ajax request to replace element 3) Run another animation effect on the element As you noticed, I needed a way to block so that #2 and #3 would not step on #1. As a non-Javascript guru I was unable to find a way to block the Javascript "thread" without some kind of CPU beating hack loop. However, the solution I am using seems to work well. In my efforts to accomplish this I have built some pretty interesting subclasses of AjaxEventBehavior that might be worth contributing. They basically allow you to cleanly add pre/post visual effects to components around an Ajax event. Regards, -MT igor.vaynberg wrote: > > > the effect is clearly executed asynchronously from the rest of the > javascript "thread" so you need to find a way to block until the effect is > complete. > > -igor > -- View this message in context: http://www.nabble.com/Using-Javascript-Effects-Before-An-Ajax-Call-tf2632663.html#a7359716 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Using Javascript Effects Before An Ajax Call
why would this be a bug in wicket? looks to be clearly a bug in your code. the effect is clearly executed asynchronously from the rest of the _javascript_ "thread" so you need to find a way to block until the effect is complete. -igorOn 11/14/06, cygnusx2112 <[EMAIL PROTECTED]> wrote: I am using the AjaxRequestTarget.prependJavaScript method to apply an Effectto an element before it gets replaced by the Ajax call. The problem is thatthe Ajax replacement occurs before the animation code for the effect has a chance to complete, making the effect unnoticable. My event handler codelooks like this:protected void onEvent(final AjaxRequestTarget target){testLabel.setModelObject ("New Label Text");target.prependJavascript("new Effect.BlindUp('" +testLabel.getMarkupId() + "');");target.addComponent(testLabel);} Is this a bug or is there something I am missing?-MT--View this message in context: http://www.nabble.com/Using-_javascript_-Effects-Before-An-Ajax-Call-tf2632663.html#a7347878 Sent from the Wicket - User mailing list archive at Nabble.com.-Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share youropinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___Wicket-user mailing listWicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user