updateContainerID;
}
MTAjaxUpdateLink.addEffect(options, afterEffect, afterEffectID, property, start, duration, mode);
}
WOAssociation directActionNameAssociation = (WOAssociation) associations().valueForKey("directActionName");
if(beforeEffect == null && updateContainerID != null && directActionNameAssociation == null && replaceID == null
&& function == null && onClick == null && onClickBefore == null) {
NSDictionary nonDefaultOptions = MTAjaxUpdateContainer.removeDefaultOptions(options);
onClickBuffer.append("MTAUL.")
.append(generateFunctionWrapper ? "updateFunc" : "update")
.append("('").append(updateContainerID).append("', ");
AjaxOptions.appendToBuffer(nonDefaultOptions, onClickBuffer, context);
onClickBuffer.append(", '").append(context.contextID()).append('.').append(context.elementID())
.append('\'').append(')').append(';');
} else {
if(generateFunctionWrapper) {
onClickBuffer.append("function(additionalParams) {");
}
if(onClickBefore != null) {
onClickBuffer.append("if (")
.append(onClickBefore)
.append(") { ");
}
// EFFECTS
if(beforeEffect != null) {
String beforeEffectID = (String)valueForBinding("beforeEffectID", component);
String beforeEffectDuration = (String) valueForBinding("beforeEffectDuration", component);
String beforeEffectProperty = (String)valueForBinding("beforeEffectProperty", component);
String beforeEffectStart = (String)valueForBinding("beforeEffectStart", component);
if(beforeEffectID == null) {
beforeEffectID = AjaxUpdateContainer.currentUpdateContainerID() != null ?
AjaxUpdateContainer.currentUpdateContainerID() : updateContainerID;
}
if(beforeEffect.equals("tween")) {
if(beforeEffectDuration != null) {
onClickBuffer.append("$('").append(beforeEffectID)
.append("').set('tween', { duration: '")
.append(beforeEffectDuration).append("', property: '" + beforeEffectProperty + "' });");
} else {
onClickBuffer.append("$('").append(beforeEffectID).append("').set('tween', { property: '" + beforeEffectProperty + "' });");
}
onClickBuffer.append("$('").append(beforeEffectID).append("').get('tween').start(")
.append(beforeEffectStart).append(").chain(function() {");
} else if(beforeEffect.equals("morph")) {
if(beforeEffectDuration != null) {
onClickBuffer.append("$('").append(beforeEffectID).append("').set('morph', { duration: '").append(beforeEffectDuration).append("' });");
}
onClickBuffer.append("$('").append(beforeEffectID).append("').get('morph').start('." + beforeEffectStart + "'").append(").chain(function() {");
} else if(beforeEffect.equals("slide")) {
String mode = (String) valueForBinding("effectSlideMode", component);
String transition = (String) valueForBinding("beforeEffectTransition", component);
onClickBuffer.append("$('").append(beforeEffectID).append("').set('slide'");
if(beforeEffectDuration != null || mode != null) {
onClickBuffer.append(", { ");
if(beforeEffectDuration != null) {
onClickBuffer.append("duration: '").append(beforeEffectDuration).append('\'').append(mode != null || transition != null ? "," : "");
}
if(mode != null) {
onClickBuffer.append("mode: '").append(mode).append('\'').append(transition != null ? "," : "");
}
if(transition != null) {
onClickBuffer.append("transition: ").append(transition);
}
onClickBuffer.append('}');
}
onClickBuffer.append("); $('").append(beforeEffectID).append("').get('slide').slide").append(ERXStringUtilities.capitalize(beforeEffectProperty)).append("().chain(function() {");
} else if(beforeEffect.equals("highlight")) {
if(beforeEffectDuration != null) {
onClickBuffer.append("$('").append(beforeEffectID)
.append("').set('tween', { duration: '").append(beforeEffectDuration).append("', property: 'background-color'});");
} else {
onClickBuffer.append("$('").append(beforeEffectID)
.append("').set('tween', { property: 'background-color' });");
}
onClickBuffer.append("$('").append(updateContainerID).append("').get('tween').start('").append(beforeEffectProperty != null ? beforeEffectProperty : "#ffff88', '#ffffff")
.append("').chain(function() { ");
}
}
String actionUrl = null;
if(directActionNameAssociation != null) {
actionUrl = context.directActionURLForActionNamed((String) directActionNameAssociation.valueInComponent(component), ERXComponentUtilities.queryParametersInComponent(associations(), component)).replaceAll("&", "&");
} else {
actionUrl = AjaxUtils.ajaxComponentActionUrl(context);
}
actionUrl = "'" + actionUrl + "'";