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;
}
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));
}
}
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));
}
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(");");
}
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('}');
}
Aggregations