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
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
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
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
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
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
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
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
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
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
10 matches
Mail list logo