You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2010/06/09 00:35:23 UTC

svn commit: r952850 - in /myfaces/core/trunk: api/src/main/java/javax/faces/component/ impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/

Author: lu4242
Date: Tue Jun  8 22:35:23 2010
New Revision: 952850

URL: http://svn.apache.org/viewvc?rev=952850&view=rev
Log:
f:selectItems noSelectionValue should not be added on core tld

Added:
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/SelectItemsHandler.java
Modified:
    myfaces/core/trunk/api/src/main/java/javax/faces/component/_UISelectItems.java
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/CoreLibrary.java

Modified: myfaces/core/trunk/api/src/main/java/javax/faces/component/_UISelectItems.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/java/javax/faces/component/_UISelectItems.java?rev=952850&r1=952849&r2=952850&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/java/javax/faces/component/_UISelectItems.java (original)
+++ myfaces/core/trunk/api/src/main/java/javax/faces/component/_UISelectItems.java Tue Jun  8 22:35:23 2010
@@ -146,21 +146,5 @@ abstract class _UISelectItems extends UI
   public boolean isItemLabelEscaped() {
       return true;
   }
-  
-  /**
-   * Is either an EL expression pointing to the element in the value collection
-   * whose value should be marked as a "no selection" item, or a literal string
-   * that exactly matches the value of the item in the collection that must be 
-   * marked as the "no selection" item. If the user selects such an item and 
-   * the field is marked as required, then it will not pass validation.
-   * 
-   * @since 2.0
-   * @return
-   */
-  @JSFExclude
-  @JSFProperty
-  public Object getNoSelectionValue() {
-      return null;
-  }
 
 }

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/CoreLibrary.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/CoreLibrary.java?rev=952850&r1=952849&r2=952850&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/CoreLibrary.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/CoreLibrary.java Tue Jun  8 22:35:23 2010
@@ -77,7 +77,7 @@ public final class CoreLibrary extends A
 
         this.addComponent("selectItem", UISelectItem.COMPONENT_TYPE, null, SelectItemHandler.class);
 
-        this.addComponent("selectItems", UISelectItems.COMPONENT_TYPE, null);
+        this.addComponent("selectItems", UISelectItems.COMPONENT_TYPE, null, SelectItemsHandler.class);
 
         this.addTagHandler("setPropertyActionListener", SetPropertyActionListenerHandler.class);
 

Added: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/SelectItemsHandler.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/SelectItemsHandler.java?rev=952850&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/SelectItemsHandler.java (added)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/SelectItemsHandler.java Tue Jun  8 22:35:23 2010
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.view.facelets.tag.jsf.core;
+
+import javax.faces.view.facelets.ComponentConfig;
+import javax.faces.view.facelets.ComponentHandler;
+
+import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFFaceletAttribute;
+import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFFaceletTag;
+
+@JSFFaceletTag(
+        name = "f:selectItems",
+        bodyContent = "empty",
+        componentClass="javax.faces.component.UISelectItems")
+public class SelectItemsHandler extends ComponentHandler
+{
+
+    public SelectItemsHandler(ComponentConfig config)
+    {
+        super(config);
+    }
+    
+    
+    /**
+     * Is either an EL expression pointing to the element in the value collection
+     * whose value should be marked as a "no selection" item, or a literal string
+     * that exactly matches the value of the item in the collection that must be 
+     * marked as the "no selection" item. If the user selects such an item and 
+     * the field is marked as required, then it will not pass validation.
+     * 
+     * @since 2.0
+     * @return
+     */
+    @JSFFaceletAttribute(name = "noSelectionValue",
+            className = "javax.el.ValueExpression",
+            deferredValueType = "java.lang.Boolean")
+    private boolean getNoSelectionValue() {
+        return false;
+    }
+}