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 PackageResourceReference(YourApplication.get(),
                                                          YourPage.class, 
                                                         
			new ResourceReference(YourClass.class, "javascript/addEvent.js")));
add(new JavaScriptReference("sweetTitlesJs", 
			new ResourceReference(YourClass.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                          new PackageResourceReference(YourApplication.get(),
                                                          YourPage.class,
                                                          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

...

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

...