Search in sources :

Example 6 with NSMutableDictionary

use of com.webobjects.foundation.NSMutableDictionary in project wonder-slim by undur.

the class AjaxFunctionButton method processAssociations.

protected static NSDictionary processAssociations(NSDictionary associations) {
    NSMutableDictionary mutableAssociations = (NSMutableDictionary) associations;
    mutableAssociations.setObjectForKey(new WOConstantValueAssociation("button"), "type");
    return mutableAssociations;
}
Also used : WOConstantValueAssociation(com.webobjects.appserver._private.WOConstantValueAssociation) NSMutableDictionary(com.webobjects.foundation.NSMutableDictionary)

Example 7 with NSMutableDictionary

use of com.webobjects.foundation.NSMutableDictionary in project wonder-slim by undur.

the class AjaxHighlight method highlight.

public static final void highlight(Object obj, boolean isNew) {
    if (obj != null) {
        NSMutableDictionary highlightedObjects = (NSMutableDictionary) ERXWOContext.contextDictionary().valueForKey(AjaxHighlight.HIGHLIGHTED_KEY);
        if (highlightedObjects == null) {
            highlightedObjects = new NSMutableDictionary();
            ERXWOContext.contextDictionary().takeValueForKey(highlightedObjects, AjaxHighlight.HIGHLIGHTED_KEY);
        }
        highlightedObjects.setObjectForKey(new HighlightMetadata(isNew), highlightedValue(obj));
    }
}
Also used : NSMutableDictionary(com.webobjects.foundation.NSMutableDictionary)

Example 8 with NSMutableDictionary

use of com.webobjects.foundation.NSMutableDictionary in project wonder-slim by undur.

the class AjaxModalDialog method update.

/**
 * Call this method to have a JavaScript response returned that updates the contents of the modal dialog.
 *
 * @param context the current WOContext
 * @param title optional new title for the updated dialog
 */
public static void update(WOContext context, String title) {
    AjaxModalDialog currentDialog = currentDialog(context);
    StringBuilder js = new StringBuilder(300);
    js.append("Modalbox.show('");
    js.append(currentDialog.openDialogURL(context));
    js.append("', ");
    NSMutableDictionary options = currentDialog.createModalBoxOptions();
    if (title != null) {
        options.setObjectForKey(AjaxUtils.quote(title), "title");
    }
    AjaxOptions.appendToBuffer(options, js, context);
    js.append(");\n");
    AjaxUtils.javascriptResponse(js.toString(), context);
    // Register the id of this component on the page in the request so that when
    // it comes time to cache the context, it knows that this area is an Ajax updating area
    AjaxUtils.setPageReplacementCacheKey(context, currentDialog._containerID(context));
}
Also used : NSMutableDictionary(com.webobjects.foundation.NSMutableDictionary)

Example 9 with NSMutableDictionary

use of com.webobjects.foundation.NSMutableDictionary in project wonder-slim by undur.

the class AjaxObserveField method appendToResponse.

public static void appendToResponse(WOResponse response, WOContext context, AjaxDynamicElement element, String observeFieldID, boolean observeDescendentFields, String updateContainerID, boolean fullSubmit, NSMutableDictionary<String, String> options) {
    WOComponent component = context.component();
    String submitButtonName = nameInContext(context, component, element);
    NSMutableDictionary<String, String> observerOptions = new NSMutableDictionary<>();
    if (options != null) {
        observerOptions.addEntriesFromDictionary(options);
    }
    AjaxSubmitButton.fillInAjaxOptions(element, component, submitButtonName, observerOptions);
    String observeFieldFrequency = observerOptions.removeObjectForKey("observeFieldFrequency");
    if (observeDescendentFields) {
        response.appendContentString("ASB.observeDescendentFields");
    } else {
        response.appendContentString("ASB.observeField");
    }
    String observeDelay = observerOptions.removeObjectForKey("observeDelay");
    response.appendContentString("(");
    response.appendContentString(AjaxUtils.quote(updateContainerID));
    response.appendContentString(", ");
    response.appendContentString(AjaxUtils.quote(observeFieldID));
    response.appendContentString(", ");
    response.appendContentString(observeFieldFrequency);
    response.appendContentString(", ");
    response.appendContentString(String.valueOf(!fullSubmit));
    response.appendContentString(", ");
    response.appendContentString(observeDelay);
    response.appendContentString(", ");
    AjaxOptions.appendToResponse(observerOptions, response, context);
    response.appendContentString(");");
}
Also used : WOComponent(com.webobjects.appserver.WOComponent) NSMutableDictionary(com.webobjects.foundation.NSMutableDictionary)

Example 10 with NSMutableDictionary

use of com.webobjects.foundation.NSMutableDictionary in project wonder-slim by undur.

the class AjaxOptions method appendToResponse.

@Override
public void appendToResponse(WOResponse response, WOContext context) {
    response.appendContentCharacter('{');
    NSMutableDictionary options = _associations;
    WOAssociation optionsBinding = _associations.objectForKey("options");
    if (optionsBinding != null) {
        NSDictionary passedInOptions = (NSDictionary) optionsBinding.valueInComponent(context.component());
        if (passedInOptions != null) {
            options = passedInOptions.mutableClone();
            options.addEntriesFromDictionary(_associations);
        }
    }
    AjaxOptions._appendToResponse(options, response, context);
    if (_children != null) {
        _children.appendToResponse(response, context);
    }
    response.appendContentCharacter('}');
}
Also used : WOAssociation(com.webobjects.appserver.WOAssociation) NSDictionary(com.webobjects.foundation.NSDictionary) NSMutableDictionary(com.webobjects.foundation.NSMutableDictionary)

Aggregations

NSMutableDictionary (com.webobjects.foundation.NSMutableDictionary)59 Enumeration (java.util.Enumeration)12 WOAssociation (com.webobjects.appserver.WOAssociation)10 WOComponent (com.webobjects.appserver.WOComponent)8 NSDictionary (com.webobjects.foundation.NSDictionary)7 NSMutableArray (com.webobjects.foundation.NSMutableArray)6 WOConstantValueAssociation (com.webobjects.appserver._private.WOConstantValueAssociation)5 NSArray (com.webobjects.foundation.NSArray)5 WODeclaration (com.webobjects.appserver._private.WODeclaration)4 WOHTMLCommentString (com.webobjects.appserver._private.WOHTMLCommentString)4 NoSuchElementException (java.util.NoSuchElementException)4 StringTokenizer (java.util.StringTokenizer)4 NSForwardException (com.webobjects.foundation.NSForwardException)2 ERXMutableURL (er.extensions.foundation.ERXMutableURL)2 MalformedURLException (java.net.MalformedURLException)2 JSONObject (org.json.JSONObject)2 WOActionResults (com.webobjects.appserver.WOActionResults)1 WOContext (com.webobjects.appserver.WOContext)1 WODynamicElementCreationException (com.webobjects.appserver._private.WODynamicElementCreationException)1 NSBundle (com.webobjects.foundation.NSBundle)1