我正在给数据库打电话。结果必须用于子表单。所以我想等到数据库的结果出来。为此,我需要同步。我的想法是使用java.lang中的object.notifyAll(),但是GWT不支持这个。在gwt中,notifyAll()是否有等效的方法?
编辑1
:我正在使用Gxt Formpanel提交数据。我可以更改按钮栏的类型,但我认为,AddSubmitCompleteHandler不会解决我的问题。
下面是一些代码片段:
final Button submit = new Button("Submit");
submit.addListener(Events.OnClick, new Listener<ButtonEvent>() {
@Override
public void handleEvent(ButtonEvent be) {
// 1. Get the data from Database (here i must wait for the response from DB)
// 2. Submit the form
}
);
final FormPanel buttonBar = new FormPanel();
buttonBar.addStyleName("abUploadField");
buttonBar.setHeaderVisible(false);
buttonBar.setBorders(false);
buttonBar.setStyleAttribute("margin", "0px");
buttonBar.setEncoding(FormPanel.Encoding.MULTIPART);
buttonBar.setMethod(FormPanel.Method.POST);
buttonBar.add(file);
buttonBar.add(submit);
buttonBar.setAction("myURL");
编辑2
:我想从数据库中获取序列ID(这是事件处理程序中的第一步)。此ID将用于提交。提交时,我将在数据库中用数据填充一些选项卡。ID将用于标识启动提交的用户,对于此用户,我希望显示带有消息“提交成功”的对话框。希望你明白我的意思:(对不起,我的英语不好)