dev@javaserverfaces.java.net

Re: Seeking Review from Jim:

From: Ed Burns <Ed.Burns_at_Sun.COM>
Date: Fri, 14 Nov 2008 06:27:15 -0800

>>>>> On Thu, 13 Nov 2008 22:22:34 -0800, Jim Driscoll <Jim.Driscoll_at_Sun.COM> said:

JD> One comment (which I've already given)-
JD> In the ajax tag, we're delimiting clientids with spaces.

JD> We should delimit them the same way in each place.

JD> Andy is adamant on using spaces, since they can never be a part of a
JD> clientId (whereas commas, apparently, can).

Ok, here is the change-bundle which I have checked in. Please review.

At the request of Jim Driscoll, and, by proxy, Andy Schwartz, changing
the separator for the "targets" attribute to be space (not tab) instead
of comma, wherever the "targets" attribute occurs.

All automated tests continue to be successful.

SECTION: Modified Files
----------------------------
M jsf-api/src/javax/faces/application/ViewHandler.java

- Fix javadoc section reference

- Change comma to space in relation to "targets" attribute.

M jsf-ri/conf/share/composite.tld

- Change comma to space in relation to "targets" attribute.

M jsf-ri/src/com/sun/faces/facelets/tag/composite/AttachedObjectTargetImpl.java

- This is the code that consumes the value of the "targets" attribute
  <composite:{editableValueHolder,valueHolder,actionSource} />

M jsf-ri/src/com/sun/faces/application/view/MultiViewHandler.java

- This is the code that consumes the value of the "targets" attribute on
  a <composite:attribute> that points to a MethodExpression

M jsf-demo/ezcomp00/src/main/webapp/resources/ezcomp/loginPanel.xhtml
M jsf-demo/ezcomp01/src/main/webapp/resources/ezcomp/loginPanel.xhtml
M jsf-demo/ezcomp02/src/main/webapp/resources/ezcomp/loginPanel.xhtml
M jsf-demo/ezcomp03/src/main/webapp/resources/ezcomp/loginPanel.xhtml

- Fix usages.


SECTION: Diffs

Index: jsf-api/src/javax/faces/application/ViewHandler.java
===================================================================
--- jsf-api/src/javax/faces/application/ViewHandler.java (revision 5826)
+++ jsf-api/src/javax/faces/application/ViewHandler.java (working copy)
 -493,7 +493,7 @@
 
     /**
      * <p class="changed_added_2_0">Leverage the component metadata
- * specified in section 4.3.2 for the purpose of re-targeting any
+ * specified in section 3.6.2.1 for the purpose of re-targeting any
      * method expressions from the top level component to the
      * appropriate inner component. For each attribute that is a
      * <code>MethodExpression</code> (as indicated by the presence of a
 -505,13 +505,20 @@
      *
      * <ul>
      *
- * <li><p>Get the value of the <em>applyTo</em> attribute. If
- * not found, log an error and continue to the next
- * attribute.</p></li>
+ * <li><p>Get the value of the <em>targets</em> attribute. If the
+ * value is a <code>ValueExpression</code> evaluate it. If there is
+ * no <em>targets</em> attribute, let the name of the metadata
+ * element be the evaluated value of the <em>targets
+ * attribute.</em></p></li>
+ *
+ * <li><p>Interpret <em>targets</em> as a space (not tab) separated
+ * list of ids. For each entry in the list:</p>
+ *
+ * <ul>
      *
      * <li><p>Find the inner component of the
      * <em>topLevelComponent</em> with the id equal to
- * <em>applyTo</em>. For discussion, this component is called
+ * the current list entry. For discussion, this component is called
      * <em>target</em>. If not found, log and error and continue to
      * the next attribute.</p></li>
      *
 -574,15 +581,17 @@
      * <em>target</em>, passing <em>attributeMethodExpression</em> wrapped in a
      * {_at_link javax.faces.event.MethodExpressionValueChangeListener}.</p></li>
      *
- * <li><p>Otherwise, look for a JavaBeans setter that matches
- * <em>name</em> and assume it takes a
- * <code>MethodExpression</code>, passing
- * <em>attributeMethodExpression</em> as that expression. If
- * such a setter does not exist, or does not take a
- * <code>MethodExpression</code>, log an error and continue to
- * the next attribute.</p></li>
- *
+ * <li><p>Otherwise, assume that the <code>MethodExpression</code>
+ * should be placed in the components attribute set. The runtme
+ * must create the <code>MethodExpression</code> instance based on
+ * the value of the "<code>method-signature</code>"
+ * attribute.</p></li>
+
      * </ul>
+ *
+ * </li>
+ *
+ * </ul>
      *
      * <p>An implementation is provided that will throw
      * <code>UnsupportedOperationException</code>. A Faces implementation
Index: jsf-ri/conf/share/composite.tld
===================================================================
--- jsf-ri/conf/share/composite.tld (revision 5826)
+++ jsf-ri/conf/share/composite.tld (working copy)
 -535,7 +535,7 @@
 
 <p>If the this element has a <code>method-signature</code> attribute,
 the value of the <code>targets</code> attribute must be interpreted as a
-comma separated list of component ids of components within the
+space (not tab) separated list of component ids of components within the
 <code>&lt;composite:implementation&gt;</code> section. Each entry in
 the list must be interpreted as the id of an inner component to which
 the <code>MethodExpression</code> from the <em>composite component
 -1089,7 +1089,7 @@
 
                 <![CDATA[
 <div class="changed_added_2_0">
-<p>If present, this must be a comma separated
+<p>If present, this must be a space (not tab) separated
                 list of component ids of components within the
                 <code>&lt;composite:implementation&gt;</code> section.
                 If not present, the "name" attribute must be present.
 -1171,7 +1171,7 @@
 
                 <![CDATA[
 <div class="changed_added_2_0">
-<p>If present, this must be a comma separated
+<p>If present, this must be a space (not tab) separated
                 list of component ids of components within the
                 <code>&lt;composite:implementation&gt;</code> section.
                 If not present, the "name" attribute must be present.
 -1281,7 +1281,7 @@
 
                 <![CDATA[
 <div class="changed_added_2_0">
-<p>If present, this must be a comma separated
+<p>If present, this must be a space (not tab) separated
                 list of component ids of components within the
                 <code>&lt;composite:implementation&gt;</code> section.
                 If not present, the "name" attribute must be present.
Index: jsf-ri/src/com/sun/faces/facelets/tag/composite/AttachedObjectTargetImpl.java
===================================================================
--- jsf-ri/src/com/sun/faces/facelets/tag/composite/AttachedObjectTargetImpl.java (revision 5826)
+++ jsf-ri/src/com/sun/faces/facelets/tag/composite/AttachedObjectTargetImpl.java (working copy)
 -99,7 +99,7 @@
         assert (null != component);
         UIComponent comp = null;
         if (null != targetsList) {
- String [] targetArray = targetsList.split(",");
+ String [] targetArray = targetsList.split(" ");
             for (int i = 0; i < targetArray.length; i++) {
                 comp = component.findComponent(targetArray[i]);
                 if (null != comp) {
Index: jsf-ri/src/com/sun/faces/application/view/MultiViewHandler.java
===================================================================
--- jsf-ri/src/com/sun/faces/application/view/MultiViewHandler.java (revision 5826)
+++ jsf-ri/src/com/sun/faces/application/view/MultiViewHandler.java (working copy)
 -299,7 +299,7 @@
                     }
                     
                     
- String[] targetIds = targets.split(",");
+ String[] targetIds = targets.split(" ");
                     
                     for (String curTarget : targetIds) {
                     
Index: jsf-demo/ezcomp00/src/main/webapp/resources/ezcomp/loginPanel.xhtml
===================================================================
--- jsf-demo/ezcomp00/src/main/webapp/resources/ezcomp/loginPanel.xhtml (revision 5826)
+++ jsf-demo/ezcomp00/src/main/webapp/resources/ezcomp/loginPanel.xhtml (working copy)
 -70,7 +70,7 @@
   <composite:editableValueHolder name="username" />
   <composite:actionSource name="loginEvent" />
   <composite:actionSource name="cancelEvent" />
- <composite:actionSource name="allEvents" targets="loginEvent,cancelEvent" />
+ <composite:actionSource name="allEvents" targets="loginEvent cancelEvent" />
 
   <composite:facet name="header" />
 
Index: jsf-demo/ezcomp01/src/main/webapp/resources/ezcomp/loginPanel.xhtml
===================================================================
--- jsf-demo/ezcomp01/src/main/webapp/resources/ezcomp/loginPanel.xhtml (revision 5826)
+++ jsf-demo/ezcomp01/src/main/webapp/resources/ezcomp/loginPanel.xhtml (working copy)
 -70,7 +70,7 @@
   <composite:editableValueHolder name="username" />
   <composite:actionSource name="loginEvent" />
   <composite:actionSource name="cancelEvent" />
- <composite:actionSource name="allEvents" targets="loginEvent,cancelEvent" />
+ <composite:actionSource name="allEvents" targets="loginEvent cancelEvent" />
 
   <composite:facet name="header" />
 
Index: jsf-demo/ezcomp02/src/main/webapp/resources/ezcomp/loginPanel.xhtml
===================================================================
--- jsf-demo/ezcomp02/src/main/webapp/resources/ezcomp/loginPanel.xhtml (revision 5826)
+++ jsf-demo/ezcomp02/src/main/webapp/resources/ezcomp/loginPanel.xhtml (working copy)
 -64,7 +64,7 @@
 
   <composite:editableValueHolder name="usernameInput" />
   <composite:editableValueHolder name="pinInput" />
- <composite:editableValueHolder name="allInputs" targets="usernameInput,pinInput" />
+ <composite:editableValueHolder name="allInputs" targets="usernameInput pinInput" />
   <composite:actionSource name="loginEvent" />
 
 </composite:interface>
Index: jsf-demo/ezcomp03/src/main/webapp/resources/ezcomp/loginPanel.xhtml
===================================================================
--- jsf-demo/ezcomp03/src/main/webapp/resources/ezcomp/loginPanel.xhtml (revision 5826)
+++ jsf-demo/ezcomp03/src/main/webapp/resources/ezcomp/loginPanel.xhtml (working copy)
 -62,7 +62,7 @@
 
   <composite:editableValueHolder name="usernameInput" />
   <composite:editableValueHolder name="pinInput" />
- <composite:editableValueHolder name="allInputs" targets="usernameInput,pinInput" />
+ <composite:editableValueHolder name="allInputs" targets="usernameInput pinInput" />
   <composite:actionSource name="loginEvent" />
 
 </composite:interface>

-- 
| ed.burns_at_sun.com  | office: 408 884 9519 OR x31640
| homepage:         | http://ridingthecrest.com/