TableFilterHeader lTableFilterHeader = new TableFilterHeader();
lTableFilterHeader.getParserModel().setFormat(Articletype.class, new java.text.Format(){
@Override
public StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition pos)
{
Articletype lArticletype = (Articletype)obj;
return new StringBuffer(lArticletype.getCode());
}
@Override
public Object parseObject(String source, ParsePosition pos)
{
return Articletype.findByCode(source);
}});
lTableFilterHeader.setTable(iAccountingLedgerTableForEdit);
just a couple quick checks:
1- In the TableFilterHeader, do you invoke
setAutoChoices(AutoChocuies.Enabled) ?
2- In your TableModel, the getColumnClass for the given column does
return ArticleType.class ?
Cheers,
Lu.
PS: you can setup the Format for a editor in the IFilterEditor itself,
or using indeed the ParserModel. And if you have setup the table and
you update a formatter on the parser model it *should* be reflected on
the associated editor. Otherwise, it implies a bug...
All the code I have is listed in my post, so no, I do not enable autochoices (I think it is on by default?) and yes, the getColumnClass return the Articletype.class. I've debugged the getFormat method in TableFilterHeader's ParserModel and there it tries to find the filter for Articletype.
Without AutoChoices.Enabled, the dropdown should be definitely empty.
Cheers,
Lu.