I have one filter table ,in that table one column is there which is storing bolean value from database,on top of the table in filterField is displaying which is containing true and false I need it “Yes” ,“No” How to change it .
You need to apply a Converter for the property. You can apply a converter for a specific property of a table by calling table.setConverter(propertyId, converter). Here is an example application that does what you want.
I have one Bean which contains Like this:
class MyBean{
private Number columnWidth;
public Number getColumnWidth() {
return columnWidth;
}
public void setColumnWidth(Number columnWidth) {
this.columnWidth = columnWidth;
}
}
the setter method is getting populated from another class like:
myBean.setColumnWidth((Number) item.getBean()
.getColumnWidth());
MyView is a class like :
class MyView{
import …FilterTable
FilterTable table;
table.setColumnWidth(“propId”,myBean.getColumnWidth())//here getting error the error mentioned below
}
Error getting:
The method setColumnWidth(Object, int) in the type CustomTable is not applicable for the arguments (String, Number)
I tried to cast it with Integer but getting NullPointerException,
can you please suggexst me how i can set the width of the column using that getter value(beanValue)
Thanks
I don’t know that much about beans but setColumnWidth seems to require an int instead of a Number so would it not work (or at least not give this exception) when you return columnWidth.intValue() which should return the corresponding int?