I’m just starting to use the Touchkit and right now I’m playing around with the Vornitologist tutorial. One thing that I can’t seem to get is how the NavigationManager is supposed to work, likely I’m missing something simple.
Creating a simple navigation view:
public class MyView extends NavigationView {
@Override
public void attach() {super.attach(); buildView();}
public void buildView(){
CssLayout content = new CssLayout();
content.setWidth("100%");
Label test = new Label("Hello World!");
content.addComponent(test);
setContent(content);}
And a navigation manager:
public class MyNavManager extends NavigationManager {
public MyNavManager(){
navigateTo(new MyView());
}
In a TabBarView I have the following:
myView = new MyNavManager();
Tab addTab = addTab(myView);
addTab.setIcon(new ThemeResource("icons/menuicon.png"));
addTab.setCaption("My View");
To me this looks to be the core of what’s happening in the Vornitologist application, but I must be missing something - because it doesn’t work. I get the tab bar to be drawn correctly, but when I click the button nothing happens and there are no trace dumps.
If I switch the line
myView = new MyNavManager();
to
myView = new MyView();
it starts woking as expected.
So, what do I need to do in order to add a NavigationManager to the TabBarView and get it to function as does a NavigationView? I can’t seem to figure that out based on the tutorial or by googling it.