Note that there are some explanatory texts on larger screens.

plurals
  1. POwicket DataTable getSort state does not change
    text
    copied!<p>Thank you for you're attention, I've got this weird problem I'm not able to solve. I've build a DataTable with wicket mapped with content from mongoDB. Also I'm working with Tomcat7 and Eclipse</p> <p>However each time I select a column to sort then the getSort() method in the iterator method of the data provider always returns me the same value that is the default one.</p> <pre><code>public SortableGalaxyDataProvider() { setSort("name", SortOrder.ASCENDING); } @Override public Iterator&lt;? extends Galaxy&gt; iterator(long first, long count) { SortParam&lt;String&gt; sort = getSort(); //is always the same </code></pre> <p>initialisation of my page is done this way</p> <p>[Edit] I'm using Spring for injection, so in GalaxyTable page I have.</p> <pre><code>@Inject SortableGalaxyDataProvider galaxyProvider; public GalaxyTable() { List&lt;IColumn&lt;Galaxy, String&gt;&gt; columns = new ArrayList&lt;IColumn&lt;Galaxy, String&gt;&gt;(); columns.add(new PropertyColumn&lt;Galaxy,String&gt;(new Model&lt;String&gt;("Name"),"name","name")); columns.add(new PropertyColumn&lt;Galaxy,String&gt;(new Model&lt;String&gt;("Type"),"type","type")); columns.add(new PropertyColumn&lt;Galaxy,String&gt;(new Model&lt;String&gt;("Ancestors"),"ancestors","ancestors")); columns.add(new PropertyColumn&lt;Galaxy,String&gt;(new Model&lt;String&gt;("Radius"),"radius","radius")); add(new DefaultDataTable&lt;Galaxy, String&gt;("galaxies", columns, galaxyProvider, 10)); } </code></pre> <p>Here is the html line used for the table</p> <pre><code>&lt;wicket:extend&gt; &lt;table cellspacing="0" wicket:id="galaxies"&gt;[table]&lt;/table&gt; &lt;/wicket:extend&gt; </code></pre> <p>I looked for many examples around and no one seems to get the same trouble, the initial display is normal and I can travel through the content however it will never get sorted cause sort state is not changing.</p> <p>Any clue ?</p> <p>Thanks</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload