Reputation: 3609
Can someone tell me what component in MVP - Supervising Controller variation has the responsibility for implementing logic related to the enablement/disablement of UI elements?
For example, I have a view that has a checkbox and a number of textboxes. Now 2 of the text boxes should only be enabled if the checkbox is checked.
Should the logic to control this be the responsibilty of the presenter or the model?
Upvotes: 1
Views: 1528
Reputation: 4521
Supervising Controller assumes that
So basically in order to find responsible component you need to identify who has enough information to do the update. If checked state of checkbox is directly mapped to Model then View is the right place to do it through data binding. If on the other hand the state is calculated by presenter as a result of reacting to user interaction then you can update View from Presenter.
Upvotes: 2