调用dateField.setValue方法,控件就在页面上消失了
getValue获得的值是null
后检查代码,发现错误代码如下:
jpCutoffDatePanel = new DateField("Cutoff Date", "cutoffDate", 100);
Date lDtCutoffDate = this.getCutoffDate();
jpCutoffDatePanel.setValue(lDtCutoffDate);
inputPanel.addToRow(jpCutoffDatePanel, 300);
formPanel.add(inputPanel);
this.add(inputPanel);
this.add(formPanel);
删除最后第2行后程序正常
getValue获得的值是null
后检查代码,发现错误代码如下:
jpCutoffDatePanel = new DateField("Cutoff Date", "cutoffDate", 100);
Date lDtCutoffDate = this.getCutoffDate();
jpCutoffDatePanel.setValue(lDtCutoffDate);
inputPanel.addToRow(jpCutoffDatePanel, 300);
formPanel.add(inputPanel);
this.add(inputPanel);
this.add(formPanel);
删除最后第2行后程序正常
本文讨论了在使用日期字段控件时遇到的问题,即设置值后控件消失,通过代码分析找到了原因并提供了解决方案。
1002

被折叠的 条评论
为什么被折叠?



