Table component.Formatting of cell values in a column does not work.

I made a table and the corresponding SQLContainer. The table have a column with phone numbers. In db table type of the corresponding column is a int. I wish formatting values of Vaadin table, in such way that view phone numbers become without comas or dots like separator of thousand(8,888 → 8888).

I have already made similar thing to the Table which data source is a JPAContainer on this way:

Table imenikTable = new Table(“Imenik”, imenikData){
/**
*
*/
private static final long serialVersionUID = 8213291207581835298L;

        @Override
        protected String formatPropertyValue(Object rowId,
                Object colId, @SuppressWarnings("rawtypes") Property property) {

            Object v =  property.getValue();

            if (v instanceof Integer) {

            DecimalFormat df = (DecimalFormat) DecimalFormat.getInstance(getLocale());
            df.applyLocalizedPattern("##00");
            return df.format(v);


            }
            return super.formatPropertyValue(rowId, colId, property);
        }
    };

And everything works well. But when i made similar construction with SQLContiner instead of JPAContainer formatting is simply ignored. Affter that i try to change the way like this:

StringToIntegerConverter plainIntegerConverter = new StringToIntegerConverter(){

            private static final long serialVersionUID = -7517984934588222147L;

            protected NumberFormat getFormat(Locale locale){
                NumberFormat format = super.getFormat(locale);
                format.setGroupingUsed(false);
                return format;
            }
        };

        contaktListTable.setConverter("telbr", plainIntegerConverter);

But still my environment ignores me, even no error messages! What can be problem?

Just guessing, but maybe your database implementation returns the int not as an Integer, but in another type for example BigDecimal. Try to add a breakpoint to formatPropertyValue and check what is the type of your column value.

Thanks Johannes!
Yes My databse return int. When I used the JPA container that was resolved through annotation in the model. Bath now, how I can handle these things in situatuion when database return int? Can I try something with getType() of appropriate value?

Type of column values is Integer. Data base valu in db table is int. Any advice?

Not the most elegant solution, but you can override the formatPropertyValue in the table. in the method you check for the right column, and format the value exactly as you want, in other cases just call super.

As you tried to do in your first example, but I suggest the same as Thomas that you check the column id not the type of property value. If you know your column is instanceof Number you can apply formatting. Right?

Object v = property.getValue();
Not returning an Integer value.
Ok I try with your advise.
Bat what can be returned if we know that the base data type in the column is int?