Example usage for org.apache.wicket.extensions.markup.html.repeater.tree AbstractTree setOutputMarkupId

List of usage examples for org.apache.wicket.extensions.markup.html.repeater.tree AbstractTree setOutputMarkupId

Introduction

In this page you can find the example usage for org.apache.wicket.extensions.markup.html.repeater.tree AbstractTree setOutputMarkupId.

Prototype

public final Component setOutputMarkupId(final boolean output) 

Source Link

Document

Sets whether or not component will output id attribute into the markup.

Usage

From source file:org.onehippo.forge.exdocpicker.impl.field.tree.ExternalTreeItemFieldBrowserDialog.java

License:Apache License

/**
 * {@inheritDoc}/*from w ww .  jav a 2 s.  com*/
 */
@Override
protected void initializeDataListView() {
    treeExpansionSet = new TreeItemExpansionSet();

    final int initialExpandDepth = getExternalDocumentServiceContext().getPluginConfig()
            .getAsInteger(PluginConstants.PARAM_INITIAL_TREE_EXPAND_DEPTH, 0);

    // Expand tree nodes to the initial depth level if configured.
    if (initialExpandDepth > 0) {
        for (Iterator<? extends Serializable> itemIt = getSearchedExternalDocuments().iterator(); itemIt
                .hasNext();) {
            expandExternalTreeItemNode(getExternalDocumentServiceFacade(), itemIt.next(), 0,
                    initialExpandDepth);
        }
    }

    // Expand parent tree nodes of currently selected items.
    expandPickedExternalTreeItemNodes(getExternalDocumentServiceFacade());

    treeDataProvider = new ExternalTreeItemDataProvider<>(getSearchedExternalDocuments(),
            getExternalDocumentServiceFacade());
    AbstractTree<Serializable> treeDataView = createTree(new Model(treeExpansionSet));
    treeDataView.setOutputMarkupId(true);

    treeDataView.add(new Behavior() {
        private static final long serialVersionUID = 1L;

        @Override
        public void onComponentTag(Component component, ComponentTag tag) {
            theme.onComponentTag(component, tag);
        }

        @Override
        public void renderHead(Component component, IHeaderResponse response) {
            theme.renderHead(component, response);
        }
    });

    add(treeDataView);
}