1

I am using displaytag library for displaying table. following is the jsp code snippet. I need to display a radio button on each row. since i do not want to export this i have kept media="html. In the below example when i am sorting the data with accountClass and exporting it, I am getting exported data sorted with the 3rd column ie. accountCode in this case. This is happening because of the radio button, if i remove radio button everything works fine, but I need to have this button on page as a part of functionality. please help. Thanks in advance.

<display:table export="true"  id="data" name="sessionScope.accountClassMasterList" requestURI="/AccountClass.do" pagesize="10">
            <display:column  media="html">
                  <input type="radio" value='<%=data_rowNum.intValue()-1%>' name='rowNr' onClick="fnEnableControls()"/>
            </display:column>
            <display:column property="accountClass" title="AccountClass" sortable="true"   />
            <display:column property="accountCode"  title="AccountCode" sortable="true"  />
            <display:column property="description" title="Description" sortable="true"  />
        </display:table>
  • This sounds like a bug in the library, judging by the documentation. It should be adjusting the sort column based on media type. I'd suggest submitting a bug report on their [JIRA](http://jira.codehaus.org/browse/DISPL). – Beau Grantham Jan 19 '12 at 20:35

1 Answers1

0

try to name the columns by yourself, with "sortName="1" " etc.

eg.

<display:table export="true"  id="data" name="sessionScope.accountClassMasterList"     requestURI="/AccountClass.do" pagesize="10">
        <display:column  media="html">
              <input type="radio" value='<%=data_rowNum.intValue()-1%>' name='rowNr' onClick="fnEnableControls()"/>
        </display:column>
        <display:column property="accountClass" title="AccountClass" sortable="true"  sortName="1"  />
        <display:column property="accountCode"  title="AccountCode" sortable="true" sortName="2" />
        <display:column property="description" title="Description" sortable="true" sortName="3" />
    </display:table>
Panos
  • 7,227
  • 13
  • 60
  • 95