Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-5759

Messagebox.show in doAfterCompose() stops page rendering

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 10.0.1.1
    • None
    • springBoot = '3.2.3'
      springVersion = '6.1.4'
      springSecurityVersion = '6.3.1'

      zkVersion = '10.0.1.1-jakarta'
      zkSpringVersion = '6.0.0'
      zkSpringBootVersion = '3.2.3'

      I've already created an issue on Stackoverflow: https://stackoverflow.com/questions/78755214/zk-10-messagebox-show-in-doaftercompose-stops-page-rendering 

       

      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 

      Steps to Reproduce

      I tried to reproduce on ZKFiddle, but it didn't happen: https://zkfiddle.org/sample/2i8nuj5/1-Messagebox-stops-page-rendering

      Current Result

      Form is not rendered behind the Messagebox

      Expected Result

      Form is rendered behind the Messagebox

      Debug Information

      I turned on the TRACE logging.

      With Messagebox, ExtendletLoader loads only 2 WPD files:

      2024-07-17T08:57:54.652+02:00 --- [nio-8443-exec-3] org.zkoss.zk.ui.impl.DesktopImpl         : After added, pages: [[Page layoutPage], [Page lI9F15]]
      2024-07-17T08:58:01.411+02:00 --- [nio-8443-exec-2] o.z.web.util.resource.ExtendletLoader    : Parse /js/zul.wnd.wpd
      2024-07-17T08:58:01.411+02:00 --- [nio-8443-exec-4] o.z.web.util.resource.ExtendletLoader    : Parse /js/zul.box.wpd
      2024-07-17T08:58:01.443+02:00 --- [nio-8443-exec-7] org.zkoss.zk.ui.impl.UiEngineImpl        : replicate request, SID: 602 

      Without Messagebox, Evet¨rything is loaded:

      2024-07-17T08:59:57.392+02:00 --- [io-8443-exec-10] org.zkoss.zk.ui.impl.DesktopImpl         : After added, pages: [[Page layoutPage], [Page lOaP15]]
      2024-07-17T09:00:02.674+02:00 --- [nio-8443-exec-2] o.z.web.util.resource.ExtendletLoader    : Parse /js/zul.wnd.wpd
      2024-07-17T09:00:02.674+02:00 --- [nio-8443-exec-4] o.z.web.util.resource.ExtendletLoader    : Parse /js/zul.box.wpd
      2024-07-17T09:00:02.674+02:00 --- [nio-8443-exec-5] o.z.web.util.resource.ExtendletLoader    : Parse /js/zul.inp.wpd
      2024-07-17T09:00:02.682+02:00 --- [nio-8443-exec-1] o.z.web.util.resource.ExtendletLoader    : Parse /js/zul.grid.wpd
      2024-07-17T09:00:02.690+02:00 --- [nio-8443-exec-8] o.z.web.util.resource.ExtendletLoader    : Parse /js/zul.db.wpd
      2024-07-17T09:00:02.690+02:00 --- [nio-8443-exec-9] o.z.web.util.resource.ExtendletLoader    : Parse /js/zul.sel.wpd
      2024-07-17T09:00:02.698+02:00 --- [nio-8443-exec-2] o.z.web.util.resource.ExtendletLoader    : Parse /js/zul.mesh.wpd
      2024-07-17T09:00:02.738+02:00 --- [nio-8443-exec-6] o.z.web.util.resource.ExtendletLoader    : Parse /js/zk.fmt.wpd
      2024-07-17T09:00:02.754+02:00 --- [nio-8443-exec-3] o.z.web.util.resource.ExtendletLoader    : Parse /js/zul.menu.wpd
      2024-07-17T09:00:03.213+02:00 --- [nio-8443-exec-5] org.zkoss.zk.ui.impl.UiEngineImpl        : replicate request, SID: 3333 

      Workaround

      Don't have any

            Unassigned Unassigned
            Worsik Worsik
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: