}
for (Behavior behavior : source.getBehaviors()) {
if (behavior instanceof AjaxBehavior) {
AjaxBehavior ajaxBehavior = (AjaxBehavior) behavior;
boolean isAjaxTarget = ajaxBehavior.isAjaxTarget(context);
if (logger.isTraceEnabled()) {
String behaviorClassName = ClassUtils.getShortClassName(
ajaxBehavior.getClass());
HtmlStringBuffer buffer = new HtmlStringBuffer();
buffer.append(" invoked: ");
buffer.append(behaviorClassName);
buffer.append(".isAjaxTarget() : ");
buffer.append(isAjaxTarget);
logger.trace(buffer.toString());
}
if (isAjaxTarget) {
// The first non-null ActionResult returned will be rendered, other
// ActionResult instances are ignored
ActionResult behaviorActionResult =
ajaxBehavior.onAction(source);
if (actionResult == null && behaviorActionResult != null) {
actionResult = behaviorActionResult;
}
if (logger.isTraceEnabled()) {
String behaviorClassName = ClassUtils.getShortClassName(
ajaxBehavior.getClass());
String actionResultClassName = null;
if (behaviorActionResult != null) {
actionResultClassName = ClassUtils.getShortClassName(
behaviorActionResult.getClass());