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