Comments (5)
This is the expected behavior as described
[http://code.google.com/p/mvp4g/wiki/PresenterViewService#Event_Generation
here]. The 'handlers' attribute isn't supposed to generate any handler, you
need to use the 'generate' attribute.
Original comment by [email protected]
on 23 Jul 2012 at 11:19
from mvp4g.
First, i've misunderstood how the singleton presenter is instantiated on Mvp4g.
- It's not instantiated when the event is fired but the application starts.
- The "handler" attribute has nothing to do with instantiation.
- The "multiple=true" attribute effectively disables the automatic
instantiation on startup.
- The "generate" attribute is used to create new instance for the multiple
presenter whenever the event is fired.
So the issue can be rejected in this regard.
However, there's another aspect concerning this issue.
- Supposing that the createOne event would be fired before the createMany
event. The question is how to make sure that only one instance is created when
the createOne event is fired?
- It might be done by calling #addHandler before firing the createOne event
below,
if(!instantiated){
eventBus.addHandler(MP.class);
instantiated=true;
}
@Event(handler = MP.class)
void createOne();
@Event(generate = MP.class)
void createMany();
@Presenter(multiple = true ...)
public class MP ...
Can we achieve it simply via annotation?
Original comment by [email protected]
on 24 Jul 2012 at 7:38
from mvp4g.
If you want a single instance, then you shouldn't use multiple instance. If you
concern about instantiating presenters at start, you should use Lazy Presenter
to build your presenter/view only the first time it has to handle an event.
Original comment by [email protected]
on 25 Jul 2012 at 2:43
from mvp4g.
Thanks! Let's close this issue and discuss the derived use case on the forum.
i'll try to either formulate it more convincing or refactor the solution more
feasible.
Original comment by [email protected]
on 25 Jul 2012 at 6:59
from mvp4g.
Original comment by [email protected]
on 6 Sep 2013 at 4:36
- Changed state: Done
from mvp4g.
Related Issues (20)
- Feature Request -- GWT 2.5 Closure Compiler (optional flag set) HOT 1
- Multiple presenter failed to inject itself to the enclosed reverse view HOT 8
- Error when running my project which is upgraded from GWT 2.4 to GWT 2.5 HOT 4
- GWT dev-mode ignores @Singleton for views, but production mode works HOT 3
- Support on checked exceptions for events HOT 1
- Could not work with google-gin 2.0 HOT 22
- Error should be thrown if historyOnStart is set to true for child module. HOT 1
- Enable setting a loader for root module HOT 2
- Use of historyConvertor overrides navigationEvent = false in @Event annotation HOT 4
- Splitter, ReverseResizeComposite, and LazyPresenter/View NullPointer HOT 5
- @History annotation propagation
- Child module is not passing through parent filter HOT 1
- Mvp4g with Deferred Binding not creating expected rebind results HOT 2
- Patch for update mvp4g for last gin 2.1.1 and gwt 2.5.1 HOT 2
- Multiple Presenter, Multiple module HOT 2
- NavigationConfirmation is triggered after History has been updated HOT 1
- mvp4g can't be build with GWT 2.7 HOT 1
- GWT exporter cast exception from GWT.create; Tried to use mvp4g with GWT-Exporter but GWT.create didn't work HOT 4
- mvp4g for native app. HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mvp4g.