It is clearly stated in the JavaDoc of navigateTo:
/**
* Initialize new TopLevelWindow and replace current.
*
* @param topLevelWindowId target top level window id
* @deprecated Use {@link Screens#create(Class, Screens.LaunchMode)} with {@link OpenMode#ROOT}
*/
You may use Ctrl+Q shortcut to see JavaDoc when your cursor is set on navigateTo call:
Thank you for the response. I am now receiving the following error when I try that:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cuba_LinkHandler': Unsatisfied dependency expressed through field 'screens'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.haulmont.cuba.gui.Screens' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@javax.inject.Inject()}
Because I am extending LinkHandler which apparently is not at the presentation level, I cannot @Inject Screens. I had to use AppUI.getCurrent().getScreens() instead as follows: