我不确定这是否可能。当您单击“提交”按钮时,似乎有一种方法可以做到这一点。
private Button getButton(String id)
{
return new AjaxButton(id)
{
private static final long serialVersionUID = 1L;
{
setEnabled(true);
}
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form)
{
debug = "Beginning a process....";
target.addComponent(debugLabel);
//Perform the first process
debug = "Beginning second process....";
target.addComponent(debugLabel);
//Perform the second process
debug = "Finishing....";
target.addComponent(debugLabel);
//Perform the third process
debug = "Done.";
target.addComponent(debugLabel);
}
@Override
protected void onError(AjaxRequestTarget target, Form form)
{
//NO-OP
}
};
}
}
如果不可能,是否有替代多个实时更新的方法?我想要它,所以底部有一个状态标签,它会更新并告诉您在该方法中完成了多少进展。