vmaric
vmaric

Reputation: 369

format cell with Long Integer in Table

I've created a table where the data source is JPAContainer(connected on MySQL db).. And in table I have column with phone numbers. In Container type of phone numbers is Long Integer. I can see numbers in cells of column bath with dot like thousands separator. On sample, if phone number is 2775 it appears like 2.775. How I can customize phone number and where do that(On JPAContainer or formatting column of Table). I wish out dot from view of phone number. Is there a way

table.formatProperty(columnName);

or something similar?

Upvotes: 0

Views: 109

Answers (1)

André Schild
André Schild

Reputation: 4754

The key to format objects in a table is to either use converters or formatters as described in the wiki or the book of vaadin.

Formatting the Integer is then a small thing:

if (myValue == null)
{
  retVal= "";
}
else
{
  retVal= Integer.toString(myvalue);
}

Of course you should consider handling NULL values correctly.

Upvotes: 2

Related Questions