use of com.webobjects.appserver.WOActionResults in project wonder-slim by undur.
the class AjaxModalDialog method invokeAction.
/**
* Only handle this phase if the modal box is open or it is our action (opening the box).
* Overridden to include result returned by action binding if bound.
*
* @see #close(WOContext)
* @see #update(WOContext, String)
* @see com.webobjects.appserver.WOComponent#takeValuesFromRequest(com.webobjects.appserver.WORequest, com.webobjects.appserver.WOContext)
*/
@Override
public WOActionResults invokeAction(WORequest request, WOContext context) {
ajaxComponentActionUrl = AjaxUtils.ajaxComponentActionUrl(context());
pushDialog();
try {
WOActionResults result = null;
if (shouldHandleRequest(request, context)) {
result = super.invokeAction(request, context);
} else if (isOpen()) {
if (_actionResults != null) {
pushActionResultsIntoContext(context);
try {
result = _actionResults.invokeAction(request, context);
} finally {
popActionResultsFromContext(context);
}
} else {
result = super.invokeAction(request, context);
}
}
setCurrentDialogInPageIfNecessary(result, request, context);
return result;
} finally {
popDialog();
}
}
use of com.webobjects.appserver.WOActionResults in project wonder-slim by undur.
the class AjaxDroppable method handleRequest.
@Override
public WOActionResults handleRequest(WORequest request, WOContext context) {
AjaxUpdateContainer.setUpdateContainerID(request, (String) valueForBinding("updateContainerID"));
String droppedDraggableID = request.stringFormValueForKey(_draggableIDKeyName);
if (canSetValueForBinding("droppedDraggableID")) {
setValueForBinding(droppedDraggableID, "droppedDraggableID");
}
if (canSetValueForBinding("droppedObject")) {
WOComponent page = context.page();
Object droppedObject = AjaxDraggable.draggableObjectForPage(page, droppedDraggableID);
setValueForBinding(droppedObject, "droppedObject");
}
if (canGetValueForBinding("action")) {
WOActionResults results = (WOActionResults) valueForBinding("action");
if (results != null) {
System.out.println("AjaxDroppable.handleRequest: Not quite sure what to do with non-null results yet ...");
}
}
return null;
}
use of com.webobjects.appserver.WOActionResults in project wonder-slim by undur.
the class AjaxDynamicElement method invokeAction.
/**
* Execute the request, if it's coming from our action, then invoke the ajax handler and put the key
* <code>AJAX_REQUEST_KEY</code> in the request userInfo dictionary (<code>request.userInfo()</code>).
*
* @param request the current request
* @param context context of the transaction
* @return the action results
*/
@Override
public WOActionResults invokeAction(WORequest request, WOContext context) {
WOActionResults result = null;
if (shouldHandleRequest(request, context)) {
result = handleRequest(request, context);
ERXAjaxApplication.enableShouldNotStorePage();
if (ERXAjaxApplication.shouldIgnoreResults(request, context, result)) {
log.warn("An Ajax request attempted to return the page, which is almost certainly an error.");
result = null;
}
if (result == null && !ERXAjaxApplication.isAjaxReplacement(request)) {
result = AjaxUtils.createResponse(request, context);
}
} else if (hasChildrenElements()) {
result = super.invokeAction(request, context);
}
return result;
}
use of com.webobjects.appserver.WOActionResults in project wonder-slim by undur.
the class AjaxUpdateContainer method invokeAction.
@Override
public WOActionResults invokeAction(WORequest request, WOContext context) {
WOActionResults results;
if (shouldRenderContainer(context.component())) {
String previousUpdateContainerID = AjaxUpdateContainer.currentUpdateContainerID();
try {
AjaxUpdateContainer.setCurrentUpdateContainerID(_containerID(context));
results = super.invokeAction(request, context);
} finally {
AjaxUpdateContainer.setCurrentUpdateContainerID(previousUpdateContainerID);
}
} else {
results = super.invokeAction(request, context);
}
return results;
}
use of com.webobjects.appserver.WOActionResults in project wonder-slim by undur.
the class AjaxUpdateContainer method handleRequest.
@Override
public WOActionResults handleRequest(WORequest request, WOContext context) {
WOComponent component = context.component();
String id = _containerID(context);
if (associations().objectForKey("action") != null) {
@SuppressWarnings("unused") WOActionResults results = (WOActionResults) valueForBinding("action", component);
// ignore results
}
WOResponse response = AjaxUtils.createResponse(request, context);
AjaxUtils.setPageReplacementCacheKey(context, id);
if (hasChildrenElements()) {
appendChildrenToResponse(response, context);
}
String onRefreshComplete = (String) valueForBinding("onRefreshComplete", component);
if (onRefreshComplete != null) {
AjaxUtils.appendScriptHeader(response);
response.appendContentString(onRefreshComplete);
AjaxUtils.appendScriptFooter(response);
}
if (AjaxModalDialog.isInDialog(context)) {
AjaxUtils.appendScriptHeader(response);
response.appendContentString("AMD.contentUpdated();");
AjaxUtils.appendScriptFooter(response);
}
return null;
}
Aggregations