I had the same thought when using MVP for a form and wanting to
disable the submit button after it's clicked. I ended up adding disable
() and enable() methods on my view interface so that the view
implementation (which knows it's dealing with a Button, not just a
HasClickHanders) can do whatever is appropriate. This doesn't seem too
bad to me. From the presenter's point of view, it wants to be able to
disable the form. It's then the view's responsibility to know what
that entails, which now that I think about it should probably also
include disabling the form fields.
Dealing with things like FocusWidget and DateBox may be a little bit
different; you didn't mention why you wanted to set the enabled status
on them. However, thinking about the problem from the presenter's
point of view may still be helpful. Rather than the presenter being
concerned with enabling and disabling individual widgets, give a name
to what the presenter is trying to accomplish and let the view decide
how to satisfy the requirement.
-Brian
On Nov 23, 12:27 pm, Norman Maurer <
nor...@apache.org> wrote:
> Yes, such an interface would be really nice for MVP .
>
> Bye
> Norman
> 2009/11/23, Michel Daviot <
mdav...@gmail.com>: