Navigator ViewProvidor

Hi All,

ist ther a good totorial on how to implement a ViewProvider in your own Navigator class.

I only can find the example in the Dashboard example.

thanks
Gerald

Hey Gerald,

I’m not aware of any tutuorial for writing viewprovider class, digging in to vaadin source code gives you very good insight on this works…

Anyway if you wish to have one more sample implementation, I have written one vVewprovider for my tutorial series on Vaadin grid to make things easy for me. Here is the
link
to the same. Hope this gives you a fair idea on how to write your own ViewProvider. Please let me know in case you require additional help

Thanks,
Krishna.

There is
this simple example
, but it really depends a lot in what kind of view provider you want. You could also look at the built-in view providers in Vaadin (which handle one view instance by each provider instance). There’s also a CDIViewProvider in the Vaadin CDI add-on.

Hi Krishna,
thanks for your help. Indeed I could use your link to understand how ViewProviders are working.
Great help, very much appriciated.

Gerald

Thanks for the examples. Very helpful to understand how ViewProviders work. Currently I have just a couple of views and add them directly to the navigator, which in my understanding also uses a StaticViewProvider. I don’t see the advantage of using a (custom) ViewProvider in my case. Can you help me out?

HI Dirk,
I think, when you only have a view Views, and you know them from the beginning. than this is OK, I would say.
In my case I am using a Database to read out the view name, and therefore I would need a more dynamic way. That was the reason to look into a ViewProvider from my end.

Gerald