Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
  1. Create a new view, e.g. CustomerView   and add a few UI components.
  2. Add a button in MainView and register a buttonClickHandler event.
  3. In the code view, move the cursor under the generated Button.ClickEvent Handler. 
  4. Under Palette click Navigation.
  5. In the following Navigation wizard, under View to open, select Customer View out.
  6. In the URL field, enter a sub path (URI) through which the view is to be accessible at runtime, e.g. customer.

...

Code Block
languagejava
themeConfluence
private void button_buttonClick(Button.ClickEvent event) {
	Navigation.to("customer").navigate();
}
Note:
  • If the view that is to be called is not yet registered in the Navigator, it will be automatically registered by the wizard. 
  • Only views that are registered in the Navigator can be invoked using the Navaigation.to() method. 
  • The Navigation wizard works bidirectionally. By clicking the  icon in the code editor, you can reopen the Navigator wizard.

...

  • In the current view

    Code Block
    languagejava
    themeConfluence
    private void button_buttonClick(Button.ClickEvent event) {
    	Navigation.to("customer").parameter("username", username).navigate();
    		 
    	}


  • In the invoked view - When the parameters that are to be passed are saved, they are automatically defined in the target class.

    Code Block
    languagejava
    themeConfluence
    @NavigationParameter
    	private String username;
    /**
     * 
     */
    public CustomerView() {
    	super();
    	this.initUI();
    }
    
    @Override
    public void enter(ViewChangeListener.ViewChangeEvent event) {
    	super.enter(event);
    
    	this.username = Navigation.getParameter(event, "username", String.class);
    }


Note:
  • Any variables, method calls, and objects; e.g., UI components, can be used as parameters..
  • The parameters are passed via the session array.
  • Strings must be enclosed in quotes.
  • The arguments that are deleted later in the Navigation wizard are not automatically deleted in the invoked view.

...