Example usage for org.apache.wicket.markup.html.image Image setMarkupId

List of usage examples for org.apache.wicket.markup.html.image Image setMarkupId

Introduction

In this page you can find the example usage for org.apache.wicket.markup.html.image Image setMarkupId.

Prototype

final void setMarkupId(Component comp) 

Source Link

Document

Copy markupId

Usage

From source file:org.hippoecm.frontend.plugins.console.editor.ToggleHeader.java

License:Apache License

/**
 * Creates a clickable header./*  w w  w  .ja  v a2 s.  com*/
 *
 * @param id the Wicket ID of this component
 * @param name the name of the header (used as a parameter in the toggleBox() javascript call)
 * @param text the text the display in the header
 */
public ToggleHeader(String id, String name, String text) {
    super(id);
    this.name = name;

    final Label textLabel = new Label("text", text);
    add(textLabel);

    final Image toggleImage = new Image("toggle-icon",
            new PackageResourceReference(ToggleHeader.class, "group-expanded.png"));
    toggleImage.setMarkupId("toggle-" + name);
    toggleImage.setOutputMarkupId(true);
    add(toggleImage);
}