Search in sources :

Example 21 with WOComponent

use of com.webobjects.appserver.WOComponent in project wonder-slim by undur.

the class AjaxRoundEffect method appendToResponse.

@Override
public void appendToResponse(WOResponse response, WOContext context) {
    super.appendToResponse(response, context);
    WOComponent component = context.component();
    String className = (String) _classAssociation.valueInComponent(component);
    String elementName = (String) _elementNameAssociation.valueInComponent(component);
    boolean generateTags = ((Boolean) _generateTagsAssociation.valueInComponent(component)).booleanValue();
    if (generateTags) {
        elementName = "div";
        response.appendContentString("<");
        response.appendContentString(elementName);
        response.appendContentString(" class = \"");
        response.appendContentString(className);
        response.appendContentString("\"");
        if (_idAssociation != null) {
            response.appendContentString(" id = \"");
            String id = (String) _idAssociation.valueInComponent(component);
            response.appendContentString(id);
            response.appendContentString("\"");
        }
        response.appendContentString(">");
    }
    appendChildrenToResponse(response, context);
    if (generateTags) {
        response.appendContentString("\n</");
        response.appendContentString(elementName);
        response.appendContentString(">");
    }
    response.appendContentString("\n");
    AjaxUtils.appendScriptHeader(response);
    response.appendContentString("new Rico.Effect.Round('");
    response.appendContentString(elementName);
    response.appendContentString("', '");
    response.appendContentString(className);
    response.appendContentString("', ");
    NSDictionary options = createAjaxOptions(component);
    AjaxOptions.appendToResponse(options, response, context);
    response.appendContentString(");");
    AjaxUtils.appendScriptFooter(response);
}
Also used : WOComponent(com.webobjects.appserver.WOComponent) NSDictionary(com.webobjects.foundation.NSDictionary)

Example 22 with WOComponent

use of com.webobjects.appserver.WOComponent in project wonder-slim by undur.

the class FocusText method appendToResponse.

@Override
public void appendToResponse(WOResponse response, WOContext context) {
    AjaxUtils.addScriptResourceInHead(context, response, "prototype.js");
    super.appendToResponse(response, context);
    WOComponent component = context.component();
    boolean focus = (_focus == null || _focus.booleanValueInComponent(component));
    String id = id(component, context);
    boolean selectAll = (_selectAll != null && _selectAll.booleanValueInComponent(component));
    String onEnterScript = (_onEnter != null) ? (String) _onEnter.valueInComponent(component) : null;
    FocusTextField.appendJavascriptToResponse(response, context, id, focus, selectAll, onEnterScript);
}
Also used : WOComponent(com.webobjects.appserver.WOComponent)

Example 23 with WOComponent

use of com.webobjects.appserver.WOComponent in project wonder-slim by undur.

the class FocusText method _appendAttributesFromAssociationsToResponse.

@Override
protected void _appendAttributesFromAssociationsToResponse(WOResponse woresponse, WOContext wocontext, NSDictionary nsdictionary) {
    super._appendAttributesFromAssociationsToResponse(woresponse, wocontext, nsdictionary);
    WOComponent component = wocontext.component();
    String onKeyPress = (_onKeyPress != null) ? (String) _onKeyPress.valueInComponent(component) : null;
    String onEnterScript = (_onEnter != null) ? (String) _onEnter.valueInComponent(component) : null;
    String id = id(component, wocontext);
    if (_id == null) {
        woresponse.appendContentString(" id = \"" + id + "\"");
    }
    FocusTextField._appendAttributesFromAssociationsToResponse(woresponse, wocontext, id, onKeyPress, onEnterScript);
}
Also used : WOComponent(com.webobjects.appserver.WOComponent)

Example 24 with WOComponent

use of com.webobjects.appserver.WOComponent in project wonder-slim by undur.

the class WOMetaRefresh method invokeAction.

public WOComponent invokeAction() {
    WOComponent aComponent = null;
    if (hasBinding("pageName")) {
        String aPageName = (String) _WOJExtensionsUtil.valueForBindingOrNull("pageName", this);
        aComponent = pageWithName(aPageName);
    } else {
        aComponent = (WOComponent) _WOJExtensionsUtil.valueForBindingOrNull("action", this);
    }
    return aComponent;
}
Also used : WOComponent(com.webobjects.appserver.WOComponent)

Example 25 with WOComponent

use of com.webobjects.appserver.WOComponent in project wonder-slim by undur.

the class ERXAjaxSession method savePageInPermanentCache.

/**
 * Saves a page in the permanent cache. Overridden to not save in the super implementation's iVars but in our own.
 */
// FIXME: ak: as we save the perm pages under a lot of context IDs, we should have a way to actually limit the size...
// not sure how, though
@Override
public void savePageInPermanentCache(WOComponent wocomponent) {
    if (overridePrivateCache) {
        WOContext wocontext = context();
        String contextID = wocontext.contextID();
        log.debug("Saving page for contextID: {}", contextID);
        NSMutableDictionary permanentPageCache = _permanentPageCache();
        for (int i = WOApplication.application().permanentPageCacheSize(); _permanentContextIDArray.count() >= i; _permanentContextIDArray.removeObjectAtIndex(0)) {
            String s1 = (String) _permanentContextIDArray.objectAtIndex(0);
            WOComponent page = (WOComponent) permanentPageCache.removeObjectForKey(s1);
            if (storesPageInfo()) {
                pageInfoDictionary().removeObjectForKey(page);
            }
        }
        permanentPageCache.setObjectForKey(wocomponent, contextID);
        _permanentContextIDArray.addObject(contextID);
    } else {
        super.savePageInPermanentCache(wocomponent);
    }
}
Also used : WOComponent(com.webobjects.appserver.WOComponent) WOContext(com.webobjects.appserver.WOContext) NSMutableDictionary(com.webobjects.foundation.NSMutableDictionary)

Aggregations

WOComponent (com.webobjects.appserver.WOComponent)68 WOActionResults (com.webobjects.appserver.WOActionResults)11 WOResponse (com.webobjects.appserver.WOResponse)10 WOContext (com.webobjects.appserver.WOContext)8 NSMutableDictionary (com.webobjects.foundation.NSMutableDictionary)8 NSDictionary (com.webobjects.foundation.NSDictionary)7 Format (java.text.Format)5 WOApplication (com.webobjects.appserver.WOApplication)4 WOAssociation (com.webobjects.appserver.WOAssociation)4 NSMutableArray (com.webobjects.foundation.NSMutableArray)4 ERXWOContext (er.extensions.appserver.ERXWOContext)4 ParseException (java.text.ParseException)4 ArrayList (java.util.ArrayList)4 List (java.util.List)4 WOElement (com.webobjects.appserver.WOElement)3 WORequest (com.webobjects.appserver.WORequest)3 WODynamicElementCreationException (com.webobjects.appserver._private.WODynamicElementCreationException)3 NSArray (com.webobjects.foundation.NSArray)3 WOSession (com.webobjects.appserver.WOSession)2 ERXMutableURL (er.extensions.foundation.ERXMutableURL)2