2
我有一個從BeanItemContainer擴展的Container類。我想添加一個ItemSorter到DATE_CREATED屬性以降序排序值。如何添加ItemSorter到Vaadin中的表格容器?
容器類。
public class NoteContainer extends BeanItemContainer<CaseNote> implements Serializable
{
private static final long serialVersionUID = -5926608449530066014L;
public static final String DATE_CREATED = "dateCreated";
public static final String CREATED_BY = "createdBy";
public static final String TEXT = "text";
public static final String ACTION = "Action";
public static final Object[] NATURAL_COL_ORDER = new Object[] {
ACTION, DATE_CREATED, CREATED_BY, TEXT
};
public static final String[] COL_HEADERS_ENGLISH = new String[] {
"ACTION", "Date Created/Updated", "Created/Updated By", "Note"
};
/**
* Default Constructor.
*
*/
public NoteContainer()
{
super(CaseNote.class);
}
}
CaseNote是一個實體類,那DATE_CREATED
內部處於java.util.Date
格式。
請提供一個妥善的解決辦法...
感謝名單。
thanx很多。你的回答非常有用。再一次非常感謝你。 – ssdehero 2013-04-30 05:24:15
謝謝你,很好的例子! – cgew85 2014-12-18 13:43:08