cuốn sách gpt4 ai đã làm

java - Wicket - 进度/多个标签更新

In lại Tác giả: Walker 123 更新时间:2023-11-29 05:57:24 26 4
mua khóa gpt4 Nike

我不确定这是否可能。当您单击“提交”按钮时,似乎有一种方法可以做到这一点。

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
}
};
}
}

如果不可能,是否有替代多个实时更新的方法?我想要它,所以底部有一个状态标签更新并告诉您在该方法中完成了多少进度。

câu trả lời hay nhất

您必须在另一个线程中启动您希望收到通知的进程。然后,您可以使用有关状态的信息更新用户 session ,这些状态将由绑定(bind)到标签的某些 ajax 行为定期检查。

在 wicket 6 中,您还可以使用 WebSocketBehavior

关于java - Wicket - 进度/多个标签更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11549314/

26 4 0
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress