You are viewing a plain text version of this content. The canonical link for it is here.
Posted to adffaces-commits@incubator.apache.org by aw...@apache.org on 2007/04/27 22:48:39 UTC

svn commit: r533247 - /incubator/adffaces/branches/faces-1_2-070427/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentELTag.java

Author: awiner
Date: Fri Apr 27 15:48:38 2007
New Revision: 533247

URL: http://svn.apache.org/viewvc?view=rev&rev=533247
Log:
Merge trunk changes to UIXComponentTag into UIXComponentELTag

Modified:
    incubator/adffaces/branches/faces-1_2-070427/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentELTag.java

Modified: incubator/adffaces/branches/faces-1_2-070427/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentELTag.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070427/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentELTag.java?view=diff&rev=533247&r1=533246&r2=533247
==============================================================================
--- incubator/adffaces/branches/faces-1_2-070427/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentELTag.java (original)
+++ incubator/adffaces/branches/faces-1_2-070427/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentELTag.java Fri Apr 27 15:48:38 2007
@@ -1,17 +1,20 @@
 /*
- * Copyright  2004-2006 The Apache Software Foundation.
+ *  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
  * 
- * Licensed 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
  * 
- *      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.
+ *  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.trinidad.webapp;
 
@@ -74,23 +77,11 @@
   public int doEndTag() throws JspException
   {
     UIComponent component = getComponentInstance();
-    // =-=FIXME AdamWiner: encodeBegin() is no longer called;
-    // for now, always apply changes in both doEndTag() and encodeBegin()
-    //    if (isSuppressed())
-      _applyChanges(getFacesContext(), component, getCreated());
+    if (getCreated())
+      _applyChanges(getFacesContext(), component);
     return super.doEndTag();
   }
 
-  /*
-  @Override
-  protected void encodeBegin() throws java.io.IOException
-  {
-    UIComponent component = getComponentInstance();
-    if (!isSuppressed())
-      _applyChanges(getFacesContext(), component, getCreated());
-    super.encodeBegin();
-  }
-  */
 
   @Override
   protected final void setProperties(UIComponent component)
@@ -229,13 +220,12 @@
               ints[i] = j;
             }
           }
-          catch (NumberFormatException e)
-          {
-            _LOG.severe("Could not convert:"+value+" into int[]", e);
-            return;
-          }
-
-          bean.setProperty(key, ints);
+        }
+        catch (NumberFormatException e)
+        {
+          _LOG.severe("CANNOT_CONVERT_INTO_INT_ARRAY",value);
+          _LOG.severe(e);
+          return;
         }
       }
     }
@@ -304,8 +294,7 @@
     }
     catch (ParseException pe)
     {
-      _LOG.info("Could not parse value {0} into a Date using " +
-                "pattern \"yyyy-MM-dd\";  ignoring.", stringValue);
+      _LOG.info("CANNOT_PARSE_VALUE_INTO_DATE", stringValue);
       return null;
     }
   }
@@ -370,8 +359,7 @@
 
   private static void _applyChanges(
     FacesContext facesContext,
-    UIComponent uiComponent,
-    boolean isCreated)
+    UIComponent uiComponent)
   {
     RequestContext afc = RequestContext.getCurrentInstance();
     Iterator<ComponentChange> changeIter =
@@ -382,19 +370,9 @@
     while (changeIter.hasNext())
     {
       ComponentChange change = changeIter.next();
-
-      //pu: If we did not create the component during tag execution, do not
-      //  apply any AttributeChange. This is because we do not have enough
-      //  mechanism to take care of such cases for now. Users could always apply
-      //  such Changes explicitly in their backing bean after creating component.
-      boolean isChangeApplicable =
-        ( (change instanceof AttributeComponentChange) && !isCreated) ? false:true;
-
-      if (isChangeApplicable)
-      {
-        change.changeComponent(uiComponent);
-      }
-
+      
+      change.changeComponent(uiComponent);
+      
       //pu: In case this Change has added a new component/facet, the added
       //  component could have its own Changes, that may need to be applied here.
       if (change instanceof AddComponentChange)
@@ -404,7 +382,7 @@
 
         if (newAddedComponent != null)
         {
-          _applyChanges(facesContext, newAddedComponent, true);
+          _applyChanges(facesContext, newAddedComponent);
         }
       }
     }