tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject svn commit: r498123 - in /tapestry/tapestry5/tapestry-core/trunk/src: main/java/org/apache/tapestry/annotations/ main/java/org/apache/tapestry/corelib/base/ main/java/org/apache/tapestry/corelib/components/ main/java/org/apache/tapestry/internal/model/...
Date Sat, 20 Jan 2007 15:24:58 GMT
Author: hlship
Date: Sat Jan 20 07:24:56 2007
New Revision: 498123

URL: http://svn.apache.org/viewvc?view=rev&rev=498123
Log:
Commit changes related to per-parameter default binding prefixes from the branch to trunk.

Modified:
    tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/annotations/Parameter.java
    tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/base/AbstractField.java
    tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/base/AbstractTextField.java
    tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Any.java
    tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Label.java
    tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Loop.java
    tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/model/MutableComponentModelImpl.java
    tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/model/ParameterModelImpl.java
    tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/PageLoaderProcessor.java
    tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/ParameterWorker.java
    tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/ComponentPageElement.java
    tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/ComponentPageElementImpl.java
    tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/test/InternalBaseTestCase.java
    tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/model/MutableComponentModel.java
    tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/model/ParameterModel.java
    tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/localization.apt
    tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/parameters.apt
    tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/templates.apt
    tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/AnyDemo.html
    tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/BlockDemo.html
    tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/ClassLoaderInspect.html
    tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/PasswordFieldDemo.html
    tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/RenderComponentDemo.html
    tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/SimpleForm.html
    tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/ToDoList.html
    tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/ToDoListVolatile.html
    tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/model/MutableComponentModelImplTest.java
    tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/ParameterComponent.java
    tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/ParameterWorkerTest.java
    tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/Localization.html
    tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/ValidForm.html

Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/annotations/Parameter.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/annotations/Parameter.java?view=diff&rev=498123&r1=498122&r2=498123
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/annotations/Parameter.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/annotations/Parameter.java Sat Jan 20 07:24:56 2007
@@ -21,6 +21,8 @@
 import java.lang.annotation.Retention;
 import java.lang.annotation.Target;
 
+import org.apache.tapestry.services.BindingFactory;
+
 /**
  * Annotation placed on a field to indicate that it is, in fact, an parameter. Parameters may be
  * optional or required. Required parameters must be bound.
@@ -46,10 +48,9 @@
      * If true (the default), then the value for the parameter is cached while the component is,
      * itself, rendering. Values from invariant bindings (such as literal strings) are always
      * cached, regardless of this setting. Set this attribute to false to force the parameter to be
-     * {@link org.apache.tapestry.Binding#get() re-read} every time the field is accessed,
-     * even while the component is rendering.
+     * {@link org.apache.tapestry.Binding#get() re-read} every time the field is accessed, even
+     * while the component is rendering.
      */
-
     boolean cache() default true;
 
     /**
@@ -57,4 +58,12 @@
      * expression, typically the name of a property of the component to bind.
      */
     String value() default "";
+
+    /**
+     * The default binding prefix for the parameter, if no specific binding prefix is provided with
+     * the binding. There is <em>rarely</em> a reason to override this. Typically, non-standard
+     * default binding prefixes are paired with specific {@link BindingFactory} implementations,
+     * and used with parameters whose name reflects the binding prefix.
+     */
+    String defaultPrefix() default "prop";
 }

Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/base/AbstractField.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/base/AbstractField.java?view=diff&rev=498123&r1=498122&r2=498123
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/base/AbstractField.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/base/AbstractField.java Sat Jan 20 07:24:56 2007
@@ -56,7 +56,7 @@
      * The user presentable label for the field. If not provided, a reasonable label is generated
      * from the component's id.
      */
-    @Parameter
+    @Parameter(defaultPrefix = "literal")
     private String _label;
 
     @Parameter

Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/base/AbstractTextField.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/base/AbstractTextField.java?view=diff&rev=498123&r1=498122&r2=498123
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/base/AbstractTextField.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/base/AbstractTextField.java Sat Jan 20 07:24:56 2007
@@ -46,7 +46,7 @@
     @Parameter
     private Translator<Object> _translate;
 
-    @Parameter
+    @Parameter(defaultPrefix = "validate")
     @SuppressWarnings("unchecked")
     private FieldValidator<Object> _validate = NOOP_VALIDATOR;
 

Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Any.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Any.java?view=diff&rev=498123&r1=498122&r2=498123
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Any.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Any.java Sat Jan 20 07:24:56 2007
@@ -38,7 +38,7 @@
      * The element to be rendered by the component. Normally, this matches the element from the
      * template, but this can be overridden if necessary.
      */
-    @Parameter("componentResources.elementName")
+    @Parameter(value="prop:componentResources.elementName", defaultPrefix="literal")
     private String _element;
 
     @Inject

Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Label.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Label.java?view=diff&rev=498123&r1=498122&r2=498123
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Label.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Label.java Sat Jan 20 07:24:56 2007
@@ -31,7 +31,11 @@
 @ComponentClass
 public class Label extends RenderInformals
 {
-    @Parameter(required = true)
+    /**
+     * The for parameter is used to identify the {@link Field} linked to this label (it is named
+     * this way because it results in the for attribute of the label element).
+     */
+    @Parameter(name = "for", required = true, defaultPrefix = "component")
     private Field _field;
 
     @Environmental
@@ -47,11 +51,11 @@
 
         final Element element = writer.element("label");
 
-        // Uh oh!  Referenching a private field (that happens to get instrumented up the wazoo) from
+        // Uh oh! Referenching a private field (that happens to get instrumented up the wazoo) from
         // a inner class causes a java.lang.Verify error (Unable to pop operand off an empty stack).
-        // Perhaps this is a Javassist error?  Shouldn't the inner class be going through a synthetic
+        // Perhaps this is a Javassist error? Shouldn't the inner class be going through a synthetic
         // accessor method of some kind?
-        
+
         final ValidationDecorator decorator = _decorator;
 
         // Since we don't know if the field has rendered yet, we need to defer writing the for

Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Loop.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Loop.java?view=diff&rev=498123&r1=498122&r2=498123
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Loop.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Loop.java Sat Jan 20 07:24:56 2007
@@ -185,7 +185,7 @@
     @Environmental(false)
     private FormSupport _formSupport;
 
-    @Parameter("componentResources.elementName")
+    @Parameter(value="prop:componentResources.elementName", defaultPrefix="literal")
     private String _elementName;
 
     /**

Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/model/MutableComponentModelImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/model/MutableComponentModelImpl.java?view=diff&rev=498123&r1=498122&r2=498123
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/model/MutableComponentModelImpl.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/model/MutableComponentModelImpl.java Sat Jan 20 07:24:56 2007
@@ -100,9 +100,10 @@
         return _componentClassName;
     }
 
-    public void addParameter(String name, boolean required)
+    public void addParameter(String name, boolean required, String defaultBindingPrefix)
     {
         notBlank(name, "name");
+        notBlank(defaultBindingPrefix, "defaultBindingPrefix");
 
         // TODO: Check for conflict with base model
 
@@ -116,7 +117,7 @@
                         _componentClassName));
         }
 
-        _parameters.put(name, new ParameterModelImpl(name, required));
+        _parameters.put(name, new ParameterModelImpl(name, required, defaultBindingPrefix));
     }
 
     public ParameterModel getParameterModel(String parameterName)

Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/model/ParameterModelImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/model/ParameterModelImpl.java?view=diff&rev=498123&r1=498122&r2=498123
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/model/ParameterModelImpl.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/model/ParameterModelImpl.java Sat Jan 20 07:24:56 2007
@@ -12,33 +12,37 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package org.apache.tapestry.internal.model;
-
-import org.apache.tapestry.model.ParameterModel;
-
-/**
- * 
- */
-public class ParameterModelImpl implements ParameterModel
-{
-    private final String _name;
-
-    private final boolean _required;
-
-    public ParameterModelImpl(String name, boolean required)
-    {
-        _name = name;
-        _required = required;
-    }
-
-    public String getName()
-    {
-        return _name;
-    }
-
-    public boolean isRequired()
-    {
-        return _required;
-    }
-
-}
+package org.apache.tapestry.internal.model;
+
+import org.apache.tapestry.model.ParameterModel;
+
+public class ParameterModelImpl implements ParameterModel
+{
+    private final String _name;
+
+    private final boolean _required;
+
+    private final String _defaultBindingPrefix;
+
+    public ParameterModelImpl(String name, boolean required, String defaultBindingPrefix)
+    {
+        _name = name;
+        _required = required;
+        _defaultBindingPrefix = defaultBindingPrefix;
+    }
+
+    public String getName()
+    {
+        return _name;
+    }
+
+    public boolean isRequired()
+    {
+        return _required;
+    }
+
+    public String getDefaultBindingPrefix()
+    {
+        return _defaultBindingPrefix;
+    }
+}

Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/PageLoaderProcessor.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/PageLoaderProcessor.java?view=diff&rev=498123&r1=498122&r2=498123
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/PageLoaderProcessor.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/PageLoaderProcessor.java Sat Jan 20 07:24:56 2007
@@ -125,11 +125,18 @@
         if (resources.isBound(name))
             return;
 
+        // Meta default of literal for the template.
+
+        String defaultBindingPrefix = determineDefaultBindingPrefix(
+                component,
+                name,
+                InternalConstants.LITERAL_BINDING_PREFIX);
+
         Binding binding = _bindingSource.newBinding(
                 "parameter " + name,
                 _loadingElement.getComponentResources(),
                 component.getComponentResources(),
-                InternalConstants.PROP_BINDING_PREFIX,
+                defaultBindingPrefix,
                 token.getValue(),
                 token.getLocation());
 
@@ -163,6 +170,11 @@
         {
             String value = model.getParameterValue(name);
 
+            String defaultBindingPrefix = determineDefaultBindingPrefix(
+                    component,
+                    name,
+                    InternalConstants.PROP_BINDING_PREFIX);
+
             // At some point we may add meta data to control what the default prefix is within a
             // component.
 
@@ -170,7 +182,7 @@
                     "parameter " + name,
                     loadingComponent.getComponentResources(),
                     component.getComponentResources(),
-                    InternalConstants.PROP_BINDING_PREFIX,
+                    defaultBindingPrefix,
                     value,
                     null);
 
@@ -178,6 +190,25 @@
         }
     }
 
+    /**
+     * Determines the default binding prefix for a particular parameters.
+     * 
+     * @param component
+     *            the component which will have a parameter bound
+     * @param parameterName
+     *            the name of the parameter
+     * @param metaDefaultBindingPrefix
+     *            the default to use for informal parameters
+     * @return the binding prefix
+     */
+    private String determineDefaultBindingPrefix(ComponentPageElement component,
+            String parameterName, String metaDefaultBindingPrefix)
+    {
+        String defaultBindingPrefix = component.getDefaultBindingPrefix(parameterName);
+
+        return defaultBindingPrefix != null ? defaultBindingPrefix : metaDefaultBindingPrefix;
+    }
+
     private void addRenderBodyElement()
     {
         PageElement element = _pageElementFactory.newRenderBodyElement(_loadingElement);
@@ -408,7 +439,7 @@
                 case PARAMETER:
                     parameter((ParameterToken) token);
                     break;
-                    
+
                 default:
                     throw new IllegalStateException("Not implemented yet: " + token);
             }

Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/ParameterWorker.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/ParameterWorker.java?view=diff&rev=498123&r1=498122&r2=498123
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/ParameterWorker.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/ParameterWorker.java Sat Jan 20 07:24:56 2007
@@ -58,7 +58,7 @@
 
         String parameterName = getParameterName(name, annotation.name());
 
-        model.addParameter(parameterName, annotation.required());
+        model.addParameter(parameterName, annotation.required(), annotation.defaultPrefix());
 
         String type = transformation.getFieldType(name);
 
@@ -173,13 +173,12 @@
                     "bindingSource",
                     _bindingSource);
 
-            builder
-                    .addln(
-                            "  %s.addParameter(\"%s\", %s.newBinding(\"default %2$s\", %1$s, \"%s\"));",
-                            resourcesFieldName,
-                            parameterName,
-                            bindingFactoryFieldName,
-                            defaultBinding);
+            builder.addln(
+                    "  %s.addParameter(\"%s\", %s.newBinding(\"default %2$s\", %1$s, \"%s\"));",
+                    resourcesFieldName,
+                    parameterName,
+                    bindingFactoryFieldName,
+                    defaultBinding);
 
             return;
 

Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/ComponentPageElement.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/ComponentPageElement.java?view=diff&rev=498123&r1=498122&r2=498123
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/ComponentPageElement.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/ComponentPageElement.java Sat Jan 20 07:24:56 2007
@@ -19,6 +19,7 @@
 import org.apache.tapestry.internal.InternalComponentResources;
 import org.apache.tapestry.internal.InternalComponentResourcesCommon;
 import org.apache.tapestry.internal.services.Instantiator;
+import org.apache.tapestry.model.ParameterModel;
 import org.apache.tapestry.runtime.Component;
 import org.apache.tapestry.runtime.ComponentEvent;
 import org.apache.tapestry.runtime.RenderQueue;
@@ -100,4 +101,15 @@
      * @return true if a handler was found
      */
     boolean handleEvent(ComponentEvent event);
+
+    /**
+     * Searches the component (and its mixins) for a formal parameter matching the given name. If
+     * found, the {@link ParameterModel#getDefaultBindingPrefix() default binding prefix} is
+     * returned. Otherwise the parameter is an informal parameter, and null is returned.
+     * 
+     * @param parameterName
+     *            the name of the parameter, possibly qualified with the mixin class name
+     * @return the default binding prefix, or null
+     */
+    String getDefaultBindingPrefix(String parameterName);
 }

Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/ComponentPageElementImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/ComponentPageElementImpl.java?view=diff&rev=498123&r1=498122&r2=498123
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/ComponentPageElementImpl.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/ComponentPageElementImpl.java Sat Jan 20 07:24:56 2007
@@ -634,10 +634,8 @@
 
             String simpleName = parameterName.substring(dotx + 1);
 
-            // TODO: If its informal? Ignore it unless the mixin supports informals? Warn otherwise?
-            // We'll have to see.
-
             mixinResources.addParameter(simpleName, binding);
+            return;
         }
 
         InternalComponentResources informalParameterResources = null;
@@ -1051,4 +1049,51 @@
         _blocks.put(blockId, block);
     }
 
+    public String getDefaultBindingPrefix(String parameterName)
+    {
+        int dotx = parameterName.lastIndexOf('.');
+
+        if (dotx > 0)
+        {
+            String mixinName = parameterName.substring(0, dotx);
+            InternalComponentResources mixinResources = InternalUtils.get(
+                    _mixinsByShortName,
+                    mixinName);
+
+            if (mixinResources == null)
+                throw new TapestryException(StructureMessages.missingMixinForParameter(
+                        _completeId,
+                        mixinName,
+                        parameterName), null, null);
+
+            String simpleName = parameterName.substring(dotx + 1);
+
+            ParameterModel pm = mixinResources.getComponentModel().getParameterModel(simpleName);
+
+            return pm != null ? pm.getDefaultBindingPrefix() : null;
+        }
+
+        // A formal parameter of the core component?
+
+        ParameterModel pm = _coreResources.getComponentModel().getParameterModel(parameterName);
+
+        if (pm != null)
+            return pm.getDefaultBindingPrefix();
+
+        // Search for mixin that it is a formal parameter of
+
+        for (String mixinName : InternalUtils.sortedKeys(_mixinsByShortName))
+        {
+            InternalComponentResources resources = _mixinsByShortName.get(mixinName);
+
+            pm = resources.getComponentModel().getParameterModel(parameterName);
+
+            if (pm != null)
+                return pm.getDefaultBindingPrefix();
+        }
+
+        // Not a formal parameter of the core component or any mixin.
+
+        return null;
+    }
 }

Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/test/InternalBaseTestCase.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/test/InternalBaseTestCase.java?view=diff&rev=498123&r1=498122&r2=498123
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/test/InternalBaseTestCase.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/test/InternalBaseTestCase.java Sat Jan 20 07:24:56 2007
@@ -467,4 +467,9 @@
     {
         expect(lookup.getParameter(elementName)).andReturn(value).atLeastOnce();
     }
+
+    protected final void train_isLoaded(InternalComponentResources resources, boolean isLoaded)
+    {
+        expect(resources.isLoaded()).andReturn(isLoaded);
+    }
 }

Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/model/MutableComponentModel.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/model/MutableComponentModel.java?view=diff&rev=498123&r1=498122&r2=498123
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/model/MutableComponentModel.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/model/MutableComponentModel.java Sat Jan 20 07:24:56 2007
@@ -14,6 +14,7 @@
 
 package org.apache.tapestry.model;
 
+import org.apache.tapestry.annotations.Parameter;
 import org.apache.tapestry.annotations.Persist;
 import org.apache.tapestry.internal.InternalComponentResources;
 
@@ -24,16 +25,19 @@
 public interface MutableComponentModel extends ComponentModel
 {
     /**
-     * Adds a new parameter to the model.
+     * Adds a new formal parameter to the model.
      * 
      * @param name
-     *            new, unique n`ame for the parameter
+     *            new, unique name for the parameter
      * @param required
      *            if true, the parameter must be bound
+     * @param defaultBindingPrefix
+     *            the default binding prefix for this parameter
      * @throws IllegalArgumentException
      *             if a parameter with the given name has already been defined for this model
+     * @see Parameter
      */
-    void addParameter(String name, boolean required);
+    void addParameter(String name, boolean required, String defaultBindingPrefix);
 
     /**
      * Defines a new embedded component.

Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/model/ParameterModel.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/model/ParameterModel.java?view=diff&rev=498123&r1=498122&r2=498123
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/model/ParameterModel.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/model/ParameterModel.java Sat Jan 20 07:24:56 2007
@@ -12,18 +12,23 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package org.apache.tapestry.model;
-
-/**
- * Model for a parameter of a component.
- * 
- * 
- */
-public interface ParameterModel
-{
-    /** The name of the parameter. */
-    String getName();
-
-    /** If true, the parameter is required. */
-    boolean isRequired();
-}
+package org.apache.tapestry.model;
+
+import org.apache.tapestry.annotations.Parameter;
+
+/**
+ * Model for a <em>formal</em> parameter of a component.
+ * 
+ * @see Parameter
+ */
+public interface ParameterModel
+{
+    /** The name of the parameter. */
+    String getName();
+
+    /** If true, the parameter is required. */
+    boolean isRequired();
+
+    /** The default binding prefix for the parameter, usually "prop". */
+    String getDefaultBindingPrefix();
+}

Modified: tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/localization.apt
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/localization.apt?view=diff&rev=498123&r1=498122&r2=498123
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/localization.apt (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/localization.apt Sat Jan 20 07:24:56 2007
@@ -144,6 +144,7 @@
 Changing the Locale
 
   Tapestry does not yet support changing the locale, but that will be available shortly.  The intent is to mimic Tapestry 4 behavior: store a cookie
-  on the client to provide the default for the locale on the next visit, and store a locale name in the session (if a session exists).
+  on the client to provide the default for the locale on the next visit, and store a locale name in the session (if a session exists).  <<TODO: I believe
+  this has been implemented by Kent.>>
   
   

Modified: tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/parameters.apt
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/parameters.apt?view=diff&rev=498123&r1=498122&r2=498123
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/parameters.apt (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/parameters.apt Sat Jan 20 07:24:56 2007
@@ -117,26 +117,24 @@
 *------------+----------------------------------------------------------------------------------+
 | <<Prefix>> | <<Description>>                                                                  |
 *------------+----------------------------------------------------------------------------------+
-| component: | The id of another component within the same template.                            |
+| component  | The id of another component within the same template.                            |
 *------------+----------------------------------------------------------------------------------+
-| literal:   | A literal string.                                                                |
+| literal   | A literal string.                                                                |
 *------------+----------------------------------------------------------------------------------+
 | message    | Retrieves a value from the component's {{{localization.html}message catalog}}.   |
 *------------+----------------------------------------------------------------------------------+
-| prop:      | The name of a property of the containing component to read or update.            |
+| prop      | The name of a property of the containing component to read or update.            |
 *------------+----------------------------------------------------------------------------------+
-| translate: | The name of a configured translator.                                             |
+| translate  | The name of a configured translator.                                             |
 *------------+----------------------------------------------------------------------------------+
-| validate:  | A <validator specification> used to create some number of field validators.      |
+| validate   | A <validator specification> used to create some number of field validators.      |
 *------------+----------------------------------------------------------------------------------+
 
-  The default binding prefix is "prop:".
-
-  <<Note: More prefixes are forthcoming.>>
+  Parameters have a default prefix, usually "prop:", that is used when the prefix is not provided.
     
 Property Bindings
 
-  The "prop:" prefix indicates a property binding.
+  The "prop:" binding prefix indicates a property binding.
   
   The expression for a property binding is a dotted sequence of property names.  Simple
   property expressions are just the name of a property, "prop:userName".  Complex property
@@ -205,6 +203,24 @@
   The list of available translators is configured by the
   {{{../apidocs/org/apache/tapestry/services/TranslatorSource.html}TranslatorSource}} service.  
   
+Informal Parameters
+
+  Some components support <informal parameters>, additional parameters beyond the formally defined parameters.
+  Informal parameters will be rendered into the output as additional attributes on the tag rendered by
+  the component.  Generally speaking, components that have a 1:1 relationship with a particular HTML tag
+  (such as {{{../apidocs/org/apache/tapestry/corelib/components/TextField.html}TextField}} and 
+  \<input\> will support informal parameters.
+  
+  Informal parameters are often used to set the CSS class of an element, or to specify client-side event handlers.
+  
+  The default binding prefix for informal parameters depends on <where> the parameter binding is specified.
+  If the parameter is bound inside a Java class, within the 
+  {{{../apidocs/org/apache/tapestry/annotations/Component.html}Component}} annotation, then the default binding
+  prefix is "prop:".  If the parameter is bound inside the component template, then the default binding
+  prefix is "literal:".  This reflects the fact that a parameter specified in the Java class, using the annotation, is most likely
+  a computed value, whereas a value in the template should simply be copied, as is, into the result HTML stream.
+  
+    
 Parameters Are Bi-Directional
 
   Parameters are not simply variables; each parameter represents a connection, or <binding>, between

Modified: tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/templates.apt
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/templates.apt?view=diff&rev=498123&r1=498122&r2=498123
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/templates.apt (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/templates.apt Sat Jan 20 07:24:56 2007
@@ -95,10 +95,9 @@
   the type of the component (with 
   {{{component-classes.html#Embedded Components}a Component annotation}}).
   
-  Additional attributes are used to {{{parameters.html}bind parameters of the component}}.  
-  When parameters are bound
-  in this way, the values are interpreted as property expressions (that is, the "prop:" prefix is assumed unless
-  another value is specifically provided).
+  Additional attributes are used to {{{parameters.html}bind parameters of the component}}. These may be formal parameters
+  or informal parameters.  Formal parameters will have a default binding prefix (usually "prop:").  Informal parameters
+  will be assumed to be literals (i.e., the "literal:" binding prefix).
   
   The \<comp\> element defines where, within the containing component's template, the embedded component is active.
   
@@ -212,10 +211,6 @@
   The id, type and mixins attributes must be placed in the Tapestry namespace.  Any additional attributes may be in the Tapestry namespace
   or in the default namespace. Placing an attribute in the Tapestry namespace is useful when the attribute is not defined for the
   element being instrumented.
-   
-  Parameters for instrumented elements <<are still, by default, property expressions>>.  This means that simple strings will need
-  to be enclosed in single quotes, or they'll be interpreted as the names of properties (that don't exist).  Numbers may be left as is.  <<This applies to
-  informal parameters as well as formal parameters.>>
     
   It is valid to specify just the t:id attribute and not supply a specific type in either the template or in the containing class.
   In this situation, Tapestry will make use of the

Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/AnyDemo.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/AnyDemo.html?view=diff&rev=498123&r1=498122&r2=498123
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/AnyDemo.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/AnyDemo.html Sat Jan 20 07:24:56 2007
@@ -5,11 +5,11 @@
         Demonstrates a few things about the Any component.
     </p>
     
-    <span t:id="title" class="'title'">Page Title</span>
+    <span t:id="title" class="title">Page Title</span>
     
-    <div t:id="heading" class="'heading'">Heading</div>
+    <div t:id="heading" class="heading">Heading</div>
     
-    <div t:id="section" element="'h2'" class="'section'">Section</div>
+    <div t:id="section" element="h2" class="section">Section</div>
         
         
     <ul>    

Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/BlockDemo.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/BlockDemo.html?view=diff&rev=498123&r1=498122&r2=498123
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/BlockDemo.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/BlockDemo.html Sat Jan 20 07:24:56 2007
@@ -8,7 +8,7 @@
 </p>    
     
     <form t:type="Form">
-        <select t:type="Select" t:id="blockName" model="',fred,barney'" onchange="'this.form.submit();'"/> <label for="blockName">Block to display</label>
+        <select t:type="Select" t:id="blockName" model="',fred,barney'" onchange="this.form.submit();"/> <label t:type="Label" for="blockName">Block to display</label>
     </form>
     
     <p>The block: [<t:comp type="Render" value="blockToRender"/>]</p>

Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/ClassLoaderInspect.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/ClassLoaderInspect.html?view=diff&rev=498123&r1=498122&r2=498123
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/ClassLoaderInspect.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/ClassLoaderInspect.html Sat Jan 20 07:24:56 2007
@@ -24,8 +24,8 @@
 
     <form t:id="search">
         <t:comp type="Errors"/>
-        <label t:type="Label" field="component:resource"/>: <input t:id="resource"
-            t:type="TextField" size="50" validate="validate:required"/>
+        <label t:type="Label" for="resource"/>: <input t:id="resource"
+            t:type="TextField" size="50" validate="required"/>
         <br/>
         <input type="submit"/>
     </form>

Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/PasswordFieldDemo.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/PasswordFieldDemo.html?view=diff&rev=498123&r1=498122&r2=498123
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/PasswordFieldDemo.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/PasswordFieldDemo.html Sat Jan 20 07:24:56 2007
@@ -7,11 +7,11 @@
 
         <span t:type="Errors"/>
 
-        <label t:type="Label" field="component:userName"/>
-        <input t:type="TextField" t:id="userName" t:validate="validate:required" size="30"/>
+        <label t:type="Label" for="userName"/>
+        <input t:type="TextField" t:id="userName" t:validate="required" size="30"/>
         <br/>
-        <label t:type="Label" field="component:password"/>
-        <input t:id="password" t:validate="validate:required" size="30"/>
+        <label t:type="Label" for="password"/>
+        <input t:id="password" t:validate="required" size="30"/>
         <br/>
         <input type="submit" value="Login"/>
     </form>

Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/RenderComponentDemo.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/RenderComponentDemo.html?view=diff&rev=498123&r1=498122&r2=498123
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/RenderComponentDemo.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/RenderComponentDemo.html Sat Jan 20 07:24:56 2007
@@ -13,7 +13,7 @@
     </t:block>
     
     <form t:type="Form">
-        <input t:type="Checkbox" t:id="enabled" onchange="'this.form.submit();'"/> <label for="enabled">Enable optional text</label>
+        <input t:type="Checkbox" t:id="enabled" onchange="this.form.submit();"/> <label t:type="Label" for="enabled">Enable optional text</label>
     </form>
     
     <t:comp type="If" test="enabled">

Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/SimpleForm.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/SimpleForm.html?view=diff&rev=498123&r1=498122&r2=498123
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/SimpleForm.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/SimpleForm.html Sat Jan 20 07:24:56 2007
@@ -5,24 +5,24 @@
 
     <form t:type="Form">
         <input t:type="Checkbox" t:id="disabled"/>
-        <label t:type="Label" field="component:disabled"/>
+        <label t:type="Label" for="disabled"/>
         
         <hr/>
         
-        <label t:type="Label"  field="component:email">This isn't used</label>: <input
+        <label t:type="Label"  for="email">This isn't used</label>: <input
             t:type="TextField" t:id="email" value="incident.email" size="50"  disabled="disabled"/>
         <br/>
-        <label t:type="Label"  field="component:message"/>: <input t:type="TextArea" t:id="message" label="'Incident Message'"
+        <label t:type="Label"  for="message"/>: <input t:type="TextArea" t:id="message" label="Incident Message"
             value="incident.message" cols="50" rows="10" disabled="disabled"> You can put text here, but it isn't used. </input>
         <br/>
-        <label t:type="Label" field="component:operatingSystem"/>:
+        <label t:type="Label" for="operatingSystem"/>:
         <select t:type="Select"  t:id="operatingSystem" value="incident.operatingSystem" model="message:os-values" disabled="disabled"/>
         
         
         <br/>
         
         <input t:type="Checkbox" t:id="urgent" value="incident.urgent" disabled="disabled"/>
-        <label t:type="Label" field="component:urgent"/>
+        <label t:type="Label" for="urgent"/>
         <br/>
         <input type="submit"/>
     </form>

Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/ToDoList.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/ToDoList.html?view=diff&rev=498123&r1=498122&r2=498123
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/ToDoList.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/ToDoList.html Sat Jan 20 07:24:56 2007
@@ -14,14 +14,14 @@
             <tr t:type="Loop" source="items" value="item" encoder="encoder">
                 <td>
                     <input t:type="TextField" t:id="title" value="item.title" size="30"
-                        validate="validate:required"/>
+                        validate="required"/>
                 </td>
                 <td> NOT YET </td>            
             </tr>
             <tr>
                 <td colspan="2">
                     <input type="submit" value="Update ToDos"/>
-                    <input t:type="Submit" t:id="addNew" value="'Add new ToDo'"/>
+                    <input t:type="Submit" t:id="addNew" value="Add new ToDo"/>
                 </td>
             </tr>
             

Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/ToDoListVolatile.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/ToDoListVolatile.html?view=diff&rev=498123&r1=498122&r2=498123
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/ToDoListVolatile.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/ToDoListVolatile.html Sat Jan 20 07:24:56 2007
@@ -14,14 +14,14 @@
             <tr t:type="Loop" source="items" value="item" volatile="true">
                 <td>
                     <input t:type="TextField" t:id="title" value="item.title" size="30"
-                        validate="validate:required"/>
+                        validate="required"/>
                 </td>
                 <td> NOT YET </td>            
             </tr>
             <tr>
                 <td colspan="2">
                    <input type="submit" value="Update ToDos"/>
-                   <input t:type="Submit" t:id="addNew" value="'Add new ToDo'"/>
+                   <input t:type="Submit" t:id="addNew" value="Add new ToDo"/>
                                    </td>
             </tr>
  

Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/model/MutableComponentModelImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/model/MutableComponentModelImplTest.java?view=diff&rev=498123&r1=498122&r2=498123
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/model/MutableComponentModelImplTest.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/model/MutableComponentModelImplTest.java Sat Jan 20 07:24:56 2007
@@ -17,6 +17,7 @@
 import java.util.Arrays;
 
 import org.apache.commons.logging.Log;
+import org.apache.tapestry.internal.InternalConstants;
 import org.apache.tapestry.internal.test.InternalBaseTestCase;
 import org.apache.tapestry.ioc.Resource;
 import org.apache.tapestry.model.ComponentModel;
@@ -68,15 +69,22 @@
 
         String parameterName = "value";
 
-        model.addParameter(parameterName, true);
+        model.addParameter(parameterName, true, InternalConstants.PROP_BINDING_PREFIX);
 
         ParameterModel pm = model.getParameterModel(parameterName);
 
         assertEquals(pm.getName(), parameterName);
         assertEquals(true, pm.isRequired());
+        assertEquals(pm.getDefaultBindingPrefix(), InternalConstants.PROP_BINDING_PREFIX);
 
         assertEquals(model.getDeclaredParameterNames(), Arrays.asList(parameterName));
 
+        // Verify that the binding prefix is actually stored:
+
+        model.addParameter("fred", true, "flint");
+
+        assertEquals(model.getParameterModel("fred").getDefaultBindingPrefix(), "flint");
+
         verify();
     }
 
@@ -90,9 +98,9 @@
 
         MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, log, r, null);
 
-        model.addParameter("fred", true);
-        model.addParameter("wilma", true);
-        model.addParameter("barney", true);
+        model.addParameter("fred", true, InternalConstants.PROP_BINDING_PREFIX);
+        model.addParameter("wilma", true, InternalConstants.PROP_BINDING_PREFIX);
+        model.addParameter("barney", true, InternalConstants.PROP_BINDING_PREFIX);
 
         assertEquals(model.getDeclaredParameterNames(), Arrays.asList("barney", "fred", "wilma"));
 
@@ -113,9 +121,9 @@
 
         MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, log, r, parent);
 
-        model.addParameter("fred", true);
-        model.addParameter("wilma", true);
-        model.addParameter("barney", true);
+        model.addParameter("fred", true, InternalConstants.PROP_BINDING_PREFIX);
+        model.addParameter("wilma", true, InternalConstants.PROP_BINDING_PREFIX);
+        model.addParameter("barney", true, InternalConstants.PROP_BINDING_PREFIX);
 
         assertEquals(model.getDeclaredParameterNames(), Arrays.asList("barney", "fred", "wilma"));
         assertEquals(model.getParameterNames(), Arrays.asList("barney", "betty", "fred", "wilma"));
@@ -133,11 +141,11 @@
 
         MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, log, r, null);
 
-        model.addParameter("fred", true);
+        model.addParameter("fred", true, InternalConstants.PROP_BINDING_PREFIX);
 
         try
         {
-            model.addParameter("fred", true);
+            model.addParameter("fred", true, InternalConstants.PROP_BINDING_PREFIX);
             unreachable();
         }
         catch (IllegalArgumentException ex)
@@ -174,7 +182,7 @@
         replay();
 
         MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, log, r, null);
-        model.addParameter("fred", true);
+        model.addParameter("fred", true, InternalConstants.PROP_BINDING_PREFIX);
 
         assertNull(model.getParameterModel("barney"));
 

Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/ParameterComponent.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/ParameterComponent.java?view=diff&rev=498123&r1=498122&r2=498123
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/ParameterComponent.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/ParameterComponent.java Sat Jan 20 07:24:56 2007
@@ -26,7 +26,7 @@
     @Parameter
     private String _object;
 
-    @Parameter(cache = false, name = "uncached")
+    @Parameter(cache = false, name = "uncached", defaultPrefix="literal")
     private String _uncachedObject;
 
     @Parameter(required = true)

Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/ParameterWorkerTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/ParameterWorkerTest.java?view=diff&rev=498123&r1=498122&r2=498123
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/ParameterWorkerTest.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/ParameterWorkerTest.java Sat Jan 20 07:24:56 2007
@@ -22,6 +22,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.tapestry.Binding;
 import org.apache.tapestry.internal.InternalComponentResources;
+import org.apache.tapestry.internal.InternalConstants;
 import org.apache.tapestry.internal.test.InternalBaseTestCase;
 import org.apache.tapestry.ioc.internal.services.PropertyAccessImpl;
 import org.apache.tapestry.ioc.services.PropertyAccess;
@@ -394,11 +395,6 @@
         verify();
     }
 
-    protected final void train_isLoaded(InternalComponentResources resources, boolean isLoaded)
-    {
-        expect(resources.isLoaded()).andReturn(isLoaded);
-    }
-
     @Test
     public void uncached_object_read() throws Exception
     {
@@ -468,7 +464,7 @@
 
         MutableComponentModel model = newMutableComponentModel();
 
-        model.addParameter("value", false);
+        model.addParameter("value", false, InternalConstants.PROP_BINDING_PREFIX);
 
         Runnable phaseTwoTraining = new Runnable()
         {
@@ -515,7 +511,7 @@
 
         MutableComponentModel model = newMutableComponentModel();
 
-        model.addParameter("value", false);
+        model.addParameter("value", false, InternalConstants.PROP_BINDING_PREFIX);
 
         Runnable phaseTwoTraining = new Runnable()
         {
@@ -567,18 +563,17 @@
     {
         MutableComponentModel model = newMutableComponentModel();
 
-        model.addParameter("invariantObject", false);
-        model.addParameter("invariantPrimitive", false);
-        model.addParameter("object", false);
-        model.addParameter("primitive", true);
-        model.addParameter("uncached", false);
+        model.addParameter("invariantObject", false, InternalConstants.PROP_BINDING_PREFIX);
+        model.addParameter("invariantPrimitive", false, InternalConstants.PROP_BINDING_PREFIX);
+        model.addParameter("object", false, InternalConstants.PROP_BINDING_PREFIX);
+        model.addParameter("primitive", true, InternalConstants.PROP_BINDING_PREFIX);
+        model.addParameter("uncached", false, InternalConstants.LITERAL_BINDING_PREFIX);
 
         Runnable phaseTwoTraining = new Runnable()
         {
             public void run()
             {
                 trainForPageDidLoad(resources);
-
             }
         };
 

Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/Localization.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/Localization.html?view=diff&rev=498123&r1=498122&r2=498123
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/Localization.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/Localization.html Sat Jan 20 07:24:56 2007
@@ -14,9 +14,9 @@
     
     <p> Request locale: [${request.locale}]</p>
 
-	<p t:type="ActionLink" t:id="french">French</p>
+	<a t:type="ActionLink" t:id="french">French</a>
 
-	<p t:type="ActionLink" t:id="english">English</p>
+	<a t:type="ActionLink" t:id="english">English</a>
 
 <hr/>
 

Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/ValidForm.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/ValidForm.html?view=diff&rev=498123&r1=498122&r2=498123
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/ValidForm.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/ValidForm.html Sat Jan 20 07:24:56 2007
@@ -7,14 +7,14 @@
         
         <t:comp type="Errors"/>
         
-        <t:comp type="Label"  field="component:email">This isn't used</t:comp>: <t:comp
-            type="TextField" id="email" value="incident.email" size="50" validate="validate:required"/>
+        <label t:type="Label"  for="email">This isn't used</label>: <input
+            t:type="TextField" t:id="email" value="incident.email" size="50" t:validate="required"/>
         <br/>
-        <t:comp type="Label"  field="component:message"/>: <t:comp type="TextArea" id="message" label="literal:Incident Message"
-            value="incident.message" cols="50" rows="10" validate="validate:required"> You can put text here, but it isn't used. </t:comp>
+        <label t:type="Label"  for="message"/>: <textarea t:type="TextArea" t:id="message" t:label="Incident Message"
+            value="incident.message" cols="50" rows="10" t:validate="required"> You can put text here, but it isn't used. </textarea>
         <br/>
-        <t:comp type="Checkbox" id="urgent" value="incident.urgent"/>
-        <t:comp type="Label" field="component:urgent"/>
+        <input t:type="Checkbox" t:id="urgent" value="incident.urgent"/>
+        <label t:type="Label" for="urgent"/>
         <br/>
         <input type="submit"/>
     </t:comp>



Mime
View raw message