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

Stepbar Error - render dynamically with model

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: Freshly, 9.5.0, 9.0.1.2, 9.1.0
    • Fix Version/s: 9.5.1
    • Component/s: Components
    • Security Level: Jimmy
    • Labels:
    • gh.sprint.customfield.default.name:
      ZK 9.5.1 S1

      Description

      Steps to Reproduce

      <zk>
          <zscript><![CDATA[
              StepModel model = new DefaultStepModel();
              model.add("AAA");
              model.add("BBB");
              model.add("CCC");
              model.setActiveStep("BBB");
          ]]></zscript>
          <button id="render" label="Render Stepbar"/>
          <div fulfill="render.onClick">
              <stepbar model="${model}"/>
          </div>
      </zk>
      

      click the button

      Current Result

      java.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:1898)
      	at org.zkoss.zkmax.zul.Step.setComplete(Step.java:99)
      	at org.zkoss.zkmax.zul.Stepbar.updateCompleteStatus(Stepbar.java:150)
      	at org.zkoss.zkmax.zul.Stepbar.renderProperties(Stepbar.java:523)
      	at org.zkoss.zk.ui.AbstractComponent.redraw(AbstractComponent.java:2175)
              ...
      

      Expected Result

      stepbar renders with active step as in StepModel

      Debug Information

      setComplete is called indirectly from renderProperties

      the error only happens when rendered dynamically, initial page rendering works as expected (e.g. by removing the fulfill condition in the example above)

      Workaround

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              DevChu DevChu
              Reporter:
              cor3000 cor3000
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: