aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <teemusa@vaadin.com>2016-01-15 14:49:25 +0200
committerHenri Sara <hesara@vaadin.com>2016-03-04 08:02:13 +0000
commiteca0b72f697b3e79690c2dc02014ad7953edd6cd (patch)
treeeea43707e2d499cc8ffbcc3bc701782d64dc8ccb
parentd8c49d8cfeb4b392bf49bfd116d2bcf4476ed650 (diff)
downloadvaadin-framework-eca0b72f697b3e79690c2dc02014ad7953edd6cd.tar.gz
vaadin-framework-eca0b72f697b3e79690c2dc02014ad7953edd6cd.zip
Split Filtering and page requests to different RPC calls
Change-Id: I6c0a25f73ba98bf73f1df8382769aed98c3adc11
-rw-r--r--client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java4
-rw-r--r--server/src/com/vaadin/ui/ComboBox.java13
-rw-r--r--shared/src/com/vaadin/shared/ui/combobox/ComboBoxServerRpc.java24
3 files changed, 39 insertions, 2 deletions
diff --git a/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java b/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java
index b20fa851c7..4b739cd85d 100644
--- a/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java
+++ b/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java
@@ -308,7 +308,9 @@ public class ComboBoxConnector extends AbstractFieldConnector implements
* the page number to get
*/
public void requestPage(String filter, int page) {
- rpc.requestPage(filter, page);
+ rpc.setFilter(filter);
+ // TODO: Replace with a DataSource ensureAvailability call.
+ rpc.requestPage(page);
afterSendRequestToServer();
}
diff --git a/server/src/com/vaadin/ui/ComboBox.java b/server/src/com/vaadin/ui/ComboBox.java
index 1c43e72352..041803ca33 100644
--- a/server/src/com/vaadin/ui/ComboBox.java
+++ b/server/src/com/vaadin/ui/ComboBox.java
@@ -105,16 +105,27 @@ public class ComboBox extends AbstractSelect implements
}
@Override
+ @Deprecated
public void requestPage(String filter, int page) {
+ setFilter(filter);
+ requestPage(page);
+ }
+
+ @Override
+ public void setFilter(String filter) {
filterstring = filter;
if (filterstring != null) {
filterstring = filterstring.toLowerCase(getLocale());
}
+ }
+
+ @Override
+ public void requestPage(int page) {
currentPage = page;
// TODO this should trigger a data-only update instead of a full
// repaint
- requestRepaint();
+ markAsDirty();
}
};
diff --git a/shared/src/com/vaadin/shared/ui/combobox/ComboBoxServerRpc.java b/shared/src/com/vaadin/shared/ui/combobox/ComboBoxServerRpc.java
index 863aadcbcd..69fbbf2551 100644
--- a/shared/src/com/vaadin/shared/ui/combobox/ComboBoxServerRpc.java
+++ b/shared/src/com/vaadin/shared/ui/combobox/ComboBoxServerRpc.java
@@ -48,6 +48,30 @@ public interface ComboBoxServerRpc extends ServerRpc {
* mode
* @param page
* zero based page number
+ * @deprecated method split to two separate parts, see
+ * {@link ComboBoxServerRpc#setFilter(String)} and
+ * {@link ComboBoxServerRpc#requestPage(int)}
*/
+ @Deprecated
public void requestPage(String filter, int page);
+
+ /**
+ * Sets a filter to the server-side data source.
+ *
+ * @param filter
+ * filter string interpreted according to the current filtering
+ * mode
+ * @since
+ */
+ public void setFilter(String filter);
+
+ /**
+ * Request the server to send a page of the item list. This request will get
+ * results filtered by filter string given with
+ * {@link ComboBoxServerRpc#setFilter(String)}
+ *
+ * @param page
+ * zero based page number
+ */
+ public void requestPage(int page);
}