Reputation: 142
In my application I have tow screens with two modes. Create & View. Create is a form style one and view is a tabular(Grid in new flow component). Since the two pages have the view page in same format, I created a generic page and assigning routes dynamically on the view icon click. But issue is that it renders the first page always. I suspect, new instance of the view is not being generated.
This is the view rendered while clicking on CurrencyMenu View icon
This is the view rendered while clicking on Country Menu View icon
As you can see the views are the same. I am dynamically assigning routes at time of adding the tab.
RouteConfiguration.forSessionScope().setRoute(routeURL + "/" + RouteNames.ROUTE_VIEW, ViewPageUI.class, MainView.class);
I wanted to render the same page with different data for multiple routes. In other words, multiple instances of view page.(As per my understanding).
Thanks in advance.
Upvotes: 1
Views: 435
Reputation: 1822
It sounds like what you want is two views that extend from a common super class. Then you can define the routes using @Route
on the classes instead of adding dynamic routing when you do not really need it (less complexity is always better)
Upvotes: 1