use of com.webobjects.appserver.WOComponent in project wonder-slim by undur.
the class ERXWOTextField method _appendValueAttributeToResponse.
@Override
protected void _appendValueAttributeToResponse(WOResponse woresponse, WOContext wocontext) {
WOComponent component = wocontext.component();
Object valueInComponent = _value.valueInComponent(component);
if (valueInComponent != null) {
String stringValue = null;
Format format = null;
boolean hasFormatter = false;
if (_formatter != null) {
format = (Format) _formatter.valueInComponent(component);
}
if (format == null) {
if (_dateFormat != null) {
String formatString = (String) _dateFormat.valueInComponent(component);
if (formatString != null) {
format = ERXTimestampFormatter.dateFormatterForPattern(formatString);
}
} else if (_numberFormat != null) {
String formatString = (String) _numberFormat.valueInComponent(component);
if (formatString != null) {
format = ERXNumberFormatter.numberFormatterForPattern(formatString);
}
}
} else {
hasFormatter = true;
}
if (format != null) {
try {
String formatedValue = format.format(valueInComponent);
Object reparsedObject = format.parseObject(formatedValue);
stringValue = format.format(reparsedObject);
} catch (IllegalArgumentException illegalargumentexception) {
NSLog._conditionallyLogPrivateException(illegalargumentexception);
stringValue = null;
} catch (ParseException parseexception) {
NSLog._conditionallyLogPrivateException(parseexception);
}
}
if (stringValue == null) {
stringValue = valueInComponent.toString();
}
woresponse._appendTagAttributeAndValue("value", stringValue, true);
}
if (isReadonlyInContext(wocontext)) {
woresponse._appendTagAttributeAndValue("readonly", "readonly", false);
}
}
use of com.webobjects.appserver.WOComponent in project wonder-slim by undur.
the class FocusTextField 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));
boolean selectAll = (_selectAll != null && _selectAll.booleanValueInComponent(component));
String id = id(component, context);
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 FocusTextField method _appendAttributesFromAssociationsToResponse.
@Override
protected void _appendAttributesFromAssociationsToResponse(WOResponse response, WOContext wocontext, NSDictionary nsdictionary) {
super._appendAttributesFromAssociationsToResponse(response, 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) {
response.appendContentString(" id = \"" + id + "\"");
}
FocusTextField._appendAttributesFromAssociationsToResponse(response, wocontext, id, onKeyPress, onEnterScript);
}
use of com.webobjects.appserver.WOComponent in project wonder-slim by undur.
the class AjaxSessionPing method appendToResponse.
/**
* Appends script to start Ajax.ActivePeriodicalUpdater to the response.
*/
@Override
public void appendToResponse(WOResponse response, WOContext context) {
super.appendToResponse(response, context);
WOComponent component = context.component();
response.appendContentString("<script>var AjaxSessionPinger = new Ajax.ActivePeriodicalUpdater('AjaxSessionPinger', '");
if (booleanValueForBinding("keepSessionAlive", false, component)) {
response.appendContentString(context.directActionURLForActionNamed("AjaxSessionPing$Action/pingSessionAndKeepAlive", null, context.secureMode(), false));
} else {
response.appendContentString(context.directActionURLForActionNamed("AjaxSessionPing$Action/pingSession", null, context.secureMode(), false));
}
response.appendContentString("', ");
AjaxOptions.appendToResponse(createAjaxOptions(component), response, context);
response.appendContentString(");</script>");
}
use of com.webobjects.appserver.WOComponent in project wonder-slim by undur.
the class AjaxSubmitButton method invokeAction.
@Override
public WOActionResults invokeAction(WORequest worequest, WOContext wocontext) {
WOActionResults result = null;
WOComponent wocomponent = wocontext.component();
String nameInContext = nameInContext(wocontext, wocomponent);
boolean shouldHandleRequest = (!disabledInComponent(wocomponent) && wocontext.wasFormSubmitted()) && ((wocontext.isMultipleSubmitForm() && nameInContext.equals(worequest.formValueForKey(KEY_AJAX_SUBMIT_BUTTON_NAME))) || !wocontext.isMultipleSubmitForm());
if (shouldHandleRequest) {
String updateContainerID = AjaxUpdateContainer.updateContainerID(this, wocomponent);
AjaxUpdateContainer.setUpdateContainerID(worequest, updateContainerID);
wocontext.setActionInvoked(true);
result = handleRequest(worequest, wocontext);
ERXAjaxApplication.enableShouldNotStorePage();
}
return result;
}
Aggregations