Skip to content

Commit

Permalink
Add a method tu refresh the ModalDialog by replacing the content with…
Browse files Browse the repository at this point in the history
… a new component.

# Conflicts:
#	Frameworks/Ajax/Ajax/Sources/er/ajax/AjaxModalDialog.java
  • Loading branch information
spelletier authored and darkv committed Jan 7, 2016
1 parent 75da37d commit 53caa4f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Frameworks/Ajax/Ajax/Sources/er/ajax/AjaxModalDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,19 @@ public static void update(WOContext context, String title) {
AjaxUtils.setPageReplacementCacheKey(context, currentDialog._containerID(context));
}

/**
* Call this method to have a JavaScript response returned that updates the contents of the modal dialog.
*
* @param context the current WOContext
* @param newContent the new content for the updated dialog
* @param title optional new title for the updated dialog
*/
public static void update(WOContext context, WOComponent newContent, String title) {
AjaxModalDialog currentDialog = currentDialog(context);
currentDialog._actionResults = newContent;
update(context, title);
}

public void setCurrentDialogInPageIfNecessary(WOActionResults results, WORequest request, WOContext context) {
if (AjaxUtils.isAjaxRequest(request) && results instanceof WOComponent && results != context.page()) {
ERXResponseRewriter.pageUserInfo((WOComponent)results).setObjectForKey(this, AjaxModalDialog.class.getName());
Expand Down

0 comments on commit 53caa4f

Please sign in to comment.