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
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 10I hope this is helpful to somebody. Any improvements are very much encouraged, of course!
------------------------------------------------------------------------- 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 Wicketemail@example.com https://lists.sourceforge.net/lists/listinfo/wicket-user