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

Calling fireEvent method cause exeception with GroupsModel(Rod enabled)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 5.0.10
    • Fix Version/s: 5.0.11
    • Component/s: Components
    • Security Level: Jimmy
    • Labels:

      Description

      When clicking the button , a cast exeception will show up

      *.zul

      <div width="100%" apply="foo.TestComposer">
      <custom-attributes org.zkoss.zul.grid.rod="true" />
      	<grid id="grid" />
      	<button id="button" label="Run"/>
      </div>
      
      *.java
      public class TestComposer extends GenericForwardComposer {
      	private Grid grid;
      	private MyModel model;
      	
      	private class MyModel extends SimpleGroupsModel {
      		public MyModel(Object[][] data) {
      			super(data);
      		}
      
      		public void update(int group) {
      			fireEvent(GroupsDataEvent.CONTENTS_CHANGED, group, 0, 0);
      		}		
      	}
      	public void doAfterCompose(final Component component) throws Exception {
      		super.doAfterCompose(component);
      		Object[][] data = new Object[2][2];
      		data[0][0] = "test0";
      		data[0][1] = "test01";
      		data[1][0] = "test1";
      		data[1][1] = "test11";
      		model = new MyModel(data);
      		grid.setModel(model);		
      	}
      	
      	public void onClick$button(){
      		model.update(0);model.update(1);
      	}
      }
      

        Attachments

          Activity

            People

            Assignee:
            jumperchen jumperchen
            Reporter:
            matthewgo matthewgo
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: