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

Interrupted Fileupload cause further createComponents without parent to fail

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 6.5.3, 9.5.0.1
    • Fix Version/s: 9.5.1
    • Component/s: ZK Update Engine
    • Security Level: Jimmy
    • Labels:
    • gh.sprint.customfield.default.name:
      ZK 9.5.1 S1

      Description

      Steps to Reproduce

      Run fiddle:

      https://zkfiddle.org/sample/ulbntp/2-upload-breaks-createComponents

      Click the "create components" button: modal window is displayed (can repeat)

      Click the "upload" button

      Upload anything (or nothing) and click the upload button

      Exception happen during fileUpload event listener (mimicked by hardcoded throw in that example, but could be any processing issue located in the event handler)

      Current Result

      FileUpload button no longer show modal upload window

      Create components no longer show modal window

      Expected Result

      Error in fileupload shouldn't break createComponents

      Debug Information

      Component org.zkoss.zk.ui.Execution.createComponents(String uri, Component parent, Map<?, ?> arg)

      is used to create the fileUpload popup with values: exec.createComponents(_templ, null, params);

       

      The parent field is null, so UiVisualizer will use the sibling grouping to render the component:

      https://github.com/zkoss/zk/blob/master/zk/src/org/zkoss/zk/ui/impl/UiVisualizer.java#L893

      and will use AuInsertAfter to add it after the last created thing in the page group.

       

      At client side, this trigger a call to  zAu.cmd1.addAft targetting the fileupload popup window.

      However, that window no longer exist at client, but wasn't cleared at server side.

      Therefore, the addAft command fails at client, since it fails to find the previous sibling used as anchor. 

      Workaround

      Manually catch and handle exceptions in FileUpload

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              rudyhuang rudyhuang
              Reporter:
              MDuchemin MDuchemin
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 1 day
                  1d
                  Remaining:
                  Time Spent - 2 hours Remaining Estimate - 2 hours
                  2h
                  Logged:
                  Time Spent - 2 hours Remaining Estimate - 2 hours Time Not Required
                  2h