Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 package org.cdlflex.ui.markup.html.badge;
 import java.util.List;
A org.apache.wicket.markup.html.panel.GenericPanel that holds a ListView of BadgeListItem. By default, it wraps the link created by BadgeListItem.createLink(java.lang.String) around the Label and Badge created by the other factory methods in BadgeListItem.

By default, the BadgeListItem.createLink(java.lang.String) creates a to disable the Link. You can control the link creation by overwriting that method of a specific item.

     <li wicket:id="badges">
       <a wicket:id="link" class="badge-item-link">
         <span wicket:id="label" class="badge-item-label"></span> <span wicket:id="badge"></span>
 public class BadgeList extends GenericPanel<List<? extends BadgeListItem>> {
     private static final long serialVersionUID = 1L;
     public BadgeList(String id) {
     public BadgeList(String idList<? extends BadgeListItemlist) {
         super(id, (IModel<List<? extends BadgeListItem>>) new ListModel(list));
     public BadgeList(String idIModel<List<? extends BadgeListItem>> model) {
     protected void onInitialize() {
         add(new CssClassNameAppender("badge-list"));
     public BadgeList add(BadgeListItem item) {
         List<BadgeListItemlist = (List<BadgeListItem>) getModelObject();
         return this;

Factory method for the ListView that uses the given BadgeList instance model (a list of BadgeListItem to render a list of bootstrap badges.

id the component id
model The list model if BadgeListItem to render
a new ListView
     protected ListView<BadgeListItemnewBadgeListView(String idIModel<List<? extends BadgeListItem>> model) {
         return new ListView<BadgeListItem>(idmodel) {
             private static final long serialVersionUID = 1L;
             protected void populateItem(ListItem<BadgeListItemitem) {

Called by the ListView created by default via newBadgeListView(java.lang.String,org.apache.wicket.model.IModel). It populates the item with the link returned by BadgeListItem.createLink(java.lang.String), to which subsequently the Badge and Label is added.

item the specific list item.
    protected void populateItem(ListItem<BadgeListItemitem) {
        BadgeListItem model = item.getModelObject();
        AbstractLink link = item.getModelObject().createLink("link");
New to GrepCode? Check out our FAQ X