SuggestBox MVP problem

2009-12-21 Thread FKereki
Hi! Trying to work with a SuggestBox field and MVP, I found a problem. You can getSuggestOracle(...) but you cannot set an oracle unless you do it through its constructor, and this asymmetry poses a problem. In MVP, the View shouldn't deal with the oracle complexity; its logic should be a Presente

Re: SuggestBox MVP problem

2010-01-12 Thread 4F2E4A2E
this is so annoying! i cant bind my suggestBox to the view... is there any hope for this beeing fixed? or is suggestionBox just not supported? -- 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-t

Re: SuggestBox MVP problem

2009-12-21 Thread Matt Moriarity
The way I was planning on handling this is allowing dependency injection (GIN) to create the oracle and inject that into the view's constructor. On Dec 21, 7:03 am, FKereki wrote: > Hi! Trying to work with a SuggestBox field and MVP, I found a problem. > You can getSuggestOracle(...) but you cann

Re: SuggestBox MVP problem

2009-12-21 Thread FKereki
If I understand it correctly, that poses a chicken-and-egg problem, because the Presenter constructor requires a View, and the View constructor would require something created by the Presenter? With MVP, I first create a View, and then inject it into the Presenter. If the View requires an oracle, t

Re: SuggestBox MVP problem

2009-12-21 Thread Paul Robinson
Another option is to create a SuggestOracle subclass that delegates method calls to another object (perhaps another oracle). Make the first oracle have get/set methods to set the delegatee. FKereki wrote: > If I understand it correctly, that poses a chicken-and-egg problem, > because the Presente

Re: SuggestBox MVP problem

2009-12-21 Thread Nathan Wells
The way (I think) we do it is our View has a method: HasText getSuggestBox(SuggestOracle oracle) { if (oracle != this.oracle || this.suggestBox == null) //create a new suggest box with the oracle createOrReplaceSuggestBox(oracle); } return suggestBox; } This way ever

Re: SuggestBox MVP problem

2009-12-21 Thread Matt Moriarity
The way I'm doing it will be to have the dependency injection framework create a SuggestOracle. Then have the view be injected with that oracle: @Inject MyView(MySuggestOracle oracle) { this.suggestBox = new SuggestBox(oracle); ... } Seems like a fairly simple solution, and does not require

Re: SuggestBox MVP problem

2009-12-21 Thread FKereki
Matt Moriarity's idea suggested another possibility: using @UiField (provided=true) and using a Factory method to actually deliver the widget to the view. I'll give it a bit more thinking; I want to make sure testing is still simple. -- You received this message because you are subscribed to the

Re: SuggestBox MVP problem

2011-06-02 Thread Myth17
facing the same problem. what should be the best way around? -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/ZWgyTjRMZ2VGSjRK. To post to this g

Re: SuggestBox MVP problem

2011-06-02 Thread Myth17
I am trying to make a TextBox in the view and wrap it in Suggestbox in presenter. However my suggestbox wont show any suggestion. :( why isnt a "set" method availaible? :| -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To view this disc