In my Display interface, I included a method like Widget getWidgetView();
which (interestingly enough) returns a widget view of the display object. this eliminates your casting problem, while still maintaining a degree of anonymity for the Display interface. On the command pattern thing, I created a project to work through what I thought I was seeing. You can see it at http://code.google.com/p/gwt-command-pattern/ Let me know if you have some suggestions on how to fix the issues I describe there. Thanks, On Jun 29, 4:43 pm, Thomas Broyer <t.bro...@gmail.com> wrote: > On 29 juin, 23:13, Daniel Jue <teamp...@gmail.com> wrote: > > > > > > > Does anyone have a working MVP/Eventbus sample of something simple > > like the PhoneEditor? > > I don't think I'm doing it right. The code from the IO presentation > > leaves out enough details so that I'm not sure what to do. > > For instance, in my Presenter.class, > > > I have something like this: > > public class Presenter { > > ... > > private Display display; > > interface Display { > > HasClickHandlers getSaveButton(); > > HasClickHandlers getCancelButton(); > > HasClickHandlers getNumberField(); > > HasClickHandlers getLabelPicker(); > > } > > Slide 59 shows getNumberField and getLabelPicker as HasValue<String>, > not HasClickHandler (and Ray says that ListBox doesn't actually > implement HasValue<String> but it's quite easy to make a > HasValue<String> for a ListBox). > > > void editPhone(Phone phone) { > > this.phone = Phone.from(phone); > > display.getNumberField().setValue(phone.getNumber()); > > display.getLabelPicker().setValue(phone.getLabel()); > > } > > ...} > > > Obviously, a HasClickHandlers object doesn't have a setValue method. > > It doesn't feel like I should be casting to the widget here, since we > > went through all the trouble of using the Display interface. > > http://code.google.com/intl/fr-FR/events/io/sessions/GoogleWebToolkit... --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---