Java Code Examples for org.apache.wicket.markup.html.list.ListView#setOutputMarkupPlaceholderTag()

The following examples show how to use org.apache.wicket.markup.html.list.ListView#setOutputMarkupPlaceholderTag() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: Orienteer   File: FilterPanel.java    License: Apache License 2.0 6 votes vote down vote up
private void addFilterPanels(WebMarkupContainer container, List<AbstractFilterPanel<?, ?>> panels, final List<FilterTab> tabs) {
    ListView<AbstractFilterPanel<?, ?>> listView = new ListView<AbstractFilterPanel<?, ?>>("filterPanels", panels) {
        private boolean first = true;
        @Override
        protected void populateItem(ListItem<AbstractFilterPanel<?, ?>> item) {
            if (first) {
                first = false;
                item.add(AttributeModifier.append("class", TAB_PANE_ACTIVE));
            } else item.add(AttributeModifier.append("class", TAB_PANE));
            item.add(AttributeModifier.append("class", FILTER_WIDTH));
            AbstractFilterPanel panel = item.getModelObject();
            for (FilterTab tab : tabs) {
                if (tab.getType().equals(panel.getFilterCriteriaType())) {
                    tab.setTabId(item.getMarkupId());
                    break;
                }
            }
            item.add(panel);
        }
    };
    listView.setOutputMarkupPlaceholderTag(true);
    listView.setReuseItems(true);
    container.add(listView);
}
 
Example 2
Source Project: Orienteer   File: FilterPanel.java    License: Apache License 2.0 6 votes vote down vote up
private void addFilterSwitches(WebMarkupContainer container, List<FilterTab> switches) {
    ListView<FilterTab> listView = new ListView<FilterTab>("panelSwitches", switches) {

        private boolean first = true;

        @Override
        protected void populateItem(ListItem<FilterTab> item) {
            if (first) {
                first = false;
                item.getModelObject().add(AttributeModifier.append("class", ACTIVE));
            }
            item.add(item.getModelObject());
        }
    };
    listView.setOutputMarkupPlaceholderTag(true);
    listView.setReuseItems(true);
    container.add(listView);
}