summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorTatu Lund <tatu@vaadin.com>2019-03-14 21:24:59 +0200
committerLeif Åstrand <legioth@gmail.com>2019-03-14 21:24:59 +0200
commitf11ea958cce7a3b273bc041e6a20a399dd23e6ac (patch)
tree021f50fa88cc23963db0c03f21e144bbb61d37ad /server
parent42c805a5faaa0b9c6442479d99489b7d2c682089 (diff)
downloadvaadin-framework-f11ea958cce7a3b273bc041e6a20a399dd23e6ac.tar.gz
vaadin-framework-f11ea958cce7a3b273bc041e6a20a399dd23e6ac.zip
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.
Diffstat (limited to 'server')
-rw-r--r--server/src/main/java/com/vaadin/server/BrowserWindowOpener.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/server/src/main/java/com/vaadin/server/BrowserWindowOpener.java b/server/src/main/java/com/vaadin/server/BrowserWindowOpener.java
index ebc31c06cc..0e59784d76 100644
--- a/server/src/main/java/com/vaadin/server/BrowserWindowOpener.java
+++ b/server/src/main/java/com/vaadin/server/BrowserWindowOpener.java
@@ -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