[Wicket-user] Tooltips: A short tutorial (without contrib-dojo, 1.2 compatible)
Hi! I've asked so many questions on this list and got so many friendly and helpful answers, it's time to give something back. This Saturday I migrated a big web application from Wicket 1.1.1 to 1.2.1. I was using the contrib-dojo Tooltip class, which doesn't work with 1.2, so I had to find another solution. I found Igor's suggestions for tooltips at http://del.icio.us/ivaynberg/tooltip and chose to go with Sweet Titles. Sweet titles is great, but the problem is that it automatically attaches tooltips to all a, abbr and acronym tags (correct me if I'm wrong, but I am sure about the a tag). I didn't want that, though. I needed tooltips for checkboxes, and I needed to explicitly say which element should show a tooltip and which element shouldn't. So I altered the sweetTitles.js a bit and this is what I came up with: 1) Download SweetTitles from http://www.dustindiaz.com/downloads/sweet-titles.zip 2) Replace sweetTitles.js with the one I attached to this email. 3) At the moment the replacement sweetTitles.js should be able to add tooltips to the following elements: 'input', 'td', 'tr', 'textarea', 'select', 'span', 'div', 'a','abbr','acronym'. If that's not enough (or too much), edit the tipElements array at the top of the file. 4) Put the 2 JavaScript files somewhere into your package (ie org.example.app.javascript) 5) Either put the CSS file into your package as well or add the contents to a CSS file you already use in your application 6) Add this to the head section of the html file you want to use tooltips in: wicket:link script wicket:id=addEventJs/script script wicket:id=sweetTitlesJs/script /wicket:link 7) Add the JavaScript resources to your page: add(new JavaScriptReference(addEventJs, new PackageResourceReference(YourApplication.get(), YourPage.class, javascript/addEvent.js))); add(new JavaScriptReference(sweetTitlesJs, new PackageResourceReference(YourApplication.get(), YourPage.class, javascript/sweetTitles.js))); 8) Add the Attribute showtooltip to the element that should show a tooltip (only elements with this attibute will show tooltips): someWicketComponent.add(new AttributeModifier(showtooltip, true, new Model(true))); 9) Either add the content of the tooltip to the element in the html file, using the title attribute: input type=checkbox wicket:id=myCheckbox title=Hi, I am a tooltip./ ...or add dynamic tooltip texts using an AttributeModifier: someWicketComponent.add(new AttributeModifier(title, true, new Model(Hi, I am a dynamic tooltip.))); 10) There is no step 10 I hope this is helpful to somebody. Any improvements are very much encouraged, of course! - Johannes sweetTitles.js Description: JavaScript source - 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=lnkkid=120709bid=263057dat=121642___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Tooltips: A short tutorial (without contrib-dojo, 1.2 compatible)
10) There is no step 10 How about Document it on the Wiki! :-) /Gwyn On 08/08/06, Johannes Fahrenkrug [EMAIL PROTECTED] wrote: Hi! I've asked so many questions on this list and got so many friendly and helpful answers, it's time to give something back. This Saturday I migrated a big web application from Wicket 1.1.1 to 1.2.1. I was using the contrib-dojo Tooltip class, which doesn't work with 1.2, so I had to find another solution. I found Igor's suggestions for tooltips at http://del.icio.us/ivaynberg/tooltip and chose to go with Sweet Titles. Sweet titles is great, but the problem is that it automatically attaches tooltips to all a, abbr and acronym tags (correct me if I'm wrong, but I am sure about the a tag). I didn't want that, though. I needed tooltips for checkboxes, and I needed to explicitly say which element should show a tooltip and which element shouldn't. So I altered the sweetTitles.js a bit and this is what I came up with: 1) Download SweetTitles from http://www.dustindiaz.com/downloads/sweet-titles.zip 2) Replace sweetTitles.js with the one I attached to this email. 3) At the moment the replacement sweetTitles.js should be able to add tooltips to the following elements: 'input', 'td', 'tr', 'textarea', 'select', 'span', 'div', 'a','abbr','acronym'. If that's not enough (or too much), edit the tipElements array at the top of the file. 4) Put the 2 JavaScript files somewhere into your package (ie org.example.app.javascript) 5) Either put the CSS file into your package as well or add the contents to a CSS file you already use in your application 6) Add this to the head section of the html file you want to use tooltips in: wicket:link script wicket:id=addEventJs/script script wicket:id=sweetTitlesJs/script /wicket:link 7) Add the JavaScript resources to your page: add(new JavaScriptReference(addEventJs, new PackageResourceReference(YourApplication.get(), YourPage.class, javascript/addEvent.js))); add(new JavaScriptReference(sweetTitlesJs, new PackageResourceReference(YourApplication.get(), YourPage.class, javascript/sweetTitles.js))); 8) Add the Attribute showtooltip to the element that should show a tooltip (only elements with this attibute will show tooltips): someWicketComponent.add(new AttributeModifier(showtooltip, true, new Model(true))); 9) Either add the content of the tooltip to the element in the html file, using the title attribute: input type=checkbox wicket:id=myCheckbox title=Hi, I am a tooltip./ ...or add dynamic tooltip texts using an AttributeModifier: someWicketComponent.add(new AttributeModifier(title, true, new Model(Hi, I am a dynamic tooltip.))); 10) There is no step 10 I hope this is helpful to somebody. Any improvements are very much encouraged, of course! - Johannes - 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=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user -- Download Wicket 1.2.1 now! - http://wicketframework.org - 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=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Tooltips: A short tutorial (without contrib-dojo, 1.2 compatible)
Gwyn Evans wrote: 10) There is no step 10 11) Agree to suggestion in step 10 and do it :) I'll do that right now. How about Document it on the Wiki! :-) /Gwyn On 08/08/06, Johannes Fahrenkrug [EMAIL PROTECTED] wrote: Hi! I've asked so many questions on this list and got so many friendly and helpful answers, it's time to give something back. This Saturday I migrated a big web application from Wicket 1.1.1 to 1.2.1. I was using the contrib-dojo Tooltip class, which doesn't work with 1.2, so I had to find another solution. I found Igor's suggestions for tooltips at http://del.icio.us/ivaynberg/tooltip and chose to go with Sweet Titles. Sweet titles is great, but the problem is that it automatically attaches tooltips to all a, abbr and acronym tags (correct me if I'm wrong, but I am sure about the a tag). I didn't want that, though. I needed tooltips for checkboxes, and I needed to explicitly say which element should show a tooltip and which element shouldn't. So I altered the sweetTitles.js a bit and this is what I came up with: 1) Download SweetTitles from http://www.dustindiaz.com/downloads/sweet-titles.zip 2) Replace sweetTitles.js with the one I attached to this email. 3) At the moment the replacement sweetTitles.js should be able to add tooltips to the following elements: 'input', 'td', 'tr', 'textarea', 'select', 'span', 'div', 'a','abbr','acronym'. If that's not enough (or too much), edit the tipElements array at the top of the file. 4) Put the 2 JavaScript files somewhere into your package (ie org.example.app.javascript) 5) Either put the CSS file into your package as well or add the contents to a CSS file you already use in your application 6) Add this to the head section of the html file you want to use tooltips in: wicket:link script wicket:id=addEventJs/script script wicket:id=sweetTitlesJs/script /wicket:link 7) Add the JavaScript resources to your page: add(new JavaScriptReference(addEventJs, new PackageResourceReference(YourApplication.get(), YourPage.class, javascript/addEvent.js))); add(new JavaScriptReference(sweetTitlesJs, new PackageResourceReference(YourApplication.get(), YourPage.class, javascript/sweetTitles.js))); 8) Add the Attribute showtooltip to the element that should show a tooltip (only elements with this attibute will show tooltips): someWicketComponent.add(new AttributeModifier(showtooltip, true, new Model(true))); 9) Either add the content of the tooltip to the element in the html file, using the title attribute: input type=checkbox wicket:id=myCheckbox title=Hi, I am a tooltip./ ...or add dynamic tooltip texts using an AttributeModifier: someWicketComponent.add(new AttributeModifier(title, true, new Model(Hi, I am a dynamic tooltip.))); 10) There is no step 10 I hope this is helpful to somebody. Any improvements are very much encouraged, of course! - Johannes - 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=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - 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=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Tooltips: A short tutorial (without contrib-dojo, 1.2 compatible)
Ok, I added the guide to the wiki: http://www.wicket-wiki.org.uk/wiki/index.php/How_to_add_tooltips Enjoy! - Johannes Johannes Fahrenkrug wrote: Gwyn Evans wrote: 10) There is no step 10 11) Agree to suggestion in step 10 and do it :) I'll do that right now. How about Document it on the Wiki! :-) /Gwyn On 08/08/06, Johannes Fahrenkrug [EMAIL PROTECTED] wrote: Hi! I've asked so many questions on this list and got so many friendly and helpful answers, it's time to give something back. This Saturday I migrated a big web application from Wicket 1.1.1 to 1.2.1. I was using the contrib-dojo Tooltip class, which doesn't work with 1.2, so I had to find another solution. I found Igor's suggestions for tooltips at http://del.icio.us/ivaynberg/tooltip and chose to go with Sweet Titles. Sweet titles is great, but the problem is that it automatically attaches tooltips to all a, abbr and acronym tags (correct me if I'm wrong, but I am sure about the a tag). I didn't want that, though. I needed tooltips for checkboxes, and I needed to explicitly say which element should show a tooltip and which element shouldn't. So I altered the sweetTitles.js a bit and this is what I came up with: 1) Download SweetTitles from http://www.dustindiaz.com/downloads/sweet-titles.zip 2) Replace sweetTitles.js with the one I attached to this email. 3) At the moment the replacement sweetTitles.js should be able to add tooltips to the following elements: 'input', 'td', 'tr', 'textarea', 'select', 'span', 'div', 'a','abbr','acronym'. If that's not enough (or too much), edit the tipElements array at the top of the file. 4) Put the 2 JavaScript files somewhere into your package (ie org.example.app.javascript) 5) Either put the CSS file into your package as well or add the contents to a CSS file you already use in your application 6) Add this to the head section of the html file you want to use tooltips in: wicket:link script wicket:id=addEventJs/script script wicket:id=sweetTitlesJs/script /wicket:link 7) Add the JavaScript resources to your page: add(new JavaScriptReference(addEventJs, new PackageResourceReference(YourApplication.get(), YourPage.class, javascript/addEvent.js))); add(new JavaScriptReference(sweetTitlesJs, new PackageResourceReference(YourApplication.get(), YourPage.class, javascript/sweetTitles.js))); 8) Add the Attribute showtooltip to the element that should show a tooltip (only elements with this attibute will show tooltips): someWicketComponent.add(new AttributeModifier(showtooltip, true, new Model(true))); 9) Either add the content of the tooltip to the element in the html file, using the title attribute: input type=checkbox wicket:id=myCheckbox title=Hi, I am a tooltip./ ...or add dynamic tooltip texts using an AttributeModifier: someWicketComponent.add(new AttributeModifier(title, true, new Model(Hi, I am a dynamic tooltip.))); 10) There is no step 10 I hope this is helpful to somebody. Any improvements are very much encouraged, of course! - Johannes - 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=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - 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=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - 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=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Tooltips: A short tutorial (without contrib-dojo, 1.2 compatible)
thank you-IgorOn 8/8/06, Johannes Fahrenkrug [EMAIL PROTECTED] wrote: Ok, I added the guide to the wiki:http://www.wicket-wiki.org.uk/wiki/index.php/How_to_add_tooltipsEnjoy!- Johannes Johannes Fahrenkrug wrote:Gwyn Evans wrote:10) There is no step 1011) Agree to suggestion in step 10 and do it :) I'll do that right now.How about Document it on the Wiki! :-)/GwynOn 08/08/06, Johannes Fahrenkrug [EMAIL PROTECTED] wrote:Hi!I've asked so many questions on this list and got so many friendly andhelpful answers, it's time to give something back. This Saturday I migrated a big web application from Wicket 1.1.1 to1.2.1. I was using the contrib-dojo Tooltip class, which doesn't workwith 1.2, so I had to find another solution. I found Igor's suggestions for tooltips at http://del.icio.us/ivaynberg/tooltip and chose to gowith Sweet Titles.Sweet titles is great, but the problem is that it automatically attaches tooltips to all a, abbr and acronym tags (correct me if I'm wrong,but I am sure about the a tag). I didn't want that, though. I neededtooltips for checkboxes, and I needed to explicitly say which element should show a tooltip and which element shouldn't. So I altered thesweetTitles.js a bit and this is what I came up with:1) Download SweetTitles from http://www.dustindiaz.com/downloads/sweet-titles.zip2) Replace sweetTitles.js with the one I attached to this email.3) At the moment the replacement sweetTitles.js should be able to addtooltips to the following elements: 'input', 'td', 'tr', 'textarea','select', 'span', 'div', 'a','abbr','acronym'. If that's not enough (ortoo much), edit the tipElements array at the top of the file. 4) Put the 2 _javascript_ files somewhere into your package (ieorg.example.app._javascript_)5) Either put the CSS file into your package as well or add the contentsto a CSS file you already use in your application 6) Add this to the head section of the html file you want to usetooltips in:wicket:link script wicket:id=addEventJs/script script wicket:id=sweetTitlesJs/script/wicket:link7) Add the _javascript_ resources to your page:add(new _javascript_Reference(addEventJs, new PackageResourceReference(YourApplication.get(), YourPage.class,_javascript_/addEvent.js)));add(new _javascript_Reference(sweetTitlesJs, newPackageResourceReference( YourApplication.get(), YourPage.class,_javascript_/sweetTitles.js)));8) Add the Attribute showtooltip to the element that should show atooltip (only elements with this attibute will show tooltips): someWicketComponent.add(new AttributeModifier(showtooltip, true, newModel(true)));9) Either add the content of the tooltip to the element in the html file, using the title attribute:input type=checkbox wicket:id=myCheckbox title=Hi, I am a tooltip./ ...or add dynamic tooltip texts using an AttributeModifier:someWicketComponent.add(new AttributeModifier(title, true, newModel(Hi, I am a dynamic tooltip.))); 10) There is no step 10I hope this is helpful to somebody. Any improvements are very muchencouraged, of course!- Johannes -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 easierDownload IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___Wicket-user mailing list Wicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user - 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 easierDownload IBM WebSphere Application Server v.1.0.1 based on Apache Geronimohttp://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___ Wicket-user mailing listWicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user -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 Geronimohttp://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___Wicket-user mailing listWicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - 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