Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Code Block
add(new JavaScriptReference("addEventJs",
			new ResourceReference(IndexYourClass.class, "javascript/addEvent.js")));
add(new JavaScriptReference("sweetTitlesJs",
			new ResourceReference(IndexYourClass.class, "javascript/sweetTitles.js")));

Alternatively, you can just add these 2 lines to your Wicket's Panel or WebPage without touching the HTML i.e. skip Step 6,

Code Block

// for Wicket 1.4
add(JavascriptPackageResource.getHeaderContribution("javascript/addEvent.js"));
add(JavascriptPackageResource.getHeaderContribution("javascript/sweetTitles.js"));

// for Wicket 1.3.x
add(HeaderContributor.forJavaScript("javascript/addEvent.js"));
add(HeaderContributor.forJavaScript("javascript/sweetTitles.js"));

Step 8: Add the tooltip

Add the attribute "showtooltip" to the element that should show a tooltip (only elements with this attibute will show tooltips):

...

Code Block
someWicketComponent.add(new AttributeModifier("title", true, new Model("Hi, I am a dynamic tooltip.")));

Step 9a: Remove element's text from the tip

Change

Code Block
display:block

to

Code Block
display:none

in the CSS selector div#toolTip p em if you just want to show the text in the Model. Otherwise, the element's text will be appended to the tip.

Step 10: There is no step 10

...