-
Bug
-
Resolution: Fixed
-
Major
-
8.6.3
-
Security Level: Jimmy
-
ZK 9.0.1 S1
-
None
Steps to reproduce
run fiddle http://zkfiddle.org/sample/3v53051/2-goldenlayout-vflex-during-render
click the "add goldenpannel" button twice
Current result
on 2nd click, goldenlayout and the new goldenpannel are both added to the page.
This causes the following exception
java.lang.IllegalStateException: UI can't be modified in the rendering phasejava.lang.IllegalStateException: UI can't be modified in the rendering phase at org.zkoss.zk.ui.impl.UiVisualizer.getAttrRespMap(UiVisualizer.java:325) at org.zkoss.zk.ui.impl.UiVisualizer.addSmartUpdate0(UiVisualizer.java:278) at org.zkoss.zk.ui.impl.UiVisualizer.addSmartUpdate(UiVisualizer.java:256) at org.zkoss.zk.ui.impl.UiEngineImpl.addSmartUpdate(UiEngineImpl.java:327) at org.zkoss.zk.ui.AbstractComponent.smartUpdate(AbstractComponent.java:1853) at org.zkoss.zk.ui.AbstractComponent.smartUpdate(AbstractComponent.java:1827) at org.zkoss.zk.ui.HtmlBasedComponent.setHflex0(HtmlBasedComponent.java:624) at org.zkoss.zk.ui.HtmlBasedComponent.setHflex(HtmlBasedComponent.java:613) at org.zkoss.zkmax.zul.GoldenPanel.setHflex(GoldenPanel.java:153) at org.zkoss.zkmax.zul.GoldenLayout.parseConfig(GoldenLayout.java:230) at org.zkoss.zkmax.zul.GoldenLayout.parseConfig(GoldenLayout.java:202) at org.zkoss.zkmax.zul.GoldenLayout.parseConfig(GoldenLayout.java:202) at org.zkoss.zkmax.zul.GoldenLayout.parseAreas(GoldenLayout.java:161) at org.zkoss.zkmax.zul.GoldenLayout.renderProperties(GoldenLayout.java:501) at org.zkoss.zk.ui.AbstractComponent.redraw(AbstractComponent.java:2170) at org.zkoss.zk.ui.AbstractComponent.redrawChildren(AbstractComponent.java:2261) at org.zkoss.zk.ui.AbstractComponent.redraw(AbstractComponent.java:2202) at org.zkoss.zk.ui.impl.UiVisualizer.redraw(UiVisualizer.java:1003) at org.zkoss.zk.ui.impl.UiVisualizer.redrawComponents(UiVisualizer.java:1017) at org.zkoss.zk.ui.impl.UiVisualizer.addResponsesForCreatedPerSiblings(UiVisualizer.java:869) at org.zkoss.zk.ui.impl.UiVisualizer.getResponses(UiVisualizer.java:733) at org.zkoss.zk.ui.impl.UiEngineImpl.getResponses(UiEngineImpl.java:1530) at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1336)
Expected result
Adding a new panel while also adding the goldenlayout back to the page shouldn't cause an exception.
Debugging info
During rendering, goldenlayout will trigger renderProperties > parseAreas > ...
This will eventually go to the end of the parseConfig method, where hflex/vflex values are assigned to children that do not have one yet. This is meant to happen during initalization only, not rendering in update mode. Therefore the UIVisualizer doesn't accept the hflex/vflex update due to being already rendering.
Workaround
contact support
- relates to
-
ZK-4776 "UI can't be modified in the rendering phase" happens when initializing a new goldenlayout
- Closed