-
Bug
-
Resolution: Fixed
-
Normal
-
8.6.0, 9.0.0
-
None
-
Security Level: Jimmy
-
None
Steps to Reproduce
run fiddle
http://zkfiddle.org/sample/cc4vp6/3-Grid-ROD-LiveGridDataLoader-Exception#source-1
Current Result
exception:
Adding causes a smaller list? Adding causes a smaller list?Caused by:org.zkoss.zk.ui.UiException: Adding causes a smaller list? at org.zkoss.zkmax.zul.impl.LiveGridDataLoader.doLiveListDataChange(LiveGridDataLoader.java:110) at org.zkoss.zkmax.zul.impl.LiveGridDataLoader.doListDataChange(LiveGridDataLoader.java:96) at org.zkoss.zul.Grid.onListDataChange(Grid.java:1164) at org.zkoss.zul.Grid.access$1500(Grid.java:220) at org.zkoss.zul.Grid$2.onChange(Grid.java:905) at org.zkoss.zul.AbstractListModel.fireEvent(AbstractListModel.java:73) at org.zkoss.zul.ListModelList.add(ListModelList.java:170) at jcc4vp6$v3.GridComposer.doAfterCompose(GridComposer.java:24) at org.zkoss.zk.ui.impl.UiEngineImpl.doAfterCompose(UiEngineImpl.java:616) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:941) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:888) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:775) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:835) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:793) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:739) at org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage0(UiEngineImpl.java:460) at org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage(UiEngineImpl.java:368) at org.zkoss.zk.ui.http.DHtmlLayoutServlet.process(DHtmlLayoutServlet.java:215) at org.zkoss.zk.ui.http.DHtmlLayoutServlet.doGet(DHtmlLayoutServlet.java:140) 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.servlet.Dispatcher.forward(Dispatcher.java:327) at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126) at org.mortbay.jetty.servlet.DefaultServlet.doGet(DefaultServlet.java:503) 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.HandlerCollection.handle(HandlerCollection.java:114) 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)
Expected Result
no exception
Debug Information
model.clear() triggers grid onListDatachange
without event type Interval removed
interval event is being ignored by grid
next interval added event is still being performed here:
which cause grid consistency exception (model add a new element, content list is shorter)
Workaround
model.clear();
grid.setModel(grid.getModel); //triggers internal interval check event
- relates to
-
ZK-4549 Adding items then clear() a ListModel linked to a Grid during afterCompose cause IndexOutOfBoundsException
- Closed