I'm hoping someone can help me with my DisplayTag problem. This is my current java JSP code
<display:column property="code" titleKey="order.list.header.code" sortable="true" />
<display:column titleKey="title.describe" sortable="false">
<a class="item" href="javascript:open('<html:rewrite page='/action/product'/>?action=viewProduct&id=<bean:write name='productMissing' property='id'/>',
'<bean:message key='button.label.close' />');">
<bean:write name="productMissing" property="description" />
<br />
<bean:write name="productMissing" property="details" />
</a>
</display:column>
With the code above, everything shows up fine. The link is fine and the values are correct. But if I set the "sortable" flag to true, and click on the "title.describe" header, the sort makes no sense.
I tried putting the description inside the display:column tag like this
<display:column property="description" titleKey="title.describe" sortable="true" />
the sort worked but I'm still missing the "a href" and the second property "details".
So I tried the same line above but added Displaytag's property href as described in the displaytag site like this.
<display:column property="description" titleKey="title.describe" href="javascript:open('<html:rewrite page='/action/product....." sortable="true" />
But the link was not built properly. I suspect because the link calls a javascript function or because of the struts tags.
I'm at a loss here. Any help or ideas would be appreciated.
You need to give attribute
defaultsort
indisplay:table
with the number of column to be sortedEDIT
You can give
sortProperty
todisplay:column
and give using which property you want to sortdescription
ordetails