在 Table 中使用长整数格式化单元格
format cell with Long Integer in Table
我创建了一个 table,其中数据源是 JPAContainer(连接到 MySQL 数据库)。在 table 中,我有包含 phone 数字的列. phone 数字的容器类型是长整型。我可以在柱浴的单元格中看到带有千位分隔符的数字。在示例中,如果 phone 数字是 2775,则它看起来像 2.775。我如何自定义 phone 编号以及在何处进行自定义(在 JPAContainer 或 Table 的格式化列上)。我希望从 phone 数字的角度来看点。有没有办法
table.formatProperty(columnName);
或类似的东西?
在 table 中格式化对象的关键是使用 wiki or the book of vaadin 中描述的转换器或格式化程序。
Formatting the Integer那就是小东西:
if (myValue == null)
{
retVal= "";
}
else
{
retVal= Integer.toString(myvalue);
}
当然你应该考虑正确处理 NULL 值。
我创建了一个 table,其中数据源是 JPAContainer(连接到 MySQL 数据库)。在 table 中,我有包含 phone 数字的列. phone 数字的容器类型是长整型。我可以在柱浴的单元格中看到带有千位分隔符的数字。在示例中,如果 phone 数字是 2775,则它看起来像 2.775。我如何自定义 phone 编号以及在何处进行自定义(在 JPAContainer 或 Table 的格式化列上)。我希望从 phone 数字的角度来看点。有没有办法
table.formatProperty(columnName);
或类似的东西?
在 table 中格式化对象的关键是使用 wiki or the book of vaadin 中描述的转换器或格式化程序。
Formatting the Integer那就是小东西:
if (myValue == null)
{
retVal= "";
}
else
{
retVal= Integer.toString(myvalue);
}
当然你应该考虑正确处理 NULL 值。