can we use rowspan and colspan in displaytag?

人盡茶涼 提交于 2019-12-12 18:07:18

问题


I have to create a table, whose structure is like this

|--------------------------------|  
|col1|col2|      col3       |col4|  
|    |    | col3.1 | col3.2 |    |  
|----|----|--------|--------|----|  
|----|----|--------|--------|----|  

Is it possible to create such a datagrid using display tag?


回答1:


Check out the decorator examples (http://displaytag.sourceforge.net/1.2/tut_decorators.html), that is your best bet.

Another way to do it is to add the content of the cell manually, like so:

<display:column titleKey="something" media="html">

       <c:out_of_property_here>

</display:column>

If I remember correctly, if my table was defined like:

<display:table name="test" requestURI="some_uri"
    defaultsort="0" id="test" export="true" excludedParams="*" >

you would access the current element using test, so if the object you are displaying has a property id with a getter getId, you would access the current object in the list by writing test.id.

But I would try using a decorator first (you can add decorators per-column iirc), the second option is very messy.



来源:https://stackoverflow.com/questions/1831631/can-we-use-rowspan-and-colspan-in-displaytag

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!