我们在 listheader 的 onClick 期间执行 postEvent 调用。大多数情况下,事件被触发并正常运行。有时它会失败。我在下面的第二种方法中使用记录器确认它没有记录。
public void onClick(Event event) {
if (event.getTarget() != this) {
return;
}
if (editor.isVisible()) {
return;
}
header.setVisible(false);
add.setVisible(false);
logger.info("onClick -> before post event");
if (getLabel() == null || getLabel().trim().length() == 0) {
**Events.postEvent(new Event(ON_EDIT_NEW_HEADER, this));**
}
logger.info("onClick -> after post event");
// Make the hbox and children visible
editor.setVisible(true);
// Set the textbox to have the current value of the listheader
combobox.setText(getLabel());
combobox.focus();
combobox.select();
}
@Listen("onEditNewHeader=dqlistheader")
public void onEditNewDQHeader(Event event) {
// Create a new empty column the user can use to create another new column if desired.
logger.info("Inside onEditNewDQHeader --- append header");
int order = header.getChildren().size();
ReportColumn column = new ReportColumn(reportType, order);
header.appendChild(new DQListHeader(column));
header.invalidate();
}
有什么建议么?