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

add(new JavaScriptReference("addEventJs",
			new ResourceReference(Index.class, "javascript/addEvent.js")));
add(new JavaScriptReference("sweetTitlesJs",
			new ResourceReference(Index.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 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
<input type="checkbox" wicket:id="myCheckbox" title="Hi, I am a tooltip."/>

...or add dynamic tooltip texts using an AttributeModifier:

Code Block

someWicketComponent.add(new title=AttributeModifier("title", true, new Model("Hi, I am a dynamic tooltip."/>

...or add dynamic tooltip texts using an AttributeModifier:

...

)));

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

...