baluba
04-22-2008, 06:51 AM
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.
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.