我必须创建一个表,其结构是这样的
|--------------------------------| | col1 | col2 | col3 | col4 | | | | col3.1 | col3.2 | | |----|----|--------|--------|----| |----|----|--------|--------|----|
是否可以使用显示标签创建这样的数据网格?
我必须创建一个表,其结构是这样的
|--------------------------------| | col1 | col2 | col3 | col4 | | | | col3.1 | col3.2 | | |----|----|--------|--------|----| |----|----|--------|--------|----|
是否可以使用显示标签创建这样的数据网格?
查看装饰器示例(http://displaytag.sourceforge.net/1.2/tut_decorators.html),这是您最好的选择。
另一种方法是手动添加单元格的内容,如下所示:
<display:column titleKey="something" media="html">
<c:out_of_property_here>
</display:column>
如果我没记错的话,如果我的表被定义为:
<display:table name="test" requestURI="some_uri"
defaultsort="0" id="test" export="true" excludedParams="*" >
您将使用 访问当前元素test
,因此如果您正在显示的对象具有id
带有 getter的属性getId
,您将通过编写访问列表中的当前对象test.id
。
但我会先尝试使用装饰器(您可以为每列 iirc 添加装饰器),第二个选项非常混乱。