-
Bug
-
Resolution: Fixed
-
Major
-
6.5.3, 9.5.0.1
-
Security Level: Jimmy
-
ZK 9.5.1 S1
-
None
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
- relates to
-
ZK-1764 Fileupload.get() supports to provide a callback event listener
- Closed