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

Rendering Stepbar dynamically causes error

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: 9.1.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Steps to Reproduce

      I've created the simplest zk-fiddle reproducing the error on https://zkfiddle.org/sample/c6q1gg/5-sidebar-during-render

      Current Result

      Trying to render a Stepbar in a dynamic fashion (ex. on button click) triggers a "UI can't be modified in the rendering phase" error. I tried on version 9.5.0.FL.20200822 and it causes the same error.

      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:333) at org.zkoss.zk.ui.impl.UiVisualizer.addSmartUpdate0(UiVisualizer.java:286) at org.zkoss.zk.ui.impl.UiVisualizer.addSmartUpdate(UiVisualizer.java:264) at org.zkoss.zk.ui.impl.UiEngineImpl.addSmartUpdate(UiEngineImpl.java:336) at org.zkoss.zk.ui.AbstractComponent.smartUpdate(AbstractComponent.java:1858) at org.zkoss.zk.ui.AbstractComponent.smartUpdate(AbstractComponent.java:1832) at org.zkoss.zk.ui.AbstractComponent.smartUpdate(AbstractComponent.java:1866) at org.zkoss.zkmax.zul.Stepbar.updateActiveIndex(Stepbar.java:157) at org.zkoss.zkmax.zul.Stepbar.lambda$initDataListener$0(Stepbar.java:310) at org.zkoss.zul.AbstractListModel.fireEvent(AbstractListModel.java:73) at org.zkoss.zul.ListModelList.fireSelectionEvent(ListModelList.java:470) at org.zkoss.zul.AbstractListModel.addToSelection(AbstractListModel.java:137) at org.zkoss.zkmax.zul.DefaultStepModel.getActiveStep(DefaultStepModel.java:62) at org.zkoss.zkmax.zul.DefaultStepModel.getActiveIndex(DefaultStepModel.java:55) at org.zkoss.zkmax.zul.Stepbar.updateCompleteStatus(Stepbar.java:147) at org.zkoss.zkmax.zul.Stepbar.renderProperties(Stepbar.java:523) at org.zkoss.zk.ui.AbstractComponent.redraw(AbstractComponent.java:2175) at org.zkoss.zk.ui.AbstractComponent.redrawChildren(AbstractComponent.java:2266) at org.zkoss.zk.ui.AbstractComponent.redraw(AbstractComponent.java:2207) at org.zkoss.zk.ui.AbstractComponent.redrawChildren(AbstractComponent.java:2266) at org.zkoss.zk.ui.AbstractComponent.redraw(AbstractComponent.java:2207) at org.zkoss.zk.ui.AbstractComponent.redrawChildren(AbstractComponent.java:2266) at org.zkoss.zk.ui.AbstractComponent.redraw(AbstractComponent.java:2207) at org.zkoss.zk.ui.AbstractComponent.redrawChildren(AbstractComponent.java:2266) at org.zkoss.zk.ui.AbstractComponent.redraw(AbstractComponent.java:2207) at org.zkoss.zk.ui.impl.UiVisualizer.redraw(UiVisualizer.java:1016) at org.zkoss.zk.ui.impl.UiVisualizer.redrawComponents(UiVisualizer.java:1030) at org.zkoss.zk.ui.impl.UiVisualizer.addResponsesForCreatedPerSiblings(UiVisualizer.java:882) at org.zkoss.zk.ui.impl.UiVisualizer.getResponses(UiVisualizer.java:746) at org.zkoss.zk.ui.impl.UiEngineImpl.getResponses(UiEngineImpl.java:1575) at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1345) 

      Expected Result

      Adding a new Stepbar dynamically shouldn't cause an exception.

      Debug Information

      Workaround

      I haven't found any. 

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              ajrneo ajrneo
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated: