You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2020/09/15 12:43:37 UTC
[myfaces-tobago] branch master updated: TOBAGO-703 - sheet paging
should adjust scroll position
This is an automated email from the ASF dual-hosted git repository.
weber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git
The following commit(s) were added to refs/heads/master by this push:
new 5dd4472 TOBAGO-703 - sheet paging should adjust scroll position
5dd4472 is described below
commit 5dd44723641136e68e7d467b6c49fe45ee1f5f10
Author: Volker Weber <v....@inexso.de>
AuthorDate: Tue Sep 15 14:43:30 2020 +0200
TOBAGO-703 - sheet paging should adjust scroll position
---
.../org/apache/myfaces/tobago/internal/component/AbstractUISheet.java | 4 ++++
1 file changed, 4 insertions(+)
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 dc134eb..c2e9720 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;
@@ -519,6 +520,8 @@ public abstract class AbstractUISheet extends AbstractUIData
LOG.debug("action = '" + pageEvent.getAction().name() + "'");
}
+ ScrollPosition scrollPosition = getState().getScrollPosition();
+ scrollPosition.setTop(0);
switch (pageEvent.getAction()) {
case first:
first = 0;
@@ -526,6 +529,7 @@ public abstract class AbstractUISheet extends AbstractUIData
case prev:
first = getFirst() - getRows();
first = Math.max(first, 0);
+ scrollPosition.setTop(Integer.MAX_VALUE);
break;
case next:
if (hasRowCount()) {