Heng Sin Low 2009-05-19 06:37:59 +00:00
parent 18f7930c24
commit 0feb9b4f2d
2 changed files with 56 additions and 35 deletions

View File

@ -445,7 +445,7 @@ public class WListItemRenderer implements ListitemRenderer, EventListener, Listi
ListHeader header = null;
String headerText = headerValue.toString();
if (m_headers.size() <= headerIndex)
if (m_headers.size() <= headerIndex || m_headers.get(headerIndex) == null)
{
Comparator<Object> ascComparator = getColumnComparator(true, headerIndex);
Comparator<Object> dscComparator = getColumnComparator(false, headerIndex);
@ -494,6 +494,26 @@ public class WListItemRenderer implements ListitemRenderer, EventListener, Listi
return header;
}
/**
* set custom list header
* @param index
* @param header
*/
public void setListHeader(int index, ListHeader header) {
int size = m_headers.size();
if (size <= index) {
while (size <= index) {
if (size == index)
m_headers.add(header);
else
m_headers.add(null);
size++;
}
} else
m_headers.set(index, header);
}
/**
* Obtain the comparator for a given column.
*

View File

@ -22,6 +22,7 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Vector;
import java.util.logging.Level;
@ -102,7 +103,7 @@ public class WListbox extends Listbox implements IMiniTable, TableValueChangeLis
* @param model The data model to assign to the table
* @param columnNames The names of the table columns
*/
public void setData(ListModelTable model, Vector< ? extends String> columnNames)
public void setData(ListModelTable model, List< ? extends String> columnNames)
{
// instantiate our custom row renderer
WListItemRenderer rowRenderer = new WListItemRenderer(columnNames);