Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

TUTORIALVaadin lets you build secure, UX-first PWAs entirely in Java.
Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Calling javascript synchronously by Enver Haase, 4 weeks ago
Navigator Problem
Hi
I am using navigator add-on for navigation from one screen to another. My problem is when I navigate to another screen by clicking on the menu item and again return back to the previous screen, the changes made to the screen remains as it is, that is it does not reset. What can i do to reset the screen each and every time I open the screen. My code to wire up navigation is as shown:
for (final Class viewClass : new Class[] { Dashboard.class,
Editor.class, Ticket.class, MockupView.class }) {
navigator.addView(viewClass.getSimpleName(), viewClass);
menu.addItem(viewClass.getSimpleName(), new MenuBar.Command() {
public void menuSelected(MenuItem selectedItem) {
navigator.navigateTo(viewClass);
}
});
}
And my View class is as shown:
public class Ticket extends HorizontalLayout implements Navigator.View
public void init(Navigator navigator, Application application) {
this.initializePanel();
}
public void navigateTo(String requestedDataId) {
if (requestedDataId == null) {
navigatorDetails.setVisible(false);
} else {
navigatorDetails.setVisible(true);
navigatorDetails.setCaption("Ticket #" + requestedDataId);
}
}
public String getWarningForNavigatingFrom() {
return null;
}
Please correct me if i have made any mistake and give me a solution.
Last updated on Feb, 13th 2012
You cannot reply to this thread.