Author: sabob
Date: Thu Jun 17 10:37:54 2010
New Revision: 955541
URL: http://svn.apache.org/viewvc?rev=955541&view=rev
Log:
The first non-null partial should be rendered. Added improved logging.
Modified:
click/trunk/click/framework/src/org/apache/click/ActionEventDispatcher.java
Modified: click/trunk/click/framework/src/org/apache/click/ActionEventDispatcher.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/src/org/apache/click/ActionEventDispatcher.java?rev=955541&r1=955540&r2=955541&view=diff
==============================================================================
--- click/trunk/click/framework/src/org/apache/click/ActionEventDispatcher.java (original)
+++ click/trunk/click/framework/src/org/apache/click/ActionEventDispatcher.java Thu Jun 17
10:37:54 2010
@@ -293,7 +293,10 @@ public class ActionEventDispatcher {
if (behavior.isRequestTarget(context)) {
- partial = behavior.onAction(source);
+ Partial behaviorPartial = behavior.onAction(source);
+ if (partial == null && behaviorPartial != null) {
+ partial = behaviorPartial;
+ }
if (logger.isTraceEnabled()) {
String behaviorClassName = ClassUtils.getShortClassName(behavior.getClass());
@@ -301,7 +304,16 @@ public class ActionEventDispatcher {
buffer.append(" invoked: ");
buffer.append(behaviorClassName);
buffer.append(".isRequestTarget() : true");
- buffer.append(" (Ajax Behavior found)");
+
+ if (partial == behaviorPartial && behaviorPartial != null) {
+ buffer.append(" (Partial content will be rendered)");
+ } else {
+ if (behaviorPartial == null) {
+ buffer.append(" (Partial is null and will be ignored)");
+ } else {
+ buffer.append(" (Partial will be ignored since another Behavior
already retuned a non-null Partial)");
+ }
+ }
logger.trace(buffer.toString());
|