【发布时间】:2014-11-06 01:01:52
【问题描述】:
我正在使用 primefaces 和 dataTable(惰性模式),我需要动态/在代码中生成 dataTables 的定义。我能够构建数据表、列、标签、值……但排序不起作用。
我试过了:
column.setSortBy("name"); // where name is name of property/column
column.setSortBy("#{row['name']}"); // where row is map and name is name of property/column - this is what im using in XML version and it working very well
column.setSortBy(ef.createValueExpression(context, "#{row['name']}", Object.class));
DataTable 看起来像禁用排序(标签上没有箭头)...
当我在 XML 中有定义时,一切正常(与lazyDataModel 或模型层中的任何其他内容无关)。
【问题讨论】:
标签: jsf primefaces