From 35372dc1d3ede9d2005ac8bda5d5a7e4f3aba98d Mon Sep 17 00:00:00 2001 From: Teemu Suo-Anttila Date: Fri, 9 Jan 2015 14:55:13 +0200 Subject: Add ItemClickEvents to Grid (#15449) Change-Id: I743f4de9fd11c5d81b11a3b8f2e0957293c5587c --- shared/src/com/vaadin/shared/ui/grid/GridConstants.java | 5 +++++ shared/src/com/vaadin/shared/ui/grid/GridServerRpc.java | 13 +++++++++++++ 2 files changed, 18 insertions(+) (limited to 'shared') diff --git a/shared/src/com/vaadin/shared/ui/grid/GridConstants.java b/shared/src/com/vaadin/shared/ui/grid/GridConstants.java index 994b109204..b36a162476 100644 --- a/shared/src/com/vaadin/shared/ui/grid/GridConstants.java +++ b/shared/src/com/vaadin/shared/ui/grid/GridConstants.java @@ -63,4 +63,9 @@ public final class GridConstants implements Serializable { * Default width for columns. */ public static final double DEFAULT_COLUMN_WIDTH_PX = -1; + + /** + * Event ID for item click events + */ + public static final String ITEM_CLICK_EVENT_ID = "itemClick"; } diff --git a/shared/src/com/vaadin/shared/ui/grid/GridServerRpc.java b/shared/src/com/vaadin/shared/ui/grid/GridServerRpc.java index 77eda7a2f6..c90a016383 100644 --- a/shared/src/com/vaadin/shared/ui/grid/GridServerRpc.java +++ b/shared/src/com/vaadin/shared/ui/grid/GridServerRpc.java @@ -17,6 +17,7 @@ package com.vaadin.shared.ui.grid; import java.util.List; +import com.vaadin.shared.MouseEventDetails; import com.vaadin.shared.communication.ServerRpc; import com.vaadin.shared.data.sort.SortDirection; @@ -34,4 +35,16 @@ public interface GridServerRpc extends ServerRpc { void sort(String[] columnIds, SortDirection[] directions, boolean userOriginated); + + /** + * Informs the server that an item has been clicked in Grid. + * + * @param rowKey + * a key identifying the clicked item + * @param columnId + * column id identifying the clicked property + * @param details + * mouse event details + */ + void itemClick(String rowKey, String columnId, MouseEventDetails details); } -- cgit v1.2.3