summaryrefslogtreecommitdiffstats
path: root/server/src
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2013-05-17 16:14:27 +0300
committerLeif Åstrand <leif@vaadin.com>2013-05-17 16:14:27 +0300
commit73a50dbf002b381411a7c6ca1d6b4e59a93bbe0c (patch)
tree49dfcde7194cf82cc3e96519170decaf12051992 /server/src
parent5a9303869ce6912afcb158f6b75b3202d77a40a1 (diff)
parent0c8edf1ff0502070d92dc6d8ef5af304d7570934 (diff)
downloadvaadin-framework-73a50dbf002b381411a7c6ca1d6b4e59a93bbe0c.tar.gz
vaadin-framework-73a50dbf002b381411a7c6ca1d6b4e59a93bbe0c.zip
Merge changes from origin/7.0
1a6200e Merge #6880 test from 6.8; fix itself is not needed in Vaadin 7 67696f3 SQLContainer.indexOfId() also searches backwards (#11849, #10376) 611e5f9 Test for #11267 adapted from 6.8. 609acd1 Fixed table height rendering in Android 2.3 #11331 63dd611 Centers VOverlays in visual viewport on iOS, Android, fixes #11614 5a33d7d Test for #11775 0c8edf1 Avoid marking AbstractField dirty in primitive getters (#11201) Change-Id: I7437e0b249c1a95372d6f349e9d6336fb85f08a4
Diffstat (limited to 'server/src')
-rw-r--r--server/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java8
-rw-r--r--server/src/com/vaadin/ui/AbstractField.java11
2 files changed, 13 insertions, 6 deletions
diff --git a/server/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java b/server/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java
index 987466cdb7..e9a1a2d98f 100644
--- a/server/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java
+++ b/server/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java
@@ -648,23 +648,25 @@ public class SQLContainer implements Container, Container.Filterable,
getPage();
}
int size = size();
- boolean wrappedAround = false;
- while (!wrappedAround) {
+ // this protects against infinite looping
+ int counter = 0;
+ while (counter < size) {
for (Integer i : itemIndexes.keySet()) {
if (itemIndexes.get(i).equals(itemId)) {
return i;
}
+ counter++;
}
// load in the next page.
int nextIndex = (currentOffset / (pageLength * CACHE_RATIO) + 1)
* (pageLength * CACHE_RATIO);
if (nextIndex >= size) {
// Container wrapped around, start from index 0.
- wrappedAround = true;
nextIndex = 0;
}
updateOffsetAndCache(nextIndex);
}
+ // safeguard in case item not found
return -1;
}
diff --git a/server/src/com/vaadin/ui/AbstractField.java b/server/src/com/vaadin/ui/AbstractField.java
index 6648f69ff9..3bca63a3b7 100644
--- a/server/src/com/vaadin/ui/AbstractField.java
+++ b/server/src/com/vaadin/ui/AbstractField.java
@@ -323,7 +323,7 @@ public abstract class AbstractField<T> extends AbstractComponent implements
*/
@Override
public boolean isModified() {
- return getState().modified;
+ return getState(false).modified;
}
private void setModified(boolean modified) {
@@ -1276,7 +1276,7 @@ public abstract class AbstractField<T> extends AbstractComponent implements
*/
@Override
public int getTabIndex() {
- return getState().tabIndex;
+ return getState(false).tabIndex;
}
/*
@@ -1408,7 +1408,7 @@ public abstract class AbstractField<T> extends AbstractComponent implements
*/
@Override
public boolean isRequired() {
- return getState().required;
+ return getState(false).required;
}
/**
@@ -1663,6 +1663,11 @@ public abstract class AbstractField<T> extends AbstractComponent implements
}
@Override
+ protected AbstractFieldState getState(boolean markAsDirty) {
+ return (AbstractFieldState) super.getState(markAsDirty);
+ }
+
+ @Override
public void beforeClientResponse(boolean initial) {
super.beforeClientResponse(initial);