Hi everyBody,

I want to transfer an object from an activity to another one, for that i 
used the event bus:

1. i created an event "AddSoumissionEvent"  and handler 
"AddSoumissionHandler" 
2.intialise the eventbus of the first activity with the eventBus offered in 
the start Function

 


 public void start(AcceptsOneWidget containerWidget, EventBus eventBus) {
>          
>         this.eventBus=eventBus;
>                 .......
>
> }
>


 

3.i  fire event in the first activity

public void createSoumission(DynamicForm form) {
>  
>         //create soumission
>
>             Soumission soumission=new Soumission();
>
>           
>            //initialize values
>         ................
>          //fire event
>
>             eventBus.fireEvent(new AddSoumissionEvent(soumission));
>         
>     }
>
>

4. the second activity receive the event ,i created the handler in in start 
funtion



public void start(AcceptsOneWidget container, EventBus eventBus) {
>
>
> eventBus.addHandler(AddSoumissionEvent.TYPE, new AddSoumissionHandler(){
>
>               public void onAddSoumissionHandler(AddSoumissionEvent event) 
> {
>                   System.out.println(" event received youpiiii");
>                   onAddSoum();
>                    
>               }
>               
>               
>           });
>
> }
>


the problem is the second activity doesn't receive the event :( i can't see 
where is the mistake .

can anyone here tell me where is the mistake or give me a link for an 
example who shows how to use the eventBus with activities and places

Thank you,










-- 
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+unsubscr...@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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to