2

When using display tag in external sorting/paging mode you have to specify the size parameter. I've done that, but I'm getting the above error.

The instructions for doing this are here: http://www.displaytag.org/1.2/tut_externalSortAndPage.html

A lot of other people have had this problem too and I haven't seen a good solution yet. Typically the solution is to pass the parameter using a scriptlet. I would prefer to do this using an expression.

Here is my code:

        <display:table name="hitlistModel.hitResults" id="hitItem" class="HitlistResults" defaultorder="ascending" 
            sort="external" size="${hitlistModel.totalCountRecords}" partialList="true" pagesize="${hitlistModel.pageSize}" cellspacing="1" cellpadding="0" 
            requestURI="Hitlist.htm" defaultsort="2" export="true">
Sarel Botha
  • 12,419
  • 7
  • 54
  • 59

1 Answers1

2

The solution is very simple. Remove the expression qualifier symbols ${} around the parameter value.

The result is this:

        <display:table name="hitlistModel.hitResults" id="hitItem" class="HitlistResults" defaultorder="ascending" 
            sort="external" size="hitlistModel.totalCountRecords" partialList="true" pagesize="${hitlistModel.pageSize}" cellspacing="1" cellpadding="0" 
            requestURI="Hitlist.htm" defaultsort="2" export="true">

For some reason this parameter expects expression text that the tag library will later evaluate to find out the value.

The documentation is correct. It's just one of those things that you don't notice.

Sarel Botha
  • 12,419
  • 7
  • 54
  • 59