tapestry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject svn commit: r902152 - /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/InternalComponentResourcesImpl.java
Date Fri, 22 Jan 2010 16:30:41 GMT
Author: hlship
Date: Fri Jan 22 16:30:41 2010
New Revision: 902152

URL: http://svn.apache.org/viewvc?rev=902152&view=rev
Log:
Allow for a parameter change when there are no listeners

Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/InternalComponentResourcesImpl.java

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/InternalComponentResourcesImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/InternalComponentResourcesImpl.java?rev=902152&r1=902151&r2=902152&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/InternalComponentResourcesImpl.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/InternalComponentResourcesImpl.java
Fri Jan 22 16:30:41 2010
@@ -4,7 +4,7 @@
 // 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,
@@ -14,8 +14,23 @@
 
 package org.apache.tapestry5.internal.structure;
 
-import org.apache.tapestry5.*;
-import org.apache.tapestry5.internal.*;
+import java.lang.annotation.Annotation;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.tapestry5.Binding;
+import org.apache.tapestry5.Block;
+import org.apache.tapestry5.ComponentEventCallback;
+import org.apache.tapestry5.ComponentResources;
+import org.apache.tapestry5.EventContext;
+import org.apache.tapestry5.Link;
+import org.apache.tapestry5.MarkupWriter;
+import org.apache.tapestry5.internal.InternalComponentResources;
+import org.apache.tapestry5.internal.ParameterAccess;
+import org.apache.tapestry5.internal.ParameterChangeListener;
+import org.apache.tapestry5.internal.ParameterChangedEvent;
 import org.apache.tapestry5.internal.services.Instantiator;
 import org.apache.tapestry5.ioc.AnnotationProvider;
 import org.apache.tapestry5.ioc.Location;
@@ -32,12 +47,6 @@
 import org.apache.tapestry5.runtime.RenderQueue;
 import org.slf4j.Logger;
 
-import java.lang.annotation.Annotation;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Set;
-
 /**
  * The bridge between a component and its {@link ComponentPageElement}, that supplies all
kinds of
  * resources to the
@@ -618,11 +627,13 @@
                 }
 
                 Class bindingType = binding.getBindingType();
+                
                 try
                 {
                     Object coerced = elementResources.coerce(parameterValue, bindingType);
 
                     binding.set(coerced);
+                
                     fireParameterChanged(parameterName, coerced);
                 }
                 catch (Exception ex)
@@ -672,9 +683,13 @@
             protected void fireParameterChanged(String parameterName, Object newValue)
             {
                 ParameterChangedEvent event = new ParameterChangedEvent(parameterName, newValue);
-                for (ParameterChangeListener l : listeners)
+
+                if (listeners != null)
                 {
-                    l.parameterChanged(event);
+                    for (ParameterChangeListener l : listeners)
+                    {
+                        l.parameterChanged(event);
+                    }
                 }
             }
 



Mime
View raw message