aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatti Tahvonen <matti.tahvonen@itmill.com>2007-03-30 12:31:09 +0000
committerMatti Tahvonen <matti.tahvonen@itmill.com>2007-03-30 12:31:09 +0000
commit2ba4dc422b7a054ded59e5dce59357d3c87b683e (patch)
treedc760a04b2da25bb733effe5eaf0e636253fb25a /src
parent1aad6b85494d77d841687ce1e8cef96c424f592d (diff)
downloadvaadin-framework-2ba4dc422b7a054ded59e5dce59357d3c87b683e.tar.gz
vaadin-framework-2ba4dc422b7a054ded59e5dce59357d3c87b683e.zip
Initial commit for #211
svn changeset:1070/svn branch:trunk
Diffstat (limited to 'src')
-rw-r--r--src/com/itmill/toolkit/terminal/web/AjaxApplicationManager.java10
-rw-r--r--src/com/itmill/toolkit/ui/Window.java1
2 files changed, 11 insertions, 0 deletions
diff --git a/src/com/itmill/toolkit/terminal/web/AjaxApplicationManager.java b/src/com/itmill/toolkit/terminal/web/AjaxApplicationManager.java
index 4662b4bd39..bf8bbf9629 100644
--- a/src/com/itmill/toolkit/terminal/web/AjaxApplicationManager.java
+++ b/src/com/itmill/toolkit/terminal/web/AjaxApplicationManager.java
@@ -56,6 +56,7 @@ import com.itmill.toolkit.terminal.DownloadStream;
import com.itmill.toolkit.terminal.Paintable;
import com.itmill.toolkit.terminal.URIHandler;
import com.itmill.toolkit.terminal.Paintable.RepaintRequestEvent;
+import com.itmill.toolkit.ui.AbstractComponent;
import com.itmill.toolkit.ui.Component;
import com.itmill.toolkit.ui.FrameWindow;
import com.itmill.toolkit.ui.Window;
@@ -280,6 +281,15 @@ public class AjaxApplicationManager implements Paintable.RepaintRequestListener,
}
}
+ // add meta instruction for client to set focus if it is set
+ Paintable f = (Paintable) application.consumeFocus();
+ if(f != null) {
+ paintTarget.startTag("meta");
+ paintTarget.startTag("focus");
+ paintTarget.addAttribute("pid", getPaintableId(f));
+ paintTarget.endTag("focus");
+ paintTarget.endTag("meta");
+ }
paintTarget.close();
out.flush();
diff --git a/src/com/itmill/toolkit/ui/Window.java b/src/com/itmill/toolkit/ui/Window.java
index 215a0c3d56..5da9560f42 100644
--- a/src/com/itmill/toolkit/ui/Window.java
+++ b/src/com/itmill/toolkit/ui/Window.java
@@ -696,6 +696,7 @@ public class Window extends Panel implements URIHandler, ParameterHandler {
* Focused component or null if none is focused.
*/
public void setFocusedComponent(Component.Focusable focusable) {
+ this.application.setFocusedComponent(focusable);
this.focusedComponent = focusable;
}