Touchkit, NavigationManager and TabBarView

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.

Hi,
I tried the snippets you posted and I see a single tab with a NavigationView containing a “Hello world” label. What do you have visible or how it doesn’t function?

The code above does work.

This actually turned out to be a rendering issue of all absurd things. I was developing in a vmware (macbook with fusion running windows 7 in a vmware), and apparently there are issues with that and graphical rendering, so I had to fiddle with flags for hardware accelerated rendering in fusion and it all started to work. It could render a NavigationView, but once you put a NavigationView inside a NavigationManager the graphical rendering messed all up. With the correct settings I got the graphics working, really bizarre error.