|
Project Wonder 5.0.0.8658 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.webobjects.appserver.WOElement
com.webobjects.appserver.WOComponent
er.ajax.AjaxComponent
er.ajax.AjaxModalDialog
public class AjaxModalDialog
AjaxModalDialog is a modal dialog window based on ModalBox (see below for link). It differs from AjaxModalContainer in that it handles submitting forms and updating the container contents. It also looks more like an OS X modal dialog if you consider that to be a benefit.
The links shown to open the dialog can some from three sources:
The contents for the modal dialog can some from three sources:
To cause the dialog to be closed in an Ajax action method, use this:
AjaxModalDialog.close(context());
To cause the contents of the dialog to be updated in an Ajax action method, use this:
AjaxModalDialog.update(context());
NOTE: this does not work if you use the action binding. You must manage your own updating if you use this binding.
The modal dialog is opened by calling a JavaScript function. While this is normally done from an onclick
handler, you can call it directly. The function name is openAMD_
openAMD_MyDialogId();
| Bindings | |
action | returns the contents of the dialog box |
label | the text for the link that opens the dialog box |
title | Title to be displayed in the ModalBox window header, also used as title attribute of link opening dialog |
linkTitle | Title to be used as title attribute of link opening dialog, title is used if this is not present |
width | integer Width in pixels, use -1 for auto-width |
height | integer Height in pixels, use -1 for auto-height. When set Modalbox will operate in 'fixed-height' mode. |
open | if true, the container is rendered already opened, the default is false |
showOpener | if false, no HTML is generated for the link, button etch to open this dialog, it can only be opened from
custom JavaScript (see below). The default is true |
onOpen | server side method that runs before the dialog is opened, the return value is discarded |
onClose | server side method that runs before the dialog is opened, the return value is discarded.
This will be executed if the page is reloaded, but not if the user navigates elsewhere. |
closeUpdateContainerID | the update container to refresh when onClose is called |
id | HTML id for the link activating the modal dialog |
class | CSS class for the link activating the modal dialog |
style | CSS style for the link activating the modal dialog |
overlayClose | true | false Close modal box by clicking on overlay. Default is true. |
method | get | post. Method of passing variables to a server. Default is 'get'. |
params | {} Collection of parameters to pass on AJAX request. Should be URL-encoded. See PassingFormValues for details. |
loadingString | string The message to show during loading. Default is "Please wait. Loading...". |
closeString | Defines title attribute for close window link. Default is "Close window". |
closeValue | Defines the string for close link in the header. Default is '×' |
overlayOpacity | Overlay opacity. Must be between 0-1. Default is .65. |
overlayDuration | Overlay fade in/out duration in seconds. |
slideDownDuration | Modalbox appear slide down effect in seconds. |
slideUpDuration | Modalbox hiding slide up effect in seconds. |
resizeDuration | Modalbox resize duration in seconds. |
inactiveFade | true | false, Toggles Modalbox window fade on inactive state. |
transitions | true | false, Toggles transition effects. Transitions are enabled by default. |
autoFocusing | true | false, Toggles auto-focusing for form elements. Disable it for long text pages. |
beforeLoad | client side method, fires right before loading contents into the ModalBox. If the callback function returns false, content loading will skipped. This can be used for redirecting user to another MB-page for authorization purposes for example. |
afterLoad | client side method, fires after loading content into the ModalBox (i.e. after showing or updating existing window). |
beforeHide | client side method, fires right before removing elements from the DOM. Might be useful to get form values before hiding modalbox. |
afterHide | client side method, fires after hiding ModalBox from the screen. |
afterResize | client side method, fires after calling resize method. |
onShow | client side method, fires on first appearing of ModalBox before the contents are being loaded. |
onUpdate | client side method, fires on updating the content of ModalBox (on call of Modalbox.show method from active ModalBox instance). |
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.webobjects.appserver.WOComponent |
|---|
WOComponent._EventLoggingEnabler, WOComponent.Event |
| Nested classes/interfaces inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions |
|---|
NSKeyValueCodingAdditions.DefaultImplementation, NSKeyValueCodingAdditions.Utility |
| Nested classes/interfaces inherited from interface com.webobjects.foundation.NSValidation |
|---|
NSValidation._MethodBinding, NSValidation._ValidationBinding, NSValidation.DefaultImplementation, NSValidation.Utility, NSValidation.ValidationException |
| Field Summary | |
|---|---|
static String |
Close
JavaScript to execute on the client to close the modal dialog |
| Fields inherited from class er.ajax.AjaxComponent |
|---|
log |
| Fields inherited from class com.webobjects.appserver.WOComponent |
|---|
_Extension, _IsEventLoggingEnabled, _keyAssociations, MINUSONE |
| Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding.ErrorHandling |
|---|
_CLASS |
| Fields inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions |
|---|
_CLASS, _KeyPathSeparatorChar, KeyPathSeparator |
| Fields inherited from interface com.webobjects.foundation.NSValidation |
|---|
_CLASS |
| Constructor Summary | |
|---|---|
AjaxModalDialog(WOContext context)
|
|
| Method Summary | |
|---|---|
protected String |
_containerID(WOContext context)
|
protected void |
addRequiredWebResources(WOResponse response)
Override this method to append the needed scripts for this component. |
protected void |
appendOpenModalDialogFunction(WOResponse response,
WOContext context)
Appends function body to open the modal dialog window. |
void |
appendToResponse(WOResponse response,
WOContext context)
This has two modes. |
void |
awake()
Start of R-R loop. |
static void |
close(WOContext context)
Call this method to have a JavaScript response returned that closes the modal dialog. |
void |
closeDialog()
Calls the method bound to onClose (if any), and marks the dialog state as closed. |
protected NSMutableDictionary |
createModalBoxOptions()
|
WOActionResults |
handleRequest(WORequest request,
WOContext context)
Handles the open and close dialog actions. |
String |
id()
|
WOActionResults |
invokeAction(WORequest request,
WOContext context)
Only handle this phase if the modal box is open or it is our action (opening the box). |
boolean |
isOpen()
|
static void |
open(WOContext context,
String id)
Call this method to have a JavaScript response returned that closes the modal dialog. |
void |
openDialog()
Calls the method bound to onOpen (if any), and marks the dialog state as open. |
static String |
openDialogFunctionName(String id)
Returns the JavaScript function name for the function to open the AjaxModalDialog with the specified ID. |
void |
setOpen(boolean open)
|
static void |
setTitle(WOContext context,
String title)
Call this method to have a JavaScript response returned that updates the title of the modal dialog. |
void |
sleep()
End of R-R loop. |
boolean |
synchronizesVariablesWithBindings()
|
void |
takeValuesFromRequest(WORequest request,
WOContext context)
Only handle this phase if the modal box is open. |
String |
templateName()
Returns the template name for the ERXWOComponentContent: null to show the dialog (default) contents and "link" to show the link contents |
static void |
update(WOContext context)
Call this method to have a JavaScript response returned that updates the contents of the modal dialog. |
String |
updateContainerID()
Returns the ID of the AjaxUpdateContainer that wraps the in-line contents of this dialog. |
| Methods inherited from class er.ajax.AjaxComponent |
|---|
addScriptResourceInHead, addScriptResourceInHead, addStylesheetResourceInHead, addStylesheetResourceInHead, appendTagAttributeToResponse, booleanValueForBinding, safeElementID, valueForBinding, valueForBinding, valueForBinding |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String Close
| Constructor Detail |
|---|
public AjaxModalDialog(WOContext context)
| Method Detail |
|---|
public boolean synchronizesVariablesWithBindings()
synchronizesVariablesWithBindings in class WOComponentpublic boolean isOpen()
public void setOpen(boolean open)
public static void open(WOContext context,
String id)
context - the current WOContextid - the HTML ID of the AjaxModalDialog to openpublic static String openDialogFunctionName(String id)
id - the HTML ID of the AjaxModalDialog to open
public static void close(WOContext context)
context - the current WOContextpublic static void update(WOContext context)
context - the current WOContext
public static void setTitle(WOContext context,
String title)
context - the current WOContexttitle - the new title for the dialog windowpublic void awake()
awake in class WOComponentWOComponent.awake()
public void takeValuesFromRequest(WORequest request,
WOContext context)
takeValuesFromRequest in class WOComponentWOComponent.takeValuesFromRequest(com.webobjects.appserver.WORequest, com.webobjects.appserver.WOContext)
public WOActionResults invokeAction(WORequest request,
WOContext context)
invokeAction in class AjaxComponentclose(WOContext),
update(WOContext),
WOComponent.takeValuesFromRequest(com.webobjects.appserver.WORequest, com.webobjects.appserver.WOContext)
public WOActionResults handleRequest(WORequest request,
WOContext context)
handleRequest in interface IAjaxElementhandleRequest in class AjaxComponentAjaxComponent.handleRequest(com.webobjects.appserver.WORequest, com.webobjects.appserver.WOContext)
public void appendToResponse(WOResponse response,
WOContext context)
appendToResponse in class AjaxComponentAjaxComponent.appendToResponse(com.webobjects.appserver.WOResponse, com.webobjects.appserver.WOContext)
protected void appendOpenModalDialogFunction(WOResponse response,
WOContext context)
response - WOResponse to append tocontext - WOContext of responseAjaxModalDialog#openDialogFunctionName(String)public void sleep()
sleep in class WOComponentWOComponent.sleep()public void openDialog()
public void closeDialog()
protected String _containerID(WOContext context)
_containerID in class AjaxComponentAjaxComponent._containerID(com.webobjects.appserver.WOContext)public String id()
public String updateContainerID()
public String templateName()
protected NSMutableDictionary createModalBoxOptions()
protected void addRequiredWebResources(WOResponse response)
AjaxComponent
addRequiredWebResources in class AjaxComponentAjaxComponent.addRequiredWebResources(com.webobjects.appserver.WOResponse)
|
Last updated: Fri, Nov 21, 2008 04:36 AM EST | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||