cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sylv...@apache.org
Subject svn commit: r349823 - /cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/datatype/DefaultSelectionListBuilder.java
Date Tue, 29 Nov 2005 22:49:39 GMT
Author: sylvain
Date: Tue Nov 29 14:49:31 2005
New Revision: 349823

URL: http://svn.apache.org/viewcvs?rev=349823&view=rev
Log:
Fix bug: selection lists where always static. Also consider them dynamic by default (auto-reload,
principle of least surprise)

Modified:
    cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/datatype/DefaultSelectionListBuilder.java

Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/datatype/DefaultSelectionListBuilder.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/datatype/DefaultSelectionListBuilder.java?rev=349823&r1=349822&r2=349823&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/datatype/DefaultSelectionListBuilder.java
(original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/datatype/DefaultSelectionListBuilder.java
Tue Nov 29 14:49:31 2005
@@ -67,7 +67,8 @@
         SelectionList selectionList;
         String src = selectionListElement.getAttribute("src");
         if (src.length() > 0) {
-            boolean dynamic = false;
+            // Principle of least surprise, use dynamic lists by default
+            boolean dynamic = true;
             boolean usePerRequestCache = false;
             String cacheType = DomHelper.getAttribute(selectionListElement, "cache", null);
 
@@ -78,12 +79,13 @@
             } else if ("none".equals(cacheType)){ // Dynamic SelectionList non cached
                 dynamic = true;
             } else if ("static".equals(cacheType)) {
-                // Static SelectionList (default values)
+                // Static SelectionList
+                dynamic = false;
             } else { // Checking for deprecated @dynamic
                 if (DomHelper.getAttribute(selectionListElement, "dynamic", null) != null)
{
                     Deprecation.logger.warn("'@dynamic' is deprecated in <fd:selection-list>
and replaced by '@cache' at " + DomHelper.getLocation(selectionListElement));            
       
+                    dynamic = DomHelper.getAttributeAsBoolean(selectionListElement, "dynamic",
false);
                 }
-                dynamic = DomHelper.getAttributeAsBoolean(selectionListElement, "dynamic",
false);
             }
             // Create SelectionList
             if (dynamic) {



Mime
View raw message