Results 1 to 5 of 5

Thread: GXT Beta 4: Changes to SelectionChangedListener

  1. #1
    Ext User
    Join Date
    Apr 2008
    Location
    Munich, Germany
    Posts
    43
    Vote Rating
    0
      0  

    Question GXT Beta 4: Changes to SelectionChangedListener

    Hi Darrell,

    why is it that the former existing interface SelectionChangedListener is now replaced by the concrete class SelectionChangedListener (which implements the interface Listener<SelectionChangedEvent<ModelData>>)?
    Until now, my views implemented the Interface SelectionChangedListener to react on any changes (let's say in tables), which was IMO quite convenient. Or was this the wrong approach? What's the idea behind it?

    Thanks for clarification,
    Flo~

  2. #2
    Ext User
    Join Date
    Apr 2008
    Location
    Munich, Germany
    Posts
    43
    Vote Rating
    0
      0  

    Default

    My other approach would be to let the View implement Listener<SelectionChangedEvent<M>>. But unfortunatelly, the StoreBinder expexts an instance of the SelectionChangedListener!
    Code:
      
    public void addSelectionChangedListener(SelectionChangedListener listener) {
        addListener(Events.SelectionChange, listener);
      }
    I suggest to change the signature of the method to something like
    Code:
      public void addSelectionChangedListener(Listener<SelectionChangedEvent<M>> listener) {
        addListener(Events.SelectionChange, listener);
      }

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

    Default

    I am considering changing my Implementations of SelectionChangedListener<M> to inner classes that extend SelectionChangedListener, but IMHO this is not as nice as it was before. Are there any best practices on how to solve this best? Darell, maybe you can provide us with insight on why this has been changed and what are its advantages?

    Thanks a lot in advance,
    Joachim

  4. #4
    Ext User
    Join Date
    May 2008
    Posts
    105
    Vote Rating
    0
      0  

    Default

    +1

    At least the SelectionChangedListener should be made abstract so my IDE can automatically create a body for the anonymous class.

  5. #5
    Ext User
    Join Date
    Apr 2008
    Location
    Munich, Germany
    Posts
    43
    Vote Rating
    0
      0  

    Default

    Any new opinions about the discussion "SelectionChangedListener"?

Posting Permissions

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