Re: [Wicket-user] Problem with javascript initialization order and header contributions
On 2/5/07, Erik van Oosten <[EMAIL PROTECTED]> wrote: Yes, I noticed and saw the code. Are functions in wicket-ajax.js not intended for public use? if you asked me i would say no. these are our internal javascript functions. what out of there were you using exactly? -igor - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Problem with javascript initialization order and header contributions
Al Maw wrote: > Unfortunately, wicket-ajax.js is rendered as a kind-of composite > HeaderContributor, so you can't just go like this: > add(HeaderContributor.forJavaScript(AbstractDefaultAjaxBehavior.JAVASCRIPT); > > ...as you'll get two of them. :-( > Yes, I noticed and saw the code. Are functions in wicket-ajax.js not intended for public use? > This may well work, actually, but it's not very nice. > We should probably get AbstractDefaultAjaxBehaviour to add its stuff as > proper HeaderContributors so that this works. > > Would you like to open a JIRA issue for this? I expect it affects both > 1.3 and 2.0, and won't be fixed for the 1.2.x branch. :-) > https://issues.apache.org/jira/browse/WICKET-256 >> Or, is there a way to run the initialization when all javascript has >> been loaded? >> > You can use the window.onload event and hook into that. If you're using > prototype, something like > I am not using prototype. I 'fixed' it with by hacking the onload attribute on one of my templates. Thanks Al, Erik. -- Erik van Oosten http://day-to-day-stuff.blogspot.com/ - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Problem with javascript initialization order and header contributions
Erik van Oosten wrote: > Is there a way to force header contributions to load in a certain order? Sort of. HeaderContributors are designed so that if you add them twice, they only render once (so you can have multiple components on the page share the same contributor). Unfortunately, wicket-ajax.js is rendered as a kind-of composite HeaderContributor, so you can't just go like this: add(HeaderContributor.forJavaScript(AbstractDefaultAjaxBehavior.JAVASCRIPT); ...as you'll get two of them. :-( This may well work, actually, but it's not very nice. We should probably get AbstractDefaultAjaxBehaviour to add its stuff as proper HeaderContributors so that this works. Would you like to open a JIRA issue for this? I expect it affects both 1.3 and 2.0, and won't be fixed for the 1.2.x branch. :-) > Or, is there a way to run the initialization when all javascript has > been loaded? You can use the window.onload event and hook into that. If you're using prototype, something like: Event.observe(window, "onload", function() { doStuff(); }); I doubt it'll fix your problem though. Regards, Al - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Problem with javascript initialization order and header contributions
Oh, and euh, I am using a Wicket pre-1.2.5 snapshot from 2007-01-23. Erik van Oosten wrote: > Hi, > > I have some javascript with initialization code that needs functions > from wicket-ajax.js. However, my javascript is loaded (and run) before > wicket-ajax.js. > > The javascript is added in a component as follows: > add(HeaderContributor.forJavaScript(this.getClass(), > "AutoLogout.js")); > > Is there a way to force header contributions to load in a certain order? > Or, is there a way to run the initialization when all javascript has > been loaded? > > The (old) thread > http://www.nabble.com/header-contribution-ordering-tf1768566.html did > not provide an answer. > > Regards, > Erik. > > > -- Erik van Oosten http://www.day-to-day-stuff.blogspot.com/ - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] Problem with javascript initialization order and header contributions
Hi, I have some javascript with initialization code that needs functions from wicket-ajax.js. However, my javascript is loaded (and run) before wicket-ajax.js. The javascript is added in a component as follows: add(HeaderContributor.forJavaScript(this.getClass(), "AutoLogout.js")); Is there a way to force header contributions to load in a certain order? Or, is there a way to run the initialization when all javascript has been loaded? The (old) thread http://www.nabble.com/header-contribution-ordering-tf1768566.html did not provide an answer. Regards, Erik. -- Erik van Oosten http://www.day-to-day-stuff.blogspot.com/ - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user