use of com.webobjects.appserver.WOActionResults in project wonder-slim by undur.
the class AjaxInPlace method save.
public WOActionResults save() {
// check to see if we can save before firing the action (for permissions)
WOActionResults results = null;
boolean canSave = canSave();
if (canSave) {
if (hasBinding("saveAction")) {
results = (WOActionResults) valueForBinding("saveAction");
canSave = canSave();
}
// check to see if we can save after firing the action (in case validation failed or something)
if (canSave && !editOnly()) {
setEditing(false);
}
}
// ignore results
return results;
}
use of com.webobjects.appserver.WOActionResults in project wonder-slim by undur.
the class AjaxTree method invokeAction.
@Override
public WOActionResults invokeAction(WORequest aRequest, WOContext aContext) {
resetTree();
WOActionResults results = super.invokeAction(aRequest, aContext);
resetTree();
return results;
}
use of com.webobjects.appserver.WOActionResults in project wonder-slim by undur.
the class AjaxUpdateLink method handleRequest.
@Override
public WOActionResults handleRequest(WORequest request, WOContext context) {
WOComponent component = context.component();
boolean disabled = booleanValueForBinding("disabled", false, component);
String updateContainerID = AjaxUpdateContainer.updateContainerID(this, component);
AjaxUpdateContainer.setUpdateContainerID(request, updateContainerID);
WOActionResults results = null;
if (!disabled) {
results = (WOActionResults) valueForBinding("action", component);
}
if (ERXAjaxApplication.isAjaxReplacement(request)) {
AjaxUtils.setPageReplacementCacheKey(context, (String) valueForBinding("replaceID", component));
} else if (results == null || booleanValueForBinding("ignoreActionResponse", false, component)) {
String script = (String) valueForBinding("onClickServer", component);
if (script != null) {
WOResponse response = AjaxUtils.createResponse(request, context);
AjaxUtils.appendScriptHeaderIfNecessary(request, response);
response.appendContentString(script);
AjaxUtils.appendScriptFooterIfNecessary(request, response);
results = response;
}
} else if (updateContainerID != null) {
AjaxUtils.setPageReplacementCacheKey(context, updateContainerID);
}
return results;
}
use of com.webobjects.appserver.WOActionResults in project wonder-slim by undur.
the class AjaxResponse method generateResponse.
@Override
public WOResponse generateResponse() {
if (AjaxUpdateContainer.hasUpdateContainerID(_request)) {
String originalSenderID = _context.senderID();
_context._setSenderID("");
try {
CharSequence originalContent = _content;
_content = new StringBuilder();
NSMutableDictionary userInfo = ERXWOContext.contextDictionary();
userInfo.setObjectForKey(Boolean.TRUE, AjaxResponse.AJAX_UPDATE_PASS);
WOActionResults woactionresults = WOApplication.application().invokeAction(_request, _context);
_content.append(originalContent);
if (_responseAppenders != null) {
Enumeration responseAppendersEnum = _responseAppenders.objectEnumerator();
while (responseAppendersEnum.hasMoreElements()) {
AjaxResponseAppender responseAppender = (AjaxResponseAppender) responseAppendersEnum.nextElement();
responseAppender.appendToResponse(this, _context);
}
}
if (_contentLength() == 0) {
setStatus(HTTP_STATUS_INTERNAL_ERROR);
log.warn("You performed an Ajax update, but no response was generated. A common cause of this is that you spelled your updateContainerID wrong. You specified a container ID '" + AjaxUpdateContainer.updateContainerID(_request) + "'.");
}
} finally {
_context._setSenderID(originalSenderID);
}
}
return this;
}
use of com.webobjects.appserver.WOActionResults in project wonder-slim by undur.
the class AjaxFileUpload method uploadFailed.
public WOActionResults uploadFailed() {
uploadFinished();
WOActionResults results = (WOActionResults) valueForBinding("failedAction");
return results;
}
Aggregations