Hi.
I am new to Vaadin and stuck at one place.
I have a button and I need when i click on this button, the URI will change and when the URI fragment is given, use it to click this button.
This is my code:
public class HeaderPanel extends HorizontalLayout implements
Button.ClickListener, CitySelectedListener {
private Button moduleDeployer;
public HeaderPanel() {
final UriFragmentUtility fragment = new UriFragmentUtility();
moduleDeployer = new Button("Deploy module");
addComponent(moduleDeployer);
addConponent(fragment);
moduleDeployer.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 1L;
@Override
public void buttonClick(ClickEvent event) {
//Set the Uri Fragment when the button is clicked (It's OK)
fragment.setFragment(moduleDeployer.getCaption());
BlackboardUtil.fire(new ServiceSelectedEvent(
new ModuleDeployer()));
}
});
//When the URI Fragment is given, ... (It's not run)
fragment.addListener(new FragmentChangedEvent source) {
String uri = source.getUriFragmentUtility().getFragment();
if(uri!=null && uri == moduleDeployer.getCaption()) {
BlackboardUtil.fire(new ServiceSelectedEvent(
new ModuleDeployer()));
}
}
}
}
Can somebody help on this ?