WListbox.setData will not re-render the list box header after the first call, i.e if your subsequent call to WListbox.setData doesn't have the same number of columns, the content and header will not be in sync.

Link to SF Tracker: http://sourceforge.net/support/tracker.php?aid=2983597
This commit is contained in:
Heng Sin Low 2010-04-08 03:00:51 +00:00
parent 644cee6e00
commit dbe819c58b
1 changed files with 9 additions and 2 deletions

View File

@ -118,6 +118,14 @@ public class WListbox extends Listbox implements IMiniTable, TableValueChangeLis
{
getModel().setNoColumns(columnNames.size());
this.setItemRenderer(rowRenderer);
//recreate listhead if needed
ListHead head = super.getListHead();
if (head != null)
{
head.getChildren().clear();
rowRenderer.renderListHead(head);
}
}
// re-render
@ -157,8 +165,7 @@ public class WListbox extends Listbox implements IMiniTable, TableValueChangeLis
head = new ListHead();
// recreate the list head
// TODO use reflection to check whether ItemRenderer is able to render ListHead
// render list head
if (this.getItemRenderer() instanceof WListItemRenderer)
{
((WListItemRenderer)this.getItemRenderer()).renderListHead(head);