lacking an interface with "setEnabled" method

2 views
Skip to first unread message

Michel Daviot

unread,
Nov 23, 2009, 9:37:09 AM11/23/09
to Google Web Toolkit
Hi,

I think an interface defining the setEnabled method is lacking. This
would be implemented in FocusWidget, DateBox ...

Norman Maurer

unread,
Nov 23, 2009, 12:27:20 PM11/23/09
to google-we...@googlegroups.com
Yes, such an interface would be really nice for MVP .

Bye
Norman
2009/11/23, Michel Daviot <mda...@gmail.com>:
> Hi,
>
> I think an interface defining the setEnabled method is lacking. This
> would be implemented in FocusWidget, DateBox ...
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To post to this group, send email to google-we...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-tool...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=.
>
>
>

Brian

unread,
Nov 24, 2009, 12:06:47 PM11/24/09
to Google Web Toolkit
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>:

SteveS

unread,
Nov 27, 2009, 11:17:08 PM11/27/09
to Google Web Toolkit
I ended up writing a bunch of small *Ext classes (TextBoxExt, etc.)
that implement some interfaces of my creation, HasEnablement (clunky
naming, I know) being one of them. I second the request that such an
interface be added to GWT.
Reply all
Reply to author
Forward
0 new messages