You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2007/01/18 01:15:26 UTC

svn commit: r497262 - in /tapestry/tapestry5/tapestry-core/branches/hlship-20070116-defparambindingprefix/src/site/apt/guide: localization.apt parameters.apt templates.apt

Author: hlship
Date: Wed Jan 17 16:15:25 2007
New Revision: 497262

URL: http://svn.apache.org/viewvc?view=rev&rev=497262
Log:
Update documentation about per-parameter binding prefix defaults.

Modified:
    tapestry/tapestry5/tapestry-core/branches/hlship-20070116-defparambindingprefix/src/site/apt/guide/localization.apt
    tapestry/tapestry5/tapestry-core/branches/hlship-20070116-defparambindingprefix/src/site/apt/guide/parameters.apt
    tapestry/tapestry5/tapestry-core/branches/hlship-20070116-defparambindingprefix/src/site/apt/guide/templates.apt

Modified: tapestry/tapestry5/tapestry-core/branches/hlship-20070116-defparambindingprefix/src/site/apt/guide/localization.apt
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/hlship-20070116-defparambindingprefix/src/site/apt/guide/localization.apt?view=diff&rev=497262&r1=497261&r2=497262
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/hlship-20070116-defparambindingprefix/src/site/apt/guide/localization.apt (original)
+++ tapestry/tapestry5/tapestry-core/branches/hlship-20070116-defparambindingprefix/src/site/apt/guide/localization.apt Wed Jan 17 16:15:25 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/branches/hlship-20070116-defparambindingprefix/src/site/apt/guide/parameters.apt
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/hlship-20070116-defparambindingprefix/src/site/apt/guide/parameters.apt?view=diff&rev=497262&r1=497261&r2=497262
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/hlship-20070116-defparambindingprefix/src/site/apt/guide/parameters.apt (original)
+++ tapestry/tapestry5/tapestry-core/branches/hlship-20070116-defparambindingprefix/src/site/apt/guide/parameters.apt Wed Jan 17 16:15:25 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/branches/hlship-20070116-defparambindingprefix/src/site/apt/guide/templates.apt
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/hlship-20070116-defparambindingprefix/src/site/apt/guide/templates.apt?view=diff&rev=497262&r1=497261&r2=497262
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/hlship-20070116-defparambindingprefix/src/site/apt/guide/templates.apt (original)
+++ tapestry/tapestry5/tapestry-core/branches/hlship-20070116-defparambindingprefix/src/site/apt/guide/templates.apt Wed Jan 17 16:15:25 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