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

tabbox get exception if I set model and addToSelection in onCreate

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 7.0.0
    • 7.0.0
    • Components
    • None

      <vbox>
      <zscript><![CDATA[
      ListModelList model = new ListModelList();
      model.add("A");
      model.add("B");
      model.add("C");
      ]]></zscript>
      <tabbox onCreate='self.setModel(model);model.addToSelection("B")'>
      	<template name="model:tab">
      		<tab label="${each}"></tab>
      	</template>
      	<template name="model:tabpanel">
      		<tabpanel>Panel ${each}
      			<button label="click me ${each}" onClick="//do nothing"></button>
      		</tabpanel>
      	</template>
      </tabbox>
      <button label="click me out side" onClick="//do nothing"></button>
      </vbox>
      
      java.lang.IllegalStateException: No tab at all
      	at org.zkoss.zul.Tabbox.setSelectedIndex(Tabbox.java:571)
      	at org.zkoss.zul.Tabbox.doSelectionChanged(Tabbox.java:145)
      	at org.zkoss.zul.Tabbox.access$2(Tabbox.java:132)
      	at org.zkoss.zul.Tabbox$2.onChange(Tabbox.java:159)
      	at org.zkoss.zul.AbstractListModel.fireEvent(AbstractListModel.java:59)
      	at org.zkoss.zul.ListModelList.fireSelectionEvent(ListModelList.java:437)
      	at org.zkoss.zul.AbstractListModel.addToSelection(AbstractListModel.java:121)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at bsh.Reflect.invokeMethod(Unknown Source)
      	at bsh.Reflect.invokeObjectMethod(Unknown Source)
      	at bsh.Name.invokeMethod(Unknown Source)
      	at bsh.BSHMethodInvocation.eval(Unknown Source)
      	at bsh.BSHPrimaryExpression.eval(Unknown Source)
      	at bsh.BSHPrimaryExpression.eval(Unknown Source)
      	at bsh.Interpreter.eval(Unknown Source)
      	at bsh.Interpreter.eval(Unknown Source)
      	at org.zkoss.zk.scripting.bsh.BSHInterpreter.exec(BSHInterpreter.java:133)
      	at org.zkoss.zk.scripting.util.GenericInterpreter.interpret(GenericInterpreter.java:328)
      	at org.zkoss.zk.ui.impl.PageImpl.interpret(PageImpl.java:900)
      	at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2705)
      	at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2658)
      	at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:136)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.processEvent(UiEngineImpl.java:1765)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.process(UiEngineImpl.java:1550)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage0(UiEngineImpl.java:512)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage(UiEngineImpl.java:356)
      	at org.zkoss.zk.ui.http.DHtmlLayoutServlet.process(DHtmlLayoutServlet.java:215)
      	at org.zkoss.zk.ui.http.DHtmlLayoutServlet.doGet(DHtmlLayoutServlet.java:136)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
      	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.headerComplete(HttpConnection.java:928)
      	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
      	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
      	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)
      

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

              Created:
              Updated:
              Resolved: