Browse Source

Add note about dependency injection in BrowserWindowOpener JavaDocs (#11495)

If BrowserWindowOpener is used with constructor using Class<? extends UI> as parameter, it will have UI provider with generated url. This will not match UI beans in contextual storage and hence newly created UI will not be managed bean. Due this, injection to new UI instance will not happen. If you are using CDI , BrowserWindowOpener(String) constructor needs to be used.
tags/8.8.0.beta1
Tatu Lund 5 years ago
parent
commit
f11ea958cc
1 changed files with 11 additions and 1 deletions
  1. 11
    1
      server/src/main/java/com/vaadin/server/BrowserWindowOpener.java

+ 11
- 1
server/src/main/java/com/vaadin/server/BrowserWindowOpener.java View File

@@ -70,7 +70,12 @@ public class BrowserWindowOpener extends AbstractExtension {
/**
* Creates a window opener that will open windows containing the provided UI
* class.
*
* <p>
* Note: The new UI instance will not work with dependency injection (CDI and
* Spring). Use {@link BrowserWindowOpener(String)} instead.
* {@code VaadinServlet.getCurrent().getServletContext().getContextPath()} gives
* the current context path.
*
* @param uiClass
* the UI class that should be opened when the extended component
* is clicked
@@ -82,6 +87,11 @@ public class BrowserWindowOpener extends AbstractExtension {
/**
* Creates a window opener that will open windows containing the provided UI
* using the provided path.
* <p>
* Note: The new UI instance will not work with dependency injection (CDI
* and Spring). Use {@link BrowserWindowOpener(String)} instead.
* {@code VaadinServlet.getCurrent().getServletContext().getContextPath()} gives
* the current context path.
*
* @param uiClass
* the UI class that should be opened when the extended component

Loading…
Cancel
Save