1. #1
    Ext User
    Join Date
    Apr 2008
    Posts
    18
    Vote Rating
    0
    baluba is on a distinguished road

      0  

    Default Improved ChangeListener management

    Improved ChangeListener management


    I think it would be useful to have the following methods on model objects:

    removeListeners()
    addListeners(List<ChangeListener>)
    setSilent(boolean) (or deactivateListeners)

    There are situations where many properties on model objects are updated, but you don't want the views to be notified on each property update.

    Since the BaseModel.notify() method now is public, the following sceneario would be useful:

    - Controller does RPC call and fetches lots of data
    - Controller silences the model object
    - Controller updates many props on the model object
    - Controller reactivates ChangeListeners on model object
    - Controller calls notify() with generic model update event to allow viewers to refresh themselves.

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

      0  

    Default


    You bring up some good use cases. Here is what I am doing:

    1. addChangeListener / removeChangeListener now use varargs. So you can add multiple listeners using the same method for adding a single listener. I prefer this over adding additional methods to the ChangeEventSource interface.

    2. I added a new removeChangeListeners method.

    2. I have added a setSilent method that enables / disables the firing of events.

    How does that sound? Changes will go out in the next rev.

  3. #3
    Ext User
    Join Date
    Apr 2008
    Posts
    18
    Vote Rating
    0
    baluba is on a distinguished road

      0  

    Default


    Sounds good Darrel, thanks!

    Now I only need to convince purchasing department in our enterprise to speed up purchasing Ext-GWT support, so I can get access to SVN trunk again....

Thread Participants: 1