Changes made to the application framework
that the application developer should know:
===========================================
-------- afterParse() ----------------------------
* - WebObject::afterParse()
is like WebObject::onParse(), only that it is called after
the WebObject is parsed.
-------- webobject vars --------------------------
* - The framework declares for each webobject these variables:
{{obj_id}} -- the object id ({{class_name}}::{{obj_name}})
{{class_name}} -- the name of the class
{{obj_name}} -- the name of the object
{{obj_count}} -- counts the objects of the same class,
starting from 1
These vars can be used inside the template of the webclass,
if the webclass designer needs them, e.g.:
-------- transmitVars() --------------------------
* - function transmitVar(var_name, var_value)
This function sends the var_name (which has the given var_value)
to the server side as a PHP global variable. It can also be used
in the template as a tpl variable: {{var_name}}, since all PHP
global variables can be used as tpl variables. It should be used
carefully, because any tpl variable with the same name will
override its value.
It must be called before GoTo().
- function transmitVars(var_list)
Similar to transmitVar() but can transmit more than one variable.
The format of var_list is: var1=val1&var=val2&var3=val3.
Must be called before GoTo().
-------- formWebObj ----------------------------------
* - formWebObj is a webobject that makes easy the handling of big
forms (which have many inputs) and their data connection to the
databaze. It is used like this: when you have a webbox that
has a big form, in the PHP code of the webbox you include the
class 'formWebObj', and then inherit this class, instead of
inheriting 'WebObject' ('formWebObj' itself extends 'WebObject',
so this is OK). E.g.:
----------------------------------------------
include_once FORM_PATH."formWebObj.php";
class editProject extends formWebObj
{
. . . . . . . . . .
}
?>
----------------------------------------------
class formWebObj extends WebObject
{
. . . . . . . . . . .
}
?>
Then, in the JS code of the webbox you can use these JS functions
which have been declared and included by the 'formWebObj':
getEventArgs(form);
/**
* Returns all the data in the inputs of the given form
* so that they can be sent as event args, e.g.
* GoTo("thisPage?event=editProject.save(" + getEventArgs(form) + ")");
*/
saveFormData(form);
/**
* Transmit the data of the form, so that
* the changed values are not lost.
* Must be called before GoTo().
*/
This is useful when the page is refreshed for some reason,
but you don't want to lose the values that are inputed in it.
There are also these two functions that are used internally by
'formWebObj', but you can use them as well, if you need them:
function getFormData(form)
//returns all the data filled in the given form
function setFormData(form, formData)
//fills the form with the given data
------------- date WebObject -------------------------------
* - The webobject date can be used to select the date from a calendar.
It can be used like this:
First include the webclass that defines it:
(DATE_PATH is defined by the framework)
Then declare as many date objects as needed:
etc.
When an object of class date is declared, the framework replaces
it with this html code:
So, it requires a default value {{information_date}}, which can
be declared in the PHP code of the webox that uses the date object.
If you want to modify it, you can copy it to a path local to
the application, modify it and use the modified copy, e.g.
--------------------------------------------------------------
* -
The attribute rs of the tag can contain variables
(so that the same repeat can use different recordsets,
according to the logic of the program). These variables
are evaluated now in render time (before they were evaluated
in parse time) because this is more convenient.
------------- listbox WebObject -------------------------------
* - The WebClass "listbox" is used to display a list of values with the