[Wicket-user] add js-function to header only once?
We're developing Dojo FX which require some javascript to be added to the page. Our FX extend DojoAjaxHandler so we can make header contributions. Only problem now is an efficiency problem. Currently a +- 15 line javascript function is added to the page everytime an effect is added. I have rewritten this js function so that it is generic and only needed once. So if I were to add 5 FXOnClickWipers to my page, my renderHeadContribution() nicely adds 5 functions to the page's head. Currently, the functions are different, but hold a lot of redundant code. As I stated before, I have rewritten the javascript code to be rendered, so that the entire function only has to be rendered once, and every other FXOnClickWiper only has to render one extra line to the head. Is there a way that I can render the function once and then make a 1 line contribution to the page per effect? --- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] add js-function to header only once?
You can override renderHeadInitContribution. You need to call super too though, if you want dojo to keep working. Eelco On 10/31/05, Juergen Donnerstag [EMAIL PROTECTED] wrote: I don't know much about the AjaxHandler, but with markup (wicket:head) copying is done only once by default. May be you can take a look at the existing code. Juergen On 10/31/05, Marco van de Haar [EMAIL PROTECTED] wrote: We're developing Dojo FX which require some javascript to be added to the page. Our FX extend DojoAjaxHandler so we can make header contributions. Only problem now is an efficiency problem. Currently a +- 15 line javascript function is added to the page everytime an effect is added. I have rewritten this js function so that it is generic and only needed once. So if I were to add 5 FXOnClickWipers to my page, my renderHeadContribution() nicely adds 5 functions to the page's head. Currently, the functions are different, but hold a lot of redundant code. As I stated before, I have rewritten the javascript code to be rendered, so that the entire function only has to be rendered once, and every other FXOnClickWiper only has to render one extra line to the head. Is there a way that I can render the function once and then make a 1 line contribution to the page per effect? --- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user --- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user --- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] add js-function to header only once?
I saw an example of this in ImmediateCheckBox, but when I made an Immediate TextField I found that my function was not rendered. Is it not true that only the first component to be rendered with a DojoAjaxHandler will render it's renderHeadInitContribution? Because it sets the getImplementtationId() to DojoImpl. If you make multiple different Dojo Components (i.e. ImmediateTextfield and ImmediateCheckBox) on one page, only the first renderHeadInitContribution() is executed because they share the same implementation ID. So if I were to add a renderHeadInitContribution() to one of our dojo effects, and I would add it to my Page already containing another effect, or an ImmediateTextField, my contribution would not be made. Eelco Hillenius wrote: You can override renderHeadInitContribution. You need to call super too though, if you want dojo to keep working. Eelco On 10/31/05, Juergen Donnerstag [EMAIL PROTECTED] wrote: I don't know much about the AjaxHandler, but with markup (wicket:head) copying is done only once by default. May be you can take a look at the existing code. Juergen On 10/31/05, Marco van de Haar [EMAIL PROTECTED] wrote: We're developing Dojo FX which require some javascript to be added to the page. Our FX extend DojoAjaxHandler so we can make header contributions. Only problem now is an efficiency problem. Currently a +- 15 line javascript function is added to the page everytime an effect is added. I have rewritten this js function so that it is generic and only needed once. So if I were to add 5 FXOnClickWipers to my page, my renderHeadContribution() nicely adds 5 functions to the page's head. Currently, the functions are different, but hold a lot of redundant code. As I stated before, I have rewritten the javascript code to be rendered, so that the entire function only has to be rendered once, and every other FXOnClickWiper only has to render one extra line to the head. Is there a way that I can render the function once and then make a 1 line contribution to the page per effect? --- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user --- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user --- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user --- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user