On 25 oct, 01:56, "fker...@gmail.com" <fker...@gmail.com> wrote:
> Hi! Thinking about MVP... how would you implement a data aware drop
> down widget?
>
> Say you want to let the user enter a country code in the View. You
> could use a TextBox, but a drop down list would be more usable. How
> would the widget get its values? Should the Presenter know about the
> widget type, contact the server, get the countries data, and then
> "feed" the widget?

Know about the "widget type", in the sense of "Java class", no, but
knowing how it works (suggestbox) yes, definitely.

However, I'm puzzled. I'm facing the same "issue" at work, and I was
envisioning just injecting the SuggestOracle into the view (I'm using
DI with GIN so it's pretty simple and easy); so effectively my
presenter wouldn't be aware of the "widget type"; but this approach
prevents the presenter from telling the view to show/hide a "loading"
label/image (if that's how you do it otherwise)

> Doesn't that somehow violate the rule that you
> should be able to change the view without having to change the
> Presenter?

Would you really change the view one day without changing the
presenter? Try not to over-engineer (personnal rule of thumb).
--~--~---------~--~----~------------~-------~--~----~
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-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to