Search in sources :

Example 21 with WOActionResults

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;
}
Also used : WOActionResults(com.webobjects.appserver.WOActionResults)

Example 22 with WOActionResults

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;
}
Also used : WOActionResults(com.webobjects.appserver.WOActionResults)

Example 23 with WOActionResults

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;
}
Also used : WOActionResults(com.webobjects.appserver.WOActionResults) WOComponent(com.webobjects.appserver.WOComponent) WOResponse(com.webobjects.appserver.WOResponse)

Example 24 with WOActionResults

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;
}
Also used : WOActionResults(com.webobjects.appserver.WOActionResults) Enumeration(java.util.Enumeration) NSMutableDictionary(com.webobjects.foundation.NSMutableDictionary)

Example 25 with WOActionResults

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;
}
Also used : WOActionResults(com.webobjects.appserver.WOActionResults)

Aggregations

WOActionResults (com.webobjects.appserver.WOActionResults)31 WOComponent (com.webobjects.appserver.WOComponent)11 WOResponse (com.webobjects.appserver.WOResponse)6 WOElement (com.webobjects.appserver.WOElement)2 WOApplication (com.webobjects.appserver.WOApplication)1 WOContext (com.webobjects.appserver.WOContext)1 WORequest (com.webobjects.appserver.WORequest)1 WOForm (com.webobjects.appserver._private.WOForm)1 WONoContentElement (com.webobjects.appserver._private.WONoContentElement)1 NSArray (com.webobjects.foundation.NSArray)1 NSData (com.webobjects.foundation.NSData)1 NSMutableArray (com.webobjects.foundation.NSMutableArray)1 NSMutableDictionary (com.webobjects.foundation.NSMutableDictionary)1 NSRange (com.webobjects.foundation.NSRange)1 ERXWOContext (er.extensions.appserver.ERXWOContext)1 ERXWOForm (er.extensions.components._private.ERXWOForm)1 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 FileOutputStream (java.io.FileOutputStream)1 IOException (java.io.IOException)1