FATHER, CHILD Methods

The web page with a father and one or more children can be configured with a collection of methods:

Method Name Description Default Contents Example
CHILD_SELECTED Is intended to be used with multiple child tables;
It indicates which child tab is activated when the page is loaded.
It is empty by default which indicates the first tab will be opened. <%method CHILD_SELECTED>
commissions</%method>
SCHEMA_CHILD_SELECTED Overloads the default method. <&SELF:SCHEMA&>
/
<&SELF:CHILD_SELECTED&>
<%method SCHEMA_CHILD_SELECTED>
demo/commissions</%method>
CHILDREN A comma separated list of children. Empty by default. See the CONFIGURING FATHER .MQL example.
CHILDREN_FIELDS A comma separated list of key fields. Empty by default. See the CONFIGURING FATHER .MQL example.
SCHEMA_CHILDREN A comma separated list of children each prefixed with SELF:SCHEMA The list SELF:CHILDREN with each child prefixed by the SELF:SCHEMA. <%method SCHEMA_CHILDREN>
demo/commissions,demo/employees</%method>
KEY Indicates a primary key of a table. <&SELF:FROM&>
.
<&SELF:KEY_NAME&>
<%method KEY>
orders.id</%method>
KEY_NAME A primary key field without a table name. By default it's derived from the database. <%method KEY_NAME>
id</%method>
SERIAL_SEQ A serial sequence name. <%method SERIAL_SEQ><&SELF:SCHEMA_FROM&>_
<&SELF:KEY_NAME&>_seq
</%method>
<%method SERIAL_SEQ>
<&SELF:SCHEMA_FROM&>_seq</%method>
SELECT_CHILDREN_ID A select statement which is used for listing children keys.
Parameters: $FIELDS, $WHERE, $ORDER
   
CHILDREN_CONTAINER Is used in the frame.html The default value is 'Stack' when there is one child or 'Tab' when there's many children (Tab & Stack are Dojo tooolkit containers)  
CHILD_TEMPLATE Is used in the frame.html; If the method exist in child .mql file it changes its type of form. Does not exist by default. <%method CHILD_TEMPLATE>
FORM</%method>
,
<%method CHILD_TEMPLATE>
TABLE</%method>
,
<%method CHILD_TEMPLATE>
DIVS</%method>
,
<%method CHILD_TEMPLATE>
LINEAR</%method>
or
<%method CHILD_TEMPLATE>
TEMPLATE</%method>
ORDER Determines how to order a table, which columns to order by.
It is important that the sorting must be unique, otherwise the cache mechanism will report errors in the sorting of keys in the cache.
Empty by default.
The recordset is ordered with ascendig primary key.
<%method ORDER>
UPPER(surname), UPPER(name)</%method>
GUI_ORDER GUI user sorting.
List of fields (separated by ",") that the user can sort from the browser. For each field, in addition to the name, the sorting type applied as default (in the list order) and possibly the SQL field code.
- ASC or blank = ascending sort
- DESC = descending sort
- SEL = orderable field in the GUI
In the forms the user can reverse or cancel the sorting of the fields declared here with a click on the field header.
Each variation moves the field to the bottom of the sorting.
A double click on the fields header resets the user-modifiable sorting and the sorting will set by ORDER.
Empty by default.
The recordset is ordered with ORDER.
<%method ORDER_GUI>name ASC UPPER(name), surname ASC UPPER(surname), year SEL, month SEL, day SEL</%method>
FATHER Provides foreign_key_name:father_table_name[:father_primary_key_name] parameters. Empty by default. See the CONFIGURING CHILD .MQL example.
FATHER_WHERE It returns where statement composed of the foreign_key_name and $FATHER_ID parameter. Extracts a foreign_key_name from the FATHER method. Returns <% $field %> = <%$father_id%> string. The $father_id is str2sql_js_delimited($FATHER_ID).  
FATHER_ID_NAME It obtains the father ID field name (foreign_key_name) to be used in insert and update. Extracts the field name from the FATHER method.  
FATHER_NAME It returns a father_table_name. Extracts a full name of the father table (schema.father_name) from the FATHER method.  
FATHER_KEY_NAME It returns an id of the father table (father_primary_key_name). Extracts a father id from the FATHER method.
It also verifies that the father .mql file exists.
 
FATHER_TABLE_KEY_NAME It returns a table.id of the father table. Extracts a father table and id from the FATHER method.
It also verifies that the father .mql file exists.
 
Topic revision: r14 - 23 May 2022, GuidoBrugnara
This site is powered by FoswikiCopyright (©) Leader.IT - Italy P.I. IT01434390223 Privacy policy & use of cookies