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.
A DataTableColumn that adds a link to the cell item.

<T> The model object type
<S> the type of the sorting parameter
public abstract class AbstractLinkColumn<T, S> extends DataTableColumn<T, S> {
    private static final long serialVersionUID = 1L;
    public AbstractLinkColumn(IModel<StringdisplayModel) {
    public AbstractLinkColumn(IModel<StringdisplayModel, S sortProperty) {
    protected void populateItem(DataTableCell<T, S> cellItemString componentId) {
        cellItem.add(new LinkPanel(componentIdcellItem.getRowModel(), cellItem));

Executed after the link was crated. Can be used to add additional behavior to the link by subclasses.

link the created link
rowModel the row model
    protected void onAfterCreateLink(AbstractLink linkIModel<T> rowModel) {
        // hook

Template method to create the link.

id the component id
cell the cell item
a new action
    public abstract AbstractLink newLink(String idDataTableCell<T, S> cell);

Panel that holds the link.
    public class LinkPanel extends GenericPanel<T> {
        private static final long serialVersionUID = 1L;
        public LinkPanel(String idIModel<T> modelDataTableCell<T, S> cell) {
            AbstractLink link = AbstractLinkColumn.this.newLink("link"cell);
New to GrepCode? Check out our FAQ X