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

Remove a ListModel's item before a Combobx renders throws an exception

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 7.0.6
    • 7.0.5
    • None
    • Security Level: Jimmy
    • None
    • ZK 7.0.7

      Steps to reproduce

      1. run the zul with the composer
        <zk>
        	<div apply="support.issue.IssueComposer">
        		<combobox id="combo"  />
        	</div>
        </zk>
        
      public class IssueComposer extends SelectorComposer {
      
      	@Wire
      	private Combobox combo;
      
      	public void doAfterCompose(Component comp) throws Exception {
      		super.doAfterCompose(comp);
      		ListModelList infos = new ListModelList(
      				new String[] {
      						"Apple",
      						"Orange",
      						"Mango"
      				});
      
      		combo.setModel(infos);
      		infos.remove(0);
      	}
      
      
      }
      

      Actual result

      org.zkoss.zk.ui.UiException: Removal causes a larger list?
      	at org.zkoss.zul.Combobox$1.onChange(Combobox.java:252)
      	at org.zkoss.zul.AbstractListModel.fireEvent(AbstractListModel.java:59)
      	at org.zkoss.zul.ListModelList.remove(ListModelList.java:319)
      	at support.issue.IssueComposer.doAfterCompose(IssueComposer.java:23)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.doAfterCompose(UiEngineImpl.java:578)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:880)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:826)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:735)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:797)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:757)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:699)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage0(UiEngineImpl.java:442)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage(UiEngineImpl.java:356)
      	at org.zkoss.zk.ui.http.DHtmlLayoutServlet.process(DHtmlLayoutServlet.java:217)
      	at org.zkoss.zk.ui.http.DHtmlLayoutServlet.doGet(DHtmlLayoutServlet.java:136)
      

            DevChu DevChu
            hawk hawk
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour
                1h