myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From we...@apache.org
Subject [myfaces-tobago] branch tobago-4.x updated: TOBAGO-703 - sheet paging should adjust scroll position
Date Tue, 15 Sep 2020 12:33:50 GMT
This is an automated email from the ASF dual-hosted git repository.

weber pushed a commit to branch tobago-4.x
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git


The following commit(s) were added to refs/heads/tobago-4.x by this push:
     new eb4c5a2  TOBAGO-703 - sheet paging should adjust scroll position
eb4c5a2 is described below

commit eb4c5a204eeb6e9a121ff7baf645ce0d5167e95c
Author: Volker Weber <v.weber@inexso.de>
AuthorDate: Tue Sep 15 14:33:43 2020 +0200

    TOBAGO-703 - sheet paging should adjust scroll position
---
 .../apache/myfaces/tobago/internal/component/AbstractUISheet.java    | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheet.java
b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheet.java
index 83cdfbb..cdbfbef 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheet.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheet.java
@@ -34,6 +34,7 @@ import org.apache.myfaces.tobago.layout.Measure;
 import org.apache.myfaces.tobago.layout.MeasureList;
 import org.apache.myfaces.tobago.layout.ShowPosition;
 import org.apache.myfaces.tobago.model.ExpandedState;
+import org.apache.myfaces.tobago.model.ScrollPosition;
 import org.apache.myfaces.tobago.model.SelectedState;
 import org.apache.myfaces.tobago.model.SheetState;
 import org.apache.myfaces.tobago.renderkit.RendererBase;
@@ -534,7 +535,8 @@ public abstract class AbstractUISheet extends AbstractUIData
     if (LOG.isDebugEnabled()) {
       LOG.debug("action = '" + pageEvent.getAction().name() + "'");
     }
-
+    ScrollPosition scrollPosition = getState().getScrollPosition();
+    scrollPosition.setTop(0);
     switch (pageEvent.getAction()) {
       case first:
         first = 0;
@@ -542,6 +544,7 @@ public abstract class AbstractUISheet extends AbstractUIData
       case prev:
         first = getFirst() - getRows();
         first = first < 0 ? 0 : first;
+        scrollPosition.setTop(Integer.MAX_VALUE);
         break;
       case next:
         if (hasRowCount()) {


Mime
View raw message