我有以下链接:
sample = new Upload(null, lineBreakCounter);
sample.setImmediate(false);
sample.setButtonCaption("Upload File");
sample.addStartedListener(new StartedListener() {
@Override
public void uploadStarted(final StartedEvent event) {
if (uploadInfoWindow.getParent() == null) {
UI.getCurrent().addWindow(uploadInfoWindow);
}
uploadInfoWindow.setClosable(false);
}
});
sample.addFinishedListener(new Upload.FinishedListener() {
@Override
public void uploadFinished(final FinishedEvent event) {
uploadInfoWindow.setClosable(true);
}
});
uploadInfoWindow = new UploadInfoWindow(sample, lineBreakCounter);
如果用户调用此链接,我想在未找到资源的情况下发送错误消息(消息取决于资源 - 项目或冲刺或任务)。
这是轮流搜索所有资源的正确方法吗?