aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatti Tahvonen <matti.tahvonen@itmill.com>2007-12-13 14:40:38 +0000
committerMatti Tahvonen <matti.tahvonen@itmill.com>2007-12-13 14:40:38 +0000
commitee957b1b9710ec771be407414c5c67ffed49f5a0 (patch)
treea825457c9f38a5f6cdb9634bc4bad90917d1b6c3
parent6e310baee67899b26f9780a5c277bdadeadaac7d (diff)
downloadvaadin-framework-ee957b1b9710ec771be407414c5c67ffed49f5a0.tar.gz
vaadin-framework-ee957b1b9710ec771be407414c5c67ffed49f5a0.zip
Ajaxifiead FeatureBrowser (don't force filter refresh)
svn changeset:3234/svn branch:trunk
-rw-r--r--src/com/itmill/toolkit/demo/featurebrowser/FeatureBrowser.java22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/com/itmill/toolkit/demo/featurebrowser/FeatureBrowser.java b/src/com/itmill/toolkit/demo/featurebrowser/FeatureBrowser.java
index 0071b081b4..744d415702 100644
--- a/src/com/itmill/toolkit/demo/featurebrowser/FeatureBrowser.java
+++ b/src/com/itmill/toolkit/demo/featurebrowser/FeatureBrowser.java
@@ -52,6 +52,7 @@ public class FeatureBrowser extends com.itmill.toolkit.Application implements
// Example "cache"
private final HashMap exampleInstances = new HashMap();
+ private String section;
// List of examples
private static final Object[][] demos = new Object[][] {
@@ -290,26 +291,27 @@ public class FeatureBrowser extends com.itmill.toolkit.Application implements
final Object id = tree.getValue();
final Item item = tree.getItem(id);
//
- String section;
+ String newSection;
if (tree.isRoot(id)) {
- section = ""; // show all sections
+ newSection = ""; // show all sections
} else if (tree.hasChildren(id)) {
- section = (String) item.getItemProperty(PROPERTY_ID_NAME)
+ newSection = (String) item.getItemProperty(PROPERTY_ID_NAME)
.getValue();
} else {
- section = (String) item.getItemProperty(PROPERTY_ID_CATEGORY)
- .getValue();
+ newSection = (String) item
+ .getItemProperty(PROPERTY_ID_CATEGORY).getValue();
}
table.setValue(null);
final IndexedContainer c = (IndexedContainer) table
.getContainerDataSource();
- c.removeAllContainerFilters();
- if (section != null) {
- c
- .addContainerFilter(PROPERTY_ID_CATEGORY, section,
- false, true);
+
+ if (newSection != null && !newSection.equals(section)) {
+ c.removeAllContainerFilters();
+ c.addContainerFilter(PROPERTY_ID_CATEGORY, newSection, false,
+ true);
}
+ section = newSection;
if (!tree.hasChildren(id)) {
// Example, not section
// update table selection