我正在尝试使用wicket获取一个复选框。问题是,选项列表现在显示在页面上,没有选中,但是当我想检查其中一个时,它会被检查,然后在我释放鼠标按钮后直接UNCHECKED。我很确定它与wicket模型有关,因为我没有例外启动服务器,加载页面等。
可能是什么原因?
public class PackageSummaryPanel extends Panel {
private static final List<String> COLLECTED_DATA_CHOICES = Arrays.asList("Shot Report",
"Analysis Report", "Reliability Report", "Costs Estimation", "External Report");
public PackageSummaryPanel(String id, IModel<PackageSummary> model) {
super(id, new CompoundPropertyModel<PackageSummary>(model));
}
private void addCollectedData() {
add(new CheckboxField("collectedData", fieldLabel("collectedData"),
new SplitterModel(new PropertyModel<String>(getDefaultModel(),
"collectedData")), COLLECTED_DATA_CHOICES).);
}
这是bean:
@Embeddable
public class PackageSummary implements Serializable {
private static final long serialVersionUID = 1L;
@Column(name = DEVICE_PACKAGE_SUMMARY_COLLECTED_DATA)
private String collectedData;
public PackageSummary() {
collectedData = "";
}
public String getCollectedData() {
return collectedData;
}
public void setCollectedData(String collectedData) {
this.collectedData = collectedData;
}
}