Re: Problem with JavaScript when using Wicket AJAX Components
Sorry, it's onRendered in AbstractBehavior. -Matej On Dec 21, 2007 8:13 AM, thomas jaeckle [EMAIL PROTECTED] wrote: Matej Knopp-2 wrote: Try this (it's a bit hacky though): datatable.add(new AbstractBehavior() { public final void afterRender(final Component component) { AjaxRequestTaget target = AjaxRequestTarget.get(); if (target !- null) { target.appendJavascript(your javascript to initialize the tooltips); } } }); -Matej Overriding a final method? I try to find another place to put the appendJavascript .. Thanks so far. -- View this message in context: http://www.nabble.com/Problem-with-JavaScript-when-using-Wicket-AJAX-Components-tp14432037p14451288.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with JavaScript when using Wicket AJAX Components
I think I understand now, why the tooltips don't appear. The JavaScript is initialized when the Page is initialized. At this time the DataTable inside the AjaxLazyLoadPanel is not there. The JavaScript iterates over all elements I have specified ('input', 'td', 'tr', 'textarea', 'select', 'span', 'div', 'a','abbr','acronym') and adds events for them. But of course none of the DataTable - it is not there yet. But how do I specify that the JavaScript is again executed after the AjaxLazyLoadPanel has loaded the DataTable? regards Thomas -- View this message in context: http://www.nabble.com/Problem-with-JavaScript-when-using-Wicket-AJAX-Components-tp14432037p14438456.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with JavaScript when using Wicket AJAX Components
Try this (it's a bit hacky though): datatable.add(new AbstractBehavior() { public final void afterRender(final Component component) { AjaxRequestTaget target = AjaxRequestTarget.get(); if (target !- null) { target.appendJavascript(your javascript to initialize the tooltips); } } }); -Matej On Dec 20, 2007 4:33 PM, thomas jaeckle [EMAIL PROTECTED] wrote: I think I understand now, why the tooltips don't appear. The JavaScript is initialized when the Page is initialized. At this time the DataTable inside the AjaxLazyLoadPanel is not there. The JavaScript iterates over all elements I have specified ('input', 'td', 'tr', 'textarea', 'select', 'span', 'div', 'a','abbr','acronym') and adds events for them. But of course none of the DataTable - it is not there yet. But how do I specify that the JavaScript is again executed after the AjaxLazyLoadPanel has loaded the DataTable? regards Thomas -- View this message in context: http://www.nabble.com/Problem-with-JavaScript-when-using-Wicket-AJAX-Components-tp14432037p14438456.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem with JavaScript when using Wicket AJAX Components
Hi there. I wanted to implement Tooltips for my DataTable as described in the Wiki: http://cwiki.apache.org/WICKET/how-to-add-tooltips.html So in every page I want to use them I add this in the page constructor: add(HeaderContributor.forCss(AbstractBorder.class, resource/css/sweetTitles.css)); add(HeaderContributor.forJavaScript(AbstractBorder.class, resource/js/addEvent.js)); add(HeaderContributor.forJavaScript(AbstractBorder.class, resource/js/sweetTitles.js)); The sweetTitles tooltips are working if I add the DataTable directly to the page. But they are not working for the table when I use a AjaxLazyLoadPanel around the DataTable (for other Components on the Page that are outside the AjaxLazyLoadPanel they are still working). Or at another place I use a LinkTree and change a panel when it is clicked on a node. I also added the add(HeaderContributor stuff for the WebPage with the LinkTree, but in the Panels I can't use the sweetTitles tooltips. When I look at the generated HTML-Code the JavaScript-Files are always correctly in the header. But why are they not working? Any idea? Did I miss something? Thomas -- View this message in context: http://www.nabble.com/Problem-with-JavaScript-when-using-Wicket-AJAX-Components-tp14432037p14432037.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]