gpt4 book ai didi

java - 计算列中的项目 vaadin

转载 作者:行者123 更新时间:2023-12-01 11:23:55 27 4
gpt4 key购买 nike

大家好!

如何获取列包含的项目数?我想要如果“工作组”列为空,则隐藏它,我只是不知道如何。

            Table tblTeachings = new Table();
tblTeachings.addContainerProperty("#", Integer.class,0);
tblTeachings.addContainerProperty("Course",String.class,"");
tblTeachings.addContainerProperty("Teaching name",String.class,"");
tblTeachings.addContainerProperty("Start date",String.class,"");
tblTeachings.addContainerProperty("End Date",String.class,"");
tblTeachings.addContainerProperty("Activity status",String.class,"");
tblTeachings.addContainerProperty("Participated",String.class,"");
tblTeachings.addContainerProperty("Workgroup",String.class,"");
tblTeachings.setSizeFull();

if(/*I don't know what condition should I put here*/){
//hide the emptycolumn
}

谢谢!

最佳答案

列不包含项目,行包含项目。

您可以通过将数组传递给 setVisibleColumns methos of the Table 来设置可见列.

这也可能是一个想法,只是折叠列,而不是隐藏它......

确定该列的所有值是否为空对于您来说应该很简单。如果没有,请告诉我们您使用的数据源。

关于java - 计算列中的项目 vaadin,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30978210/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com