framework icon indicating copy to clipboard operation
framework copied to clipboard

View naming in Navigator API could be more 'statically typed'

Open vaadin-bot opened this issue 13 years ago • 5 comments

Originally by @emarc


In the new Navigator API, Views are registered using a string, and the API does not help in handling these. This is not ideal.

However, it's not clear how the problem could be adressed; the fragment will obviously always be a String.

One convenient practice is to add a static to each View: MyView.NAME, but this can't be APIfied.

Adding View.getViewName() would remove the need to tell the Navigator explicitly when adding instances, i.e navigator.addView(new MyView()), but would not work when adding classes as navigator.addView("name", MyView.class). One possibility is to provide all of addView(View), addView(String, View), addView(String, Class), where the latter two would 'override' getViewName() - this might be overly complex, though.


Imported from https://dev.vaadin.com/ issue #9057

vaadin-bot avatar Jun 28 '12 13:06 vaadin-bot

Originally by @jdahlstrom


IMO view identifiers should be completely separate from the actual views, to facilitate composability, reuse and eg. localization of URIs.

vaadin-bot avatar Jul 18 '12 15:07 vaadin-bot

Originally by @jdahlstrom


There should be navigateTo(Class<? extends View>) and navigateTo(View). If there are multiple view names mapping to the same View class or instance, the first one should be used to build the navigation state string.

vaadin-bot avatar Aug 30 '12 15:08 vaadin-bot

Originally by @jdahlstrom


Another option could be that addView() return a ViewMapping instance, representing a (viewname, view) pair that can be stored and subsequently used for navigation.

vaadin-bot avatar Aug 31 '12 16:08 vaadin-bot

Originally by @jdahlstrom


Deferring this for now. Needs more real-world usage experience and some careful design decisions.

vaadin-bot avatar Sep 07 '12 12:09 vaadin-bot

Hello there!

It looks like this issue hasn't progressed lately. There are so many issues that we just can't deal them all within a reasonable timeframe.

There are a couple of things you could help to get things rolling on this issue (this is an automated message, so expect that some of these are already in use):

  • Check if the issue is still valid for the latest version. There are dozens of duplicates in our issue tracker, so it is possible that the issue is already tackled. If it appears to be fixed, close the issue, otherwise report to the issue that it is still valid.
  • Provide more details how to reproduce the issue.
  • Explain why it is important to get this issue fixed and politely draw others attention to it e.g. via the forum or social media.
  • Add a reduced test case about the issue, so it is easier for somebody to start working on a solution.
  • Try fixing the issue yourself and create a pull request that contains the test case and/or a fix for it. Handling the pull requests is the top priority for the core team.
  • If the issue is clearly a bug, use the Warranty in your Vaadin subscription to raise its priority.

Thanks again for your contributions! Even though we haven't been able to get this issue fixed, we hope you to report your findings and enhancement ideas in the future too!

stale[bot] avatar Mar 21 '18 04:03 stale[bot]