I can't see in the code where you initialize your eventBus. I also can't see where you set it on your presenter.
-- I know that Eric K was saying that he doesn't fire events in his JUnit tests, instead he just calls the handler directly on the presenter and passes in the event.
On Tuesday, August 20, 2013 5:13:47 PM UTC-4, df wrote:
On Tuesday, August 20, 2013 5:13:47 PM UTC-4, df wrote:
HelloI want to initialize my widget by data. I sent by eventbus to them event indicating that there is new object. I tried to work with eventbus in 3 ways1:for(Unit unit : createTestData()){eventBus.fireEvent(new ScenarioElementEvent(new UnitStoreElement<Unit>(unit, null), ScenarioElementEventType.ADDED, ScenarioElementEventObjectType .GEO_OBJECT)); }2:Timer t = new Timer() {@Overridepublic void run() {List<Unit> units = createTestData();Console.log(Level.INFO,"Test data have " + units.size());for(int i = 0; i < units.size(); i ++){Unit unit = units.get(i);Console.log(Level.INFO,"Fire event " + i + " " + unit.getDescription());eventBus.fireEvent(new ScenarioElementEvent(new UnitStoreElement<Unit>(unit, null), ScenarioElementEventType.ADDED, ScenarioElementEventObjectType .GEO_OBJECT)); }}};t.schedule(1);3:List<Unit> units = createTestData();for(int i = 0; i < units.size(); i ++){final Unit unit = units.get(i);Console.log(Level.INFO,"Fire event " + i + " " + unit.getDescription());Timer t = new Timer(){@Overridepublic void run() {eventBus.fireEvent(new ScenarioElementEvent(new UnitStoreElement<Unit>(unit, null), ScenarioElementEventType.ADDED, ScenarioElementEventObjectType .GEO_OBJECT)); }};t.schedule(1);}}Only third works.First - no one handler is notifiedSecond - only one event is send.Can anybody say why?Thanks
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment