summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorDenis Anisimov <denis@vaadin.com>2014-12-11 18:48:02 +0200
committerVaadin Code Review <review@vaadin.com>2016-05-19 09:37:26 +0000
commitfdab4ee8b35342c728fa3d0f7090d8a52ec89d67 (patch)
tree09f73fe542a4b8422253ef470287bbd7b0858175 /client
parent47eac3cd46dbacebdee52ef39c1d13a9224029f0 (diff)
downloadvaadin-framework-fdab4ee8b35342c728fa3d0f7090d8a52ec89d67.tar.gz
vaadin-framework-fdab4ee8b35342c728fa3d0f7090d8a52ec89d67.zip
Notify server side component about clicks in form layout (#6346).
Change-Id: Ia14a50aba17689b580bb265c9693c3ae503fee34
Diffstat (limited to 'client')
-rw-r--r--client/src/main/java/com/vaadin/client/ui/formlayout/FormLayoutConnector.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/client/src/main/java/com/vaadin/client/ui/formlayout/FormLayoutConnector.java b/client/src/main/java/com/vaadin/client/ui/formlayout/FormLayoutConnector.java
index 3f0b4345c4..39992d91a6 100644
--- a/client/src/main/java/com/vaadin/client/ui/formlayout/FormLayoutConnector.java
+++ b/client/src/main/java/com/vaadin/client/ui/formlayout/FormLayoutConnector.java
@@ -24,10 +24,12 @@ import com.vaadin.client.ComponentConnector;
import com.vaadin.client.ConnectorHierarchyChangeEvent;
import com.vaadin.client.LayoutManager;
import com.vaadin.client.TooltipInfo;
+import com.vaadin.client.Util;
import com.vaadin.client.WidgetUtil;
import com.vaadin.client.communication.StateChangeEvent;
import com.vaadin.client.ui.AbstractFieldConnector;
import com.vaadin.client.ui.AbstractLayoutConnector;
+import com.vaadin.client.ui.LayoutClickEventHandler;
import com.vaadin.client.ui.PostLayoutListener;
import com.vaadin.client.ui.VFormLayout;
import com.vaadin.client.ui.VFormLayout.Caption;
@@ -36,7 +38,9 @@ import com.vaadin.client.ui.VFormLayout.VFormLayoutTable;
import com.vaadin.client.ui.layout.ElementResizeEvent;
import com.vaadin.client.ui.layout.ElementResizeListener;
import com.vaadin.shared.ui.Connect;
+import com.vaadin.shared.ui.LayoutClickRpc;
import com.vaadin.shared.ui.MarginInfo;
+import com.vaadin.shared.ui.orderedlayout.AbstractOrderedLayoutServerRpc;
import com.vaadin.shared.ui.orderedlayout.FormLayoutState;
import com.vaadin.ui.FormLayout;
@@ -44,6 +48,26 @@ import com.vaadin.ui.FormLayout;
public class FormLayoutConnector extends AbstractLayoutConnector implements
PostLayoutListener {
+ /*
+ * Handlers & Listeners
+ */
+
+ private LayoutClickEventHandler clickEventHandler = new LayoutClickEventHandler(
+ this) {
+
+ @Override
+ protected ComponentConnector getChildComponent(
+ com.google.gwt.user.client.Element element) {
+ return Util.getConnectorForElement(getConnection(), getWidget(),
+ element);
+ }
+
+ @Override
+ protected LayoutClickRpc getLayoutClickRPC() {
+ return getRpcProxy(AbstractOrderedLayoutServerRpc.class);
+ }
+ };
+
private Map<ComponentConnector, String> oldMaxWidths = null;
private static final ElementResizeListener dummyFirstCellResizeListener = new ElementResizeListener() {
@@ -143,6 +167,7 @@ public class FormLayoutConnector extends AbstractLayoutConnector implements
public void onStateChanged(StateChangeEvent stateChangeEvent) {
super.onStateChanged(stateChangeEvent);
+ clickEventHandler.handleEventHandlerRegistration();
VFormLayoutTable formLayoutTable = getWidget().table;
formLayoutTable.setMargins(new MarginInfo(getState().marginsBitmask));