Results 1 to 5 of 5

Thread: [FIXED] BeforeAdd and Add events of DataView aren't DataViewEvents

  1. #1
    Ext User
    Join Date
    May 2008
    Posts
    23
    Vote Rating
    0
      0  

    Default [FIXED] BeforeAdd and Add events of DataView aren't DataViewEvents

    Hi. The problem is that when I add a Listener<DataViewEvent> to a DataView for the BeforeAdd and Add event, and when the event occurs, the program throws an exception saying that the ContainerEvent can't be cast to a DataViewEvent, so it seems these events are ContainerEvents. Aren't they supposed to be DataViewEvents?

    Thanks

    P.S. The SelectionChange DataViewEvent works well, I don't know how it works with BeforeRemove, Remove and ContextMenu events.

  2. #2
    Sencha - GXT Dev Team darrellmeyer's Avatar
    Join Date
    May 2007
    Location
    Washington, DC
    Posts
    2,242
    Vote Rating
    2
      0  

    Default

    Fix is in SVN.

  3. #3
    Ext User
    Join Date
    May 2008
    Posts
    23
    Vote Rating
    0
      0  

    Default

    Hi. Sorry to bother again but it seems the problem still occurs. My program throws:

    Code:
    [ERROR] Uncaught exception escaped
    java.lang.ClassCastException: com.extjs.gxt.ui.client.event.ContainerEvent cannot be cast to com.extjs.gxt.ui.client.event.DataViewEvent
        at com.drl.rts.management.client.pages.NetworkPage$NetworkDiagramBeforeAddListener.handleEvent(NetworkPage.java:1)
        at com.extjs.gxt.ui.client.event.BaseObservable.fireEvent(BaseObservable.java:74)
        at com.extjs.gxt.ui.client.widget.Component.fireEvent(Component.java:398)
        at com.extjs.gxt.ui.client.widget.Container.insert(Container.java:294)
        at com.extjs.gxt.ui.client.widget.DataView.insert(DataView.java:242)
        at com.extjs.gxt.ui.client.widget.DataView.insert(DataView.java:1)
        at com.extjs.gxt.ui.client.widget.Container.add(Container.java:202)
        at com.extjs.gxt.ui.client.widget.DataView.add(DataView.java:142)
        at com.extjs.gxt.ui.client.binder.DataViewBinder.createAll(DataViewBinder.java:75)
        at com.extjs.gxt.ui.client.binder.StoreBinder.init(StoreBinder.java:126)

  4. #4
    Sencha - GXT Dev Team darrellmeyer's Avatar
    Join Date
    May 2007
    Location
    Washington, DC
    Posts
    2,242
    Vote Rating
    2
      0  

    Default

    I reviewed the code, and tested the events and see no issues. Are you sure you running the latest code? If you still have problems, post some sample code.

    Here is the code I used:

    Code:
        view.addListener(Events.BeforeAdd, new Listener<DataViewEvent>() {
          public void handleEvent(DataViewEvent e) {
            System.out.println(e);
          }
        });

  5. #5
    Ext User
    Join Date
    May 2008
    Posts
    23
    Vote Rating
    0
      0  

    Default

    Sorry. My bad. I was using an older version...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •