I am working on upgrade from ZK 8.5.2.1 to version 10, latest hotfix for jakarta.
After fixing multiple complications, I am now stuck with unexpected behaviour of Messagebox.show().
I need user to choose a Messagebox btn and then update some data in DB, based on users choice. In older version, Messagebox showed a modal window and in the meantime, my server code continued processing and pushed content to browser. So behind the Messagebox there was a fully rendered page.
Now, in ZK10, Java code continues as well, but browser is not rendering any components in the background of Messagebox.
Only thing I found in docs is deprecated use of Event thread processing which I am not using.
When I disable showing a Messagebox, page is rendered without any troubles.
What should I do to get back the expected behaviour?
fragment of Messagebox creation (only difference):
// ...doAfterCompose() - check if its read or unread and offer user to mark as read
if (!TrueFalseConverter.instance().nvlFrom(entity.getLPrectena())) {
Messagebox.show(Labels.getLabel("diaries.make.msg.question.order.set_read.text"), Labels.getLabel("diaries.make.msg.question.order.set_read.title"), Messagebox.YES | Messagebox.NO, Messagebox.QUESTION, new SerializableEventListener<Event>() {
@Override
public void onEvent(Event event) throws Exception {
if (Messagebox.ON_YES.equals(event.getName())) {
entity.setLPrectena(TrueFalseConverter.instance().to(Boolean.TRUE));
app.r.ovdenObjednavkyRepository.store(entity);
}
}
});
}
// ...continue with components creation and render the page
I cannot reproduce what you describe by just calling Messagebox.show()
in doAfterCompose()
could you please open the browser developer tool > Console to check if there is any error message?
Could you provide HAR?
See https://www.zkoss.org/wiki/ZK_Developer%27s_Reference/How_to_get_Efficient_Support#Provide_ZK_AU_Request.2FResponse_Details