]> source.dussan.org Git - vaadin-framework.git/commitdiff
Split Filtering and page requests to different RPC calls
authorTeemu Suo-Anttila <teemusa@vaadin.com>
Fri, 15 Jan 2016 12:49:25 +0000 (14:49 +0200)
committerHenri Sara <hesara@vaadin.com>
Fri, 4 Mar 2016 08:02:13 +0000 (08:02 +0000)
Change-Id: I6c0a25f73ba98bf73f1df8382769aed98c3adc11

client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java
server/src/com/vaadin/ui/ComboBox.java
shared/src/com/vaadin/shared/ui/combobox/ComboBoxServerRpc.java

index b20fa851c7ce8a9d3f25732bbfeb9f6cd56a8b85..4b739cd85d5debc4974af99fba2b0acddd9f7016 100644 (file)
@@ -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();
     }
 
index 1c43e7235276d9d6a59fb95fb87fd0e92e744e20..041803ca33d7cd3aa0d205d33337139ad8770fa9 100644 (file)
@@ -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();
         }
     };
 
index 863aadcbcdb0508bd74b889c7ae10b46e16999bb..69fbbf25518a6d425c3025b3ee63f618920ff36d 100644 (file)
@@ -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);
 }