I have a view and inside her I have a tabsheet, in this tabsheet I have 3 or 7(depends
if I have a parameter or not) components(one tab each) so I one of that tabs I have a button to open a window and in this opened window I have another button when clicked publish one event in my EventBus.
So in my view I create a ViewEventBus
@Autowired
private EventBus.ViewEventBus eventBus;
@PostConstruct
private void register(){
eventBus.subscribe(this);
}
in the opened window I create a viewEventbus
private EventBus.ViewEventBus eventBus;
public MyWindow(){
this.eventBus = BeanLocator.find(EventBus.ViewEventBus.class);
}
private void myButtonclick(){
this.eventBus.publish(this, new ProtocoloEvent.CarimboAtualizado(editor.getValue()));
}
The problem is when my viw receive the event the tabsheet was with only 3 components and not 7.
Obs. When I enter in view to the first time I navigate to (http://myapp.com/class) I only add 3 components (in one of this comp I have a button when clicked I save a number to this class and navigate to the same view but passing a parameter (http://myapp.com/class/23) in that moment I put the 7 components in my tabshee)
so when I receive the eventbus is just like I was saved in the eventBus the first time I enter in view