TooltipBehavior with Wicket Component as content
Hover me to give you a multi line tip!
Hover me to give you a tip with an image!
Components / Samples
Description
This is a simple use of a TooltipBehavior
that uses a Wicket component as content.
Required markup & options
http://docs.telerik.com/kendo-ui/api/javascript/ui/tooltipSince
wicket-kendo-ui-6.20.0Licensing
Kendo UI "Core" is Apache License 2.0 licensed, starting from version 2014.1.416.Prior to version 2014.1.416, Kendo UI "Web" was licensed under GPLv3.
A pro version - with a commercial license - is also available, it provides additional widgets (see http://docs.telerik.com/kendo-ui/intro/supporting/list-of-widgets)
To be able to use it, you need to change the
ResourceReference
with kendo.all.min.js
See also
[howto]-change-resource-referencesSources
- Java
- HTML
- CSS
package com.googlecode.wicket.jquery.ui.samples.kendoui.tooltip; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.basic.MultiLineLabel; import org.apache.wicket.markup.html.panel.Panel; import com.googlecode.wicket.jquery.core.Options; import com.googlecode.wicket.kendo.ui.widget.tooltip.TooltipBehavior; public class ComponentKendoTooltipPage extends AbstractTooltipPage { private static final long serialVersionUID = 1L; public ComponentKendoTooltipPage() { // label 1 // final Label multiLineLabel = new Label("multilineLabel", "Hover me to give you a multi line tip!"); this.add(multiLineLabel); // tooltip 1 // MultiLineLabel tooltip1 = new MultiLineLabel("dummy1", "I am a tooltip\non several\nlines"); multiLineLabel.add(new TooltipBehavior(tooltip1)); // label 2 // final Label imageAndTextLabel = new Label("imageAndText", "Hover me to give you a tip with an image!"); this.add(imageAndTextLabel); // tooltip 2// ImageAndTextPanel tooltip2 = new ImageAndTextPanel("dummy2"); imageAndTextLabel.add(new TooltipBehavior(tooltip2, new Options("position", Options.asString("right")))); } private static class ImageAndTextPanel extends Panel { private static final long serialVersionUID = 1L; public ImageAndTextPanel(String id) { super(id); } } }
<!DOCTYPE html> <html xmlns:wicket="http://wicket.apache.org"> <head> <wicket:head> <title>Wicket Kendo UI: tooltip (component)</title> </wicket:head> </head> <body> <wicket:extend> <div id="demo-panel"> <p/> <p/> <span wicket:id="multilineLabel"></span> <p/> <p/> <span wicket:id="imageAndText"></span> <p/> <p/> </div> </wicket:extend> </body> </html>