Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6737181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:13:08+00:00 2026-05-26T11:13:08+00:00

I have an existing DataTable built in Wicket 1.5 as follows: The Page’s java

  • 0

I have an existing DataTable built in Wicket 1.5 as follows:

The Page’s java file.

public class ExamplePage extends WebPage {
public ExamplePage(){
List<IColumn<Example>> columns = new ArrayList<IColumn<Example>>();
columns.add(new PropertyColumn<Example>(Model.of("name"), "name"));
ExampleProvider provider = new ExampleProvider();

        DataTable<Example> exampleTable = new DataTable<Example>("exampleTable", columns, provider, 10);
        exampleTable.addTopToolbar(new HeadersToolbar(exampleTable, null));
        exampleTable.addBottomToolbar(new NavigationToolbar(exampleTable));
        add(exampleTable);
    }
}

The Provider

public class ExampleProvider extends SortableDataProvider<Example> {
    @SpringBean
    ExampleDao exampleDao;

    public ExampleProvider() {
        Injector.get().inject(this);
    }

    @Override
    public Iterator<Example> iterator(int first, int count) {
        List<Example> examples = exampleDao.find(first, count);
        Iterator<Example> exampleIterator = examples.iterator();
        return exampleIterator;
    }

    @Override
    public IModel<Example> model(Example object) {
        return Model.of(object);
    }

    @Override
    public int size() {
        return exampleDao.count();
    }
}

The html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"  
      xmlns:wicket="http://wicket.apache.org"  
      xml:lang="en"  
      lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
    <wicket:extend>
        <table wicket:id="exampleTable" />
    </wicket:extend>
</body>
</html>

I tried just adding the sort parameter to the PropertyColumn so that the column would be clickable but
would not do anything.

columns.add(new PropertyColumn<Example>(Model.of("name"), "name", "name"));

This created the following error.

Last cause: null
WicketMessage: Exception in rendering component: [ [Component id = header]]

java.lang.NullPointerException
    at org.apache.wicket.extensions.markup.html.repeater.data.sort.OrderByLink$CssModifier.onComponentTag(OrderByLink.java:190)
    at org.apache.wicket.Component.renderComponentTag(Component.java:3885)
    at org.apache.wicket.Component.internalRenderComponent(Component.java:2506)
    at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1576)
    at org.apache.wicket.Component.internalRender(Component.java:2345)
    at org.apache.wicket.Component.render(Component.java:2273)
    at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1474)
    ...

I have tried adding setSort(new SortParam(“name”, true)); to the Provider constructor

I have also attempted adding the complete backend to the DAO so that a sorted portion of the table would be returned.

I have also tried adding a field to the properties file for the page similar to the first resource sited at the bottom.

All of my attempts result in the same error. I think I must be missing something simple, but I have checked quite a few examples and found nothing.

The resources I have already checked include the following:

  • https://cwiki.apache.org/WICKET/simple-sortable-datatable-example.html
  • http://wicketstuff.org/wicket14/repeater/
  • Apache Wicket Cookbook
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T11:13:09+00:00Added an answer on May 26, 2026 at 11:13 am

    Don’t pass ‘null’ at new HeadersToolbar(exampleTable, null).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have existing Linux shared object file (shared library) which has been stripped. I
I have existing java code and need to create Design Document based on that.
I have a page like this : <div id=daysTable> <div id=day0 class=day></div> <div id=day1
We currently have a quote page which lists all existing quotes that we would
If I don't have a reference to an existing jQuery datatable, how can i
I have a class such as: public MyClass { public myEnumType Status {get;set;} public
I have existing Java application that is using Acegi for authentication/authorization. Our new web
I have existing code that uses CMNewProfileSearch to find then iterate over the color
I have quick question for you SQL gurus. I have existing tables without primary
I'm working on a project where the client wants to have existing pages dynamically

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.