diff options
3 files changed, 11 insertions, 6 deletions
diff --git a/server/src/com/vaadin/Application.java b/server/src/com/vaadin/Application.java index e4e49391bb..9498534b4a 100644 --- a/server/src/com/vaadin/Application.java +++ b/server/src/com/vaadin/Application.java @@ -185,6 +185,11 @@ public class Application implements Terminal.ErrorListener, Serializable { throw new IllegalStateException( "mainWindow is attached to another application"); } + if (UI.getCurrent() == null) { + // Assume setting a main window from Application.init if there's + // no current UI -> set the main window as the current UI + UI.setCurrent(mainWindow); + } this.mainWindow = mainWindow; } diff --git a/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.html b/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.html index d48ab220b5..47e766e76a 100644 --- a/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.html +++ b/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.html @@ -19,7 +19,7 @@ <tr> <td>assertText</td> <td>vaadin=runcomvaadintestsapplicationRefreshStatePreserve::/VVerticalLayout[0]/ChildComponentContainer[1]/VLabel[0]</td> - <td>Root id: 0</td> + <td>UI id: 0</td> </tr> <tr> <td>open</td> @@ -29,7 +29,7 @@ <tr> <td>assertText</td> <td>vaadin=runcomvaadintestsapplicationRefreshStatePreserve::/VVerticalLayout[0]/ChildComponentContainer[1]/VLabel[0]</td> - <td>Root id: 0</td> + <td>UI id: 0</td> </tr> <tr> <td>runScript</td> @@ -44,7 +44,7 @@ <tr> <td>assertText</td> <td>vaadin=runcomvaadintestsapplicationRefreshStatePreserve::/VVerticalLayout[0]/ChildComponentContainer[1]/VLabel[0]</td> - <td>Root id: 0</td> + <td>UI id: 0</td> </tr> </tbody></table> diff --git a/uitest/src/com/vaadin/tests/components/richtextarea/RichTextAreaScrolling.java b/uitest/src/com/vaadin/tests/components/richtextarea/RichTextAreaScrolling.java index f88ed0c67c..66b5a9e08a 100644 --- a/uitest/src/com/vaadin/tests/components/richtextarea/RichTextAreaScrolling.java +++ b/uitest/src/com/vaadin/tests/components/richtextarea/RichTextAreaScrolling.java @@ -32,9 +32,9 @@ public class RichTextAreaScrolling extends TestBase { RichTextArea second = new RichTextArea("Full height"); RichTextArea third = new RichTextArea("Undefined height"); - first.setValue(sb); - second.setValue(sb); - third.setValue(sb); + first.setValue(sb.toString()); + second.setValue(sb.toString()); + third.setValue(sb.toString()); first.setReadOnly(true); second.setReadOnly(true); |