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

Exception if reload a included page

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 6.0.1
    • 6.0.0
    • Databind 2
    • None
    • None

      Failed to invoke org.zkoss.bind.tracker.impl.BindUiLifeCycle@2392d604
      java.lang.IllegalStateException: UI can't be modified in the rendering phase
      at org.zkoss.zk.ui.impl.UiVisualizer.getAttrRespMap(UiVisualizer.java:299)
      at org.zkoss.zk.ui.impl.UiVisualizer.addSmartUpdate0(UiVisualizer.java:254)
      at org.zkoss.zk.ui.impl.UiVisualizer.addSmartUpdate(UiVisualizer.java:238)
      at org.zkoss.zk.ui.impl.UiEngineImpl.addSmartUpdate(UiEngineImpl.java:280)
      at org.zkoss.zk.ui.AbstractComponent.smartUpdate(AbstractComponent.java:1542)
      at org.zkoss.zk.ui.AbstractComponent.smartUpdate(AbstractComponent.java:1517)
      at org.zkoss.zk.ui.AbstractComponent.removeEventListener(AbstractComponent.java:2114)
      at org.zkoss.bind.impl.BinderImpl.removeEventCommandListenerIfExists(BinderImpl.java:1185)
      at org.zkoss.bind.impl.BinderImpl.removeBindings(BinderImpl.java:1806)
      at org.zkoss.bind.impl.BinderImpl.removeBindings(BinderImpl.java:1751)
      at org.zkoss.bind.tracker.impl.BindUiLifeCycle.removeBindings0(BindUiLifeCycle.java:117)
      at org.zkoss.bind.tracker.impl.BindUiLifeCycle.afterPageDetached(BindUiLifeCycle.java:95)
      at org.zkoss.zk.ui.util.Configuration.afterPageDetached(Configuration.java:1123)
      at org.zkoss.zk.ui.impl.DesktopImpl.removePage(DesktopImpl.java:792)
      at org.zkoss.zk.ui.impl.UiVisualizer.getResponses(UiVisualizer.java:612)
      at org.zkoss.zk.ui.impl.UiEngineImpl.getResponses(UiEngineImpl.java:1405)
      at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1217)
      at org.zkoss.zk.au.http.DHtmlUpdateServlet.process(DHtmlUpdateServlet.java:558)
      at org.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:456)
      at org.zkoss.zk.au.http.DHtmlUpdateServlet.doPost(DHtmlUpdateServlet.java:464)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401)
      at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
      at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
      at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450)
      at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      at org.mortbay.jetty.Server.handle(Server.java:326)
      at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
      at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945)
      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
      at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
      at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
      at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
      at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

      <zk>
      	<window>
      	<label multiline="true">
      	1.click the reload button more than 3 time, the time stamp should change after each click
      	
      	</label>
      		<window apply="org.zkoss.bind.BindComposer"
      			viewModel="@id('vm') @init('org.zkoss.zktest.bind.issue.B00993IncludeReload')" title="a title">
      			<include src="@load(vm.url) @converter(vm.converter)"/>
      			<button label="reload" onClick="@command('reload')"/>
      		</window>
      	</window>
      </zk>
      
      <zk>
      	<window>
      		<zscript>
      		java.util.Date date = new java.util.Date();
      		</zscript>
      		Time : <label value="${date}"/>
      	</window>
      </zk>
      
      
      package org.zkoss.zktest.bind.issue;
      
      import org.zkoss.bind.BindContext;
      import org.zkoss.bind.Converter;
      import org.zkoss.bind.annotation.NotifyChange;
      import org.zkoss.zk.ui.Component;
      
      public class B00993IncludeReload {
      	String url = "B00993IncludeReload2.zul";
      	public String getUrl(){
      		return url;
      	}
      	
      	@org.zkoss.bind.annotation.Command
      	@NotifyChange("url")
      	public void reload(){
      		
      	}
      	
      	public Converter getConverter(){
      		return new Converter() {
      			
      			@Override
      			public Object coerceToUi(Object val, Component component, BindContext ctx) {
      				if(val instanceof String){
      					return val +"?tms=" + System.currentTimeMillis();
      				}
      				return val;
      			}
      			
      			@Override
      			public Object coerceToBean(Object val, Component component, BindContext ctx) {
      				return null;
      			}
      		};
      	}
      }
      
      

            dennis dennis
            dennis dennis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: