Wicket 6 IColumn名称除字符串外的类型如何?
接口IColumn包含一个方法getSortProperty(),它返回任何类型S的值。名称的类型可以是除字符串以外的类型?
/** * Returns the name of the property that this header sorts. If null is returned the header will * be unsortable. * * @return the sort property */ S getSortProperty();
http://ci.apache.org/projects/wicket/apidocs/6.0.x/org/apache/wicket/extensions/markup/html/repeater/data/table/IColumn.html
在wicket旧版本6:
PropertyColumn column = new PropertyColumn(Model.of("Header"), "sortProperty", "propertyExpression");
Wicket 6:描述:
PropertyColumn(IModel displayModel, S sortProperty, String propertyExpression);
例:
PropertyColumn column = new PropertyColumn(Model.of("Header"), ?, "propertyExpression");
在地上写什么“?”
在使用PropertyColumn
的示例中PropertyColumn
您必须使用Long
值作为第二个参数,因为这是sort属性的类型。
如果您的sort属性是String,只需使用PropertyColumn
并将您的属性传递给构造函数。
javadoc在http://wicket.apache.org/apidocs/1.5/org/apache/wicket/extensions/markup/html/repeater/data/table/IColumn.html上说
getSortProperty java.lang.String getSortProperty() Returns the name of the property that this header sorts. If null is returned the header will be unsortable. Returns: a string representing the sort property