[UP] Wd_types
|
WDialog API for Objective Caml: Wd_types.dialog_type
Class type virtual Wd_types.dialog_typeclass type virtual dialog_type =This class contains the dialog instance method copy :
return a copy of the dialog
The copy is not attached to a session, even if the original object
is. method name :
return the name of the dialog
method page_name :
return the name of the current page
method page_names :
returns the names of all defined pages of this dialog
method variable : variable n : Get the variable with name n , or raise
No_such_variable . The name n cannot only refer to variables
declared in this dialog, but also to variables of subdialogs
using the dot notation: "name1.name2...nameN". Here, name1
must be a dialog variable, and name2 a variable of this
subdialog, and so on, until the final variable nameN is
reached, whose value is returned. - The dot notation is accepted
by the following methods, too.method variable_decl : method string_variable : string_variable n : Get the contents of the string variable n .
Raise No_such_variable if the variable does not exist. Runtime_error
if the variable is not a string.method enum_variable : enum_variable n : Get the contents of the enumerator variable n .
The enumerator must have been declared. The returned list contains
only the internal values.
Raise No_such_variable if the variable does not exist. Runtime_error
if the variable is not a declared enumerator.method dyn_enum_variable : dyn_enum_variable n : Get the contents of the enumerator variable n .
The enumerator may be dynamic or may be declared. The returned
list contains both the internal and the external values.
Raise No_such_variable if the variable does not exist. Runtime_error
if the variable is not an enumerator.method dialog_variable : dialog_variable n : Get the contents of the dialog variable n .
Raise No_such_variable if the variable does not exist.
Runtime_error if the variable is not a dialog.method alist_variable : alist_variable n : Get the contents of the associative variable n .
Raise No_such_variable if the variable does not exist.
Runtime_error if the variable is not an alist.method lookup_string_variable : method lookup_enum_variable : method lookup_dyn_enum_variable : method lookup_dialog_variable : lookup_ *_variable n x : Get the contents of the associative
variable n at index x .
No_such_variable if the variable does not exist.
Not_found if the variable is undefined at x .
Runtime_error if the variable has the wrong type.method set_variable : set_variable n v : Sets the variable n to the value v . The value v
must be compatible to the declared type of the variable.
No_such_variable if the variable does not exist.
Runtime_error if the variable is not compatible.method unset_variable : unset_variable n : Sets the variable n to the declared default
value.
If the default is not declared, the following default values apply:
For strings: the default is the empty string.
For enumerators: the default is the empty list.
For dialogs: the default is that the value does not exist.method lookup_uploaded_file : lookup_uploaded_file name :
Checks whether the file upload box name was used. If so,
Some arg , where arg is the transporting CGI argument is returned.
If the box was not used, but the box exists, None is returned.
Raises a Runtime_error if the named box does not exist.
Important note: Uploaded files are not persistent. This means that
they are only existent in the method dump : dump f output a textual description of the current state into
formatter f . (A debugging aid.)method next_page :
Returns the name of the designated next page.
method set_next_page :
Sets the name of the designated next page
method event :
returns the event that just has happened
method is_server_popup_request :
Returns whether someone invoked
set_server_popup_request before.
This is usually done if an dialog is restored for a server-driven
popup window (tag ui:server-popup ).method serialize :
Writes the state of this dialog into the buffer. The hashtable is used
in the recursive descent into the object hierarchy to remember which
dialogs have already been serialized. Call the method initially with
an empty hash table.
method unserialize :
Sets the state of this dialog from the deserialization buffer which must contain
previously serialized dialog.
method enter_session_scope :
Tells the dialog the current session
method leave_session_scope :
Tells the dialog that it is no longer under control of this session
method session :
Returns the current session. Fails when there is no session
method environment :
Return the environment of the current CGI activation
method declaration :
Return the declaration of this dialog
method application :
Return the application
method universe :
Return the universe
The following methods must be defined in subclasses:method virtual prepare_page :
This method is invoked just before a new output page is generated.
Preconditions:
The method
This method should set any variables which are necessary to
generate the new page (mostly variable containing HTML fragments).
Furthermore, any state that needs to be saved should be put into
variables, too. method virtual handle :
This method is invoked just after the user triggered an event (e.g.
pressed a button).
Preconditions:
The method
Postconditions:
The method may set the next page to display by invoking
This method should modify the variables according to the event that happened, and optionally set the next page to display. There is also an alternate way to go to another page: raising the exception Change_page.
By raising the exception Change_dialog this method may force to go to
another dialog. |