4

List model list remove item issue in ZK Framework [closed]

asked 2013-03-11 05:39:33 +0800

iamsudhir4u gravatar image iamsudhir4u flag of India
545 7
http://corejavasupport.bl...

updated 2013-03-11 06:21:13 +0800

  1. I have created a List model list through below code

    ListModelList<listdata> peopleModelList = new ListModelList();

  2. I have added 4 ListData through below code. List Data is a data carrier class.

    peopleModelList.add(ListData1); peopleModelList.add(ListData2); peopleModelList.add(ListData3); peopleModelList.add(ListData4);

  3. I want to delete 2 items from List model list then i simply remove two ListData through below code. This is also not working fine. Below exception is thrown here also.

peopleModelList.remove(ListData1); peopleModelList.remove(ListData4);

I am facing one issue when i am removing the two items (ListData1 and ListData4) from list model list. Out of these two items, first item is populating through data base and second list item data is populating through data picker.

data picker is noting but it is list box from that list box user can select a item data. when user will select a item data from list box then corresponding details will be populated in to second List Data(ListData4).

java.lang.IndexOutOfBoundsException: Index: 4, Size: 4 at java.util.ArrayList.rangeCheck(Unknown Source) at java.util.ArrayList.get(Unknown Source) at org.zkoss.zul.ListModelList.getElementAt(ListModelList.java:150) at org.zkoss.zul.Listbox.doSelectionChanged(Listbox.java:2591) at org.zkoss.zul.Listbox.onListDataChange(Listbox.java:2533) at org.zkoss.zul.Listbox.access$800(Listbox.java:261) at org.zkoss.zul.Listbox$4.onChange(Listbox.java:461) at org.zkoss.zul.AbstractListModel.fireEvent(AbstractListModel.java:61) at org.zkoss.zul.AbstractListModel.removeFromSelection(AbstractListModel.java:139) at org.zkoss.zul.ListModelList.remove(ListModelList.java:309) at com.csdcsystems.amanda.jems.web.viewmodel.CivilPartiesViewModel$2.onEvent(CivilPartiesViewModel.java:934) at org.zkoss.zul.Messagebox$ButtonListener.onEvent(Messagebox.java:770) at org.zkoss.zul.Messagebox$ButtonListener.onEvent(Messagebox.java:763) at org.zkoss.zul.impl.MessageboxDlg.endModal(MessageboxDlg.java:107) at org.zkoss.zul.impl.MessageboxDlg$Button.onClick(MessageboxDlg.java:154) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2716) at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2646) at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:136) at org.zkoss.zk.ui.impl.UiEngineImpl.processEvent(UiEngineImpl.java:1709) at org.zkoss.zk.ui.impl.UiEngineImpl.process(UiEngineImpl.java:1494) at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1204) 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:647) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)
delete flag offensive retag edit

The question has been closed for the following reason "the question is answered, right answer was accepted" by sjoshi
close date 2013-03-11 12:28:09

Comments

1

We were using 6.0.3.1 version of ZK.

It is working fine in 6.5.1 version of ZK.

iamsudhir4u ( 2013-03-11 12:23:42 +0800 )edit

1 Answer

Sort by ยป oldest newest most voted
6

answered 2013-03-11 12:24:13 +0800

hswain gravatar image hswain flag of India
1763 3 10
http://corejavaexample.bl...

it's fixed http://tracker.zkoss.org/browse/ZK-1428

link publish delete flag offensive edit

Question tools

Follow
1 follower

RSS

Stats

Asked: 2013-03-11 05:39:33 +0800

Seen: 210 times

Last updated: Mar 11 '13

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More