| java.lang.Object org.directwebremoting.proxy.io.Context jsx3.lang.Object jsx3.net.Form
Form | public class Form extends jsx3.lang.Object (Code) | | Provides support for legacy HTML GET and POST forms. Allows the submission of forms with arbitrary
key-value pairs as well as file upload.
Prompting the user for a file upload field (promptForFile()) is only supported in
Microsoft Internet Explorer.
author: Joe Walker [joe at getahead dot org] author: DRAPGEN - Dwr Reverse Ajax Proxy GENerator |
Method Summary | |
public void | abort() Stops polling for a response. | public void | addFileUploadField(String strName) Adds a file upload field to this form. | public void | conceal() Hides the IFRAME containing this form after it has been shown by calling reveal(). | public void | destroy() Destroys the form and the hidden IFRAME. | public void | getAction(org.directwebremoting.proxy.Callback<String> callback) Returns the action of this form, the URL that this form is submitted to. | public void | getField(String strName, org.directwebremoting.proxy.Callback<String> callback) Returns the value of a field in this form. | public void | getFields(org.directwebremoting.proxy.Callback<Object[]> callback) Returns the names of all fields in this form. | public void | getMethod(org.directwebremoting.proxy.Callback<String> callback) Returns the method of this form. | public void | getMultipart(org.directwebremoting.proxy.Callback<Boolean> callback) Returns whether this form is multipart. | public void | getResponseText(org.directwebremoting.proxy.Callback<String> callback) Returns the content of the response as a string. | public jsx3.xml.CdfDocument | getResponseXML() Returns the content of the response as an XML document. | public T | getResponseXML(Class<T> returnType) Returns the content of the response as an XML document. | public jsx3.net.Form | newFromFragment(String strFragment) Creates a new form and initialize it from the HTML representation of a form. | public void | promptForFile(String strFieldName) Invokes the operating system file browser to choose a file for a file upload field. | public void | publish(jsx3.lang.Object objEvent, org.directwebremoting.proxy.Callback<Integer> callback) Publishes an event to all subscribed objects. | public void | removeField(String strName) Removes a field from this form. | public void | reveal(int l, int t, int w, int h) Reveals the IFRAME containing this form for debugging purposes. | public void | send(int intPollInterval, int intTimeout) Sends the form. | public void | setAction(String action) Sets the action of this form. | public void | setField(String strName, String strValue, boolean bConcat) Sets the value of a field in this form.
Parameters: strName - the name of the form field to set. Parameters: strValue - the new value of form field. Parameters: bConcat - if true, will append " " + strValue to the existing value. | public void | setMethod(String method) Sets the method of this form. | public void | setMultipart(boolean multipart) Sets whether this form is multipart. | public void | subscribe(String strEventId, org.directwebremoting.proxy.CodeBlock objHandler, String objFunction) Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. | public void | subscribe(Object[] strEventId, jsx3.lang.Object objHandler, org.directwebremoting.proxy.CodeBlock objFunction) Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. | public void | subscribe(Object[] strEventId, String objHandler, String objFunction) Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. | public void | subscribe(Object[] strEventId, org.directwebremoting.proxy.CodeBlock objHandler, String objFunction) Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. | public void | subscribe(String strEventId, jsx3.lang.Object objHandler, org.directwebremoting.proxy.CodeBlock objFunction) Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. | public void | subscribe(String strEventId, String objHandler, String objFunction) Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. | public void | subscribe(String strEventId, String objHandler, org.directwebremoting.proxy.CodeBlock objFunction) Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. | public void | subscribe(Object[] strEventId, String objHandler, org.directwebremoting.proxy.CodeBlock objFunction) Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. | public void | subscribe(String strEventId, jsx3.lang.Object objHandler, String objFunction) Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. | public void | subscribe(Object[] strEventId, jsx3.lang.Object objHandler, String objFunction) Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. | public void | subscribe(String strEventId, org.directwebremoting.proxy.CodeBlock objHandler, org.directwebremoting.proxy.CodeBlock objFunction) Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. | public void | subscribe(Object[] strEventId, org.directwebremoting.proxy.CodeBlock objHandler, org.directwebremoting.proxy.CodeBlock objFunction) Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. | public void | unsubscribe(Object[] strEventId, String objHandler) Unsubscribe an object or function from an event published by this object. | public void | unsubscribe(String strEventId, org.directwebremoting.proxy.CodeBlock objHandler) Unsubscribe an object or function from an event published by this object. | public void | unsubscribe(String strEventId, jsx3.lang.Object objHandler) Unsubscribe an object or function from an event published by this object. | public void | unsubscribe(String strEventId, String objHandler) Unsubscribe an object or function from an event published by this object. | public void | unsubscribe(Object[] strEventId, org.directwebremoting.proxy.CodeBlock objHandler) Unsubscribe an object or function from an event published by this object. | public void | unsubscribe(Object[] strEventId, jsx3.lang.Object objHandler) Unsubscribe an object or function from an event published by this object. | public void | unsubscribeAll(String strEventId) Unsubscribes all subscribed objects to a type of event published by this object. |
EVENT_FILE_SELECTED | final public static String EVENT_FILE_SELECTED(Code) | | Event type published when a file has been chosen through user interaction. The event has properties field and value.
|
EVENT_ON_ERROR | final public static String EVENT_ON_ERROR(Code) | | Event type published when a security error occurs trying to access the response.
|
EVENT_ON_RESPONSE | final public static String EVENT_ON_RESPONSE(Code) | | Event type published when the response has loaded.
|
EVENT_ON_TIMEOUT | final public static String EVENT_ON_TIMEOUT(Code) | | Event type published when the response is still not ready after the specified timeout period.
|
Form | public Form(Context context, String extension, ScriptProxy scriptProxy)(Code) | | All reverse ajax proxies need context to work from
Parameters: scriptProxy - The place we are writing scripts to Parameters: context - The script that got us to where we are now |
Form | public Form(String strMethod, String strAction, boolean bMultipart)(Code) | | instance initializer
Parameters: strMethod - form method, METHOD_GET (default) or METHOD_POST Parameters: strAction - the URL to submit to Parameters: bMultipart - if true the form can support file upload |
abort | public void abort()(Code) | | Stops polling for a response.
|
addFileUploadField | public void addFileUploadField(String strName)(Code) | | Adds a file upload field to this form.
Parameters: strName - the name of the new field. |
conceal | public void conceal()(Code) | | Hides the IFRAME containing this form after it has been shown by calling reveal().
|
destroy | public void destroy()(Code) | | Destroys the form and the hidden IFRAME. This method should be called after receiving an onResponse, onError, or
onTimeout event for proper garbage collection.
|
getField | public void getField(String strName, org.directwebremoting.proxy.Callback<String> callback)(Code) | | Returns the value of a field in this form.
Parameters: strName - the name of the form field to query. Parameters: callback - the field value or null if no such field exists. |
getResponseXML | public T getResponseXML(Class<T> returnType)(Code) | | Returns the content of the response as an XML document.
Parameters: returnType - The expected return type |
newFromFragment | public jsx3.net.Form newFromFragment(String strFragment)(Code) | | Creates a new form and initialize it from the HTML representation of a form.
Parameters: strFragment - the html fragment containing a tag. |
promptForFile | public void promptForFile(String strFieldName)(Code) | | Invokes the operating system file browser to choose a file for a file upload field. This method is not
supported in browsers other than Microsoft Internet Explorer.
Parameters: strFieldName - the name of the file upload field. |
publish | public void publish(jsx3.lang.Object objEvent, org.directwebremoting.proxy.Callback<Integer> callback)(Code) | | Publishes an event to all subscribed objects.
Parameters: objEvent - the event, should have at least a field 'subject' that is the event id, another common field is 'target' (target will default to this instance) Parameters: callback - the number of listeners to which the event was broadcast |
removeField | public void removeField(String strName)(Code) | | Removes a field from this form.
Parameters: strName - the name of the form field to remove. |
reveal | public void reveal(int l, int t, int w, int h)(Code) | | Reveals the IFRAME containing this form for debugging purposes. Dimensions of the revealed form may be provided
or a default position and dimensions will be used.
Parameters: l - pixels from the left side of the HTML page that the IFRAME will be displayed. Parameters: t - pixels from the top of the HTML page that the IFRAME will be displayed. Parameters: w - width of the revealed IFRAME, in pixels. Parameters: h - height of the revealed IFRAME, in pixels. |
send | public void send(int intPollInterval, int intTimeout)(Code) | | Sends the form. Sending the form is always asynchronous. Once a form has been sent it may not be reused.
Parameters: intPollInterval - milliseconds between checking for a response. If not provided, the default value is 1/4 sec. Parameters: intTimeout - total milliseconds before timeout. If not provided, the default value is 30 sec. |
setAction | public void setAction(String action)(Code) | | Sets the action of this form.
Parameters: action - |
setField | public void setField(String strName, String strValue, boolean bConcat)(Code) | | Sets the value of a field in this form.
Parameters: strName - the name of the form field to set. Parameters: strValue - the new value of form field. Parameters: bConcat - if true, will append " " + strValue to the existing value. The space isonly inserted if the existing value is not empty. |
setMethod | public void setMethod(String method)(Code) | | Sets the method of this form.
Parameters: method - METHOD_GET or METHOD_POST . |
setMultipart | public void setMultipart(boolean multipart)(Code) | | Sets whether this form is multipart.
Parameters: multipart - |
subscribe | public void subscribe(String strEventId, org.directwebremoting.proxy.CodeBlock objHandler, String objFunction)(Code) | | Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. either a function or a string that is the name of a method of the instance |
subscribe | public void subscribe(Object[] strEventId, jsx3.lang.Object objHandler, org.directwebremoting.proxy.CodeBlock objFunction)(Code) | | Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. either a function or a string that is the name of a method of the instance |
subscribe | public void subscribe(Object[] strEventId, String objHandler, String objFunction)(Code) | | Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. either a function or a string that is the name of a method of the instance |
subscribe | public void subscribe(Object[] strEventId, org.directwebremoting.proxy.CodeBlock objHandler, String objFunction)(Code) | | Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. either a function or a string that is the name of a method of the instance |
subscribe | public void subscribe(String strEventId, jsx3.lang.Object objHandler, org.directwebremoting.proxy.CodeBlock objFunction)(Code) | | Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. either a function or a string that is the name of a method of the instance |
subscribe | public void subscribe(String strEventId, String objHandler, String objFunction)(Code) | | Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. either a function or a string that is the name of a method of the instance |
subscribe | public void subscribe(String strEventId, String objHandler, org.directwebremoting.proxy.CodeBlock objFunction)(Code) | | Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. either a function or a string that is the name of a method of the instance |
subscribe | public void subscribe(Object[] strEventId, String objHandler, org.directwebremoting.proxy.CodeBlock objFunction)(Code) | | Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. either a function or a string that is the name of a method of the instance |
subscribe | public void subscribe(String strEventId, jsx3.lang.Object objHandler, String objFunction)(Code) | | Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. either a function or a string that is the name of a method of the instance |
subscribe | public void subscribe(Object[] strEventId, jsx3.lang.Object objHandler, String objFunction)(Code) | | Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. either a function or a string that is the name of a method of the instance |
subscribe | public void subscribe(String strEventId, org.directwebremoting.proxy.CodeBlock objHandler, org.directwebremoting.proxy.CodeBlock objFunction)(Code) | | Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. either a function or a string that is the name of a method of the instance |
subscribe | public void subscribe(Object[] strEventId, org.directwebremoting.proxy.CodeBlock objHandler, org.directwebremoting.proxy.CodeBlock objFunction)(Code) | | Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. either a function or a string that is the name of a method of the instance |
unsubscribe | public void unsubscribe(Object[] strEventId, String objHandler)(Code) | | Unsubscribe an object or function from an event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - the value of objHandler passed to subscribe |
unsubscribe | public void unsubscribe(String strEventId, org.directwebremoting.proxy.CodeBlock objHandler)(Code) | | Unsubscribe an object or function from an event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - the value of objHandler passed to subscribe |
unsubscribe | public void unsubscribe(String strEventId, jsx3.lang.Object objHandler)(Code) | | Unsubscribe an object or function from an event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - the value of objHandler passed to subscribe |
unsubscribe | public void unsubscribe(String strEventId, String objHandler)(Code) | | Unsubscribe an object or function from an event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - the value of objHandler passed to subscribe |
unsubscribe | public void unsubscribe(Object[] strEventId, org.directwebremoting.proxy.CodeBlock objHandler)(Code) | | Unsubscribe an object or function from an event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - the value of objHandler passed to subscribe |
unsubscribe | public void unsubscribe(Object[] strEventId, jsx3.lang.Object objHandler)(Code) | | Unsubscribe an object or function from an event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - the value of objHandler passed to subscribe |
unsubscribeAll | public void unsubscribeAll(String strEventId)(Code) | | Unsubscribes all subscribed objects to a type of event published by this object.
Parameters: strEventId - the event type |
Methods inherited from jsx3.lang.Object | public void ignoreReturn()(Code)(Java Doc)
|
|
|