Number: | Decimal Separator: . (dot) Thousands Separator: no separator (empty string "") For example: 123456.12 |
Date: | YYYY-MM-DD (Y: year, M: month, D: day) For example: 2019-04-21 |
Time: | HH:MM:SS (H: hour, M: minute, S: second) For example: 23:43:13 |
Date+Time: | YYYY-MM-DD HH:MM:SS For example: 2019-04-21 23:43:13 |
Attribute | Description |
---|---|
windowTitle | Label of the maintenance window. |
colonUsedAtItemLabels | Is there a colon at the end of the individual form item labels? Possible values: true or false Default value: true |
heartbeatPeriod | Session heartbeat interval in seconds. Default value: 300 |
databaseType | The database type. Possible values: mysql, postgresql Default value: mysql in myDbDiffo, postgresql in pgDbDiffo |
maxWidth | Maximum width of the window, in pixels. If not specified or empty string, the window is full width. |
maxHeight | Maximum height of the window, in pixels. If not specified or empty string, the window is full height. |
layout | Layout of the main component (dataGrid or checkList) and the form. Possible values: split, popup, oneToMany, manyToMany, form Default value: split split: The main component and the form are displayed in one, vertically split window. popup: The main component is displayed in the main window, with the form in a pop-up window. oneToMany: A layout used to display and modify records related to records displayed in a given a window with split or popup layout (one-to-many relationship). Cannot be a standalone layout. It is displayed in the iframe control. manyToMany: A layout used to display and modify records related to records displayed in a given a window with split or popup layout (many-to-many relationship). Cannot be a standalone layout. It is displayed in the iframe control. form: It does not have a main component. (A split layout without a dataGrid.) Only the form is displayed, so remove the dataGrid element from your XML code. (M13E automatically generates an XML code with a dataGrid.) It can be used for displaying a record in a popup or in a new blank window. You must provide the value of the key column of the record in the URL as a parameter. The name of the parameter is selectedrecord. E.g. https://example.com/myapp/users.php?selectedrecord=18 |
popupWindowTitle | The label of the pop-up window (see popup layout). You can use a template or a constant text. Evaluated expressions are delimited with { and } characters. When another record is selected in the dataGrid with a double click or click, the value of the popupWindowTitle is reevaluated before the pop-up window appears. To refer to a certain field of the current selected record in the template use the name of the column in the expression. The most simple form: {column_name} If a column refers to another table (e.g. master data) you can define options element for that table and you can use the name of the options element as a function in the expressions. This function has only one parameter, the identifier value (see options value attribute), and returns the option object identified by the parameter value. This option object and its properties can be used in the expression, too. For example: You want to display the id of an order item with the product name. The orderitems table refers to the products table (orderitems.prod_id -> products.prod_id). You define an options for the products with the name products, so you can use it in templates. ... <options name="products" value="prod_id" label="prod_name" sourceURL="products.php?action=SELECT" maintenanceURL="products.php" orderBy="prod_name" /> ...popupWindowTitle="#{ord_item_id} {products(prod_id).prod_name}" Result: #2 DELL XPS where ord_item_id is a column of the orderitems table for which this app is generated, products is a function/options (in this example the products table has a data maintenance app generated with M13E, too), and option objects of the options have prod_id and prod_name fields (products table has the following columns: prod_id, prod_name, net_price, etc.). |
maxPopupWidth | Maximum width of the pop-up window, in pixels. If not specified or empty string, the pop-up window is full width. |
maxPopupHeight | Maximum height of the pop-up window, in pixels. If not specified or empty string, the pop-up window is full height. |
allOptionsRefreshed | If any options records were modified by the user through the dropdown list’s modify function, a true value means that all options records are updated to reflect changes. Possible values: true or false Default value: true |
frameworkEmbedded | If true, the Haxentric framework’s JavaScript code is also embedded into the generated code. If false, the framework can be downloaded as a standalone JavaScript file, and the generated code links to it as an external file. Possible values: true or false Default value: true |
language | A two-character ISO language code. (E.g. en, hu) Together with the country attribute, determines the language and locale settings of the generated data maintenance application. |
country | A two-character ISO country code. (E.g. US, HU) Together with the language attribute, determines the language and locale settings of the generated data maintenance application. |
localeOverridable | If true, the locale settings (language and country) can be overridden with a PHP m13e_locale session variable ($_SESSION["m13e_locale"], e.g. $_SESSION["m13e_locale"] = "en_US";). If false, the application always uses the language and country values set in the language and country attributes. Possible values: true or false Default value: true |
popupCloseOnSave | If true, when the user presses the Save button, the program closes the pop-up window. If false, the pop-up window remains open. (see popup layout) Possible values: true or false Default value: true |
recordRefreshedOnOpen | If true, when the user selects a record with a double click, the program refreshes the record from the database before it opens the pop-up window. If false, the selected record is not refreshed. (see popup layout) Possible values: true or false Default value: false |
<definition windowTitle="Persons"> <table name="..."> ... </table> <tab label="Data"> ... </tab> <tab label="Data 2."> ... </tab> ... <dataGrid> ... </dataGrid> </definition>
Attribute | Description |
---|---|
name | Name of the database table. Required! |
orderBy | Defines the server side ordering of records displayed in the table. (List of columns, SELECT statement’s ORDER BY part.) E.g. name, age desc |
<table name="persons">
…
</table>
Attribute | Description |
---|---|
name | Name of the column of the database table. Required! |
key | Indicates whether the column is a primary key. Composite primary keys are not supported, thus it can only have the true value in one column (with an integer data type). Possible values: true or false Default value: false |
type | Type of the column. (Not case-sensitive.) Required! Possible values for MySQL: TINYINT, SMALLINT, MEDIUMINT, INT, INTEGER, BIGINT, DECIMAL(precision[, scale]), DEC(precision[, scale]), FIXED(precision[, scale]), NUMERIC(precision[, scale]), FLOAT, REAL, DOUBLE, DOUBLE PRECISION, DATE, TIME, DATETIME, TIMESTAMP, VARCHAR(length), CHAR(length), TEXT, CLOB, TINYTEXT, MEDIUMTEXT, LONGTEXT, JSON And if your MySQL version supports it, you can use UNSIGNED numeric types, too. (e.g. TINYINT UNSIGNED) Possible values for PostgreSQL: SMALLINT, SMALLSERIAL, INT2, SERIAL, INT, INT4, INTEGER, BIGINT, BIGSERIAL, INT8, DECIMAL(precision[, scale]), NUMERIC(precision[, scale]), REAL, FLOAT4, DOUBLE PRECISION, FLOAT8, MONEY, OID, VARCHAR(length), CHAR(length), TEXT, XML, JSON, TIMESTAMP, TIMESTAMP WITH TIME ZONE, DATE, TIME, TIME WITH TIME ZONE, INTERVAL, BOOLEAN, BIT(length), BIT VARYING(length) For example: varchar(100), integer, date, numeric(10), numeric(18,2) Default value: varchar(200) |
nullable | Indicates whether the column can be null. Possible values: true or false Default value: true |
defaultValue | Default value of the column. Currently not in use. An empty attribute value means there is no defaultValue. For string types, use single quotes. E.g. 'T' |
label | Label of the column. It is displayed before the input field in the form, in the column’s header in the dataGrid, and in the ODS file (spreadsheet file) as column header. Required! Please note: May be overriden by the control label or the dataGrid column label attribute. |
mapping | If the input field type is checkBox or the renderer in the dataGrid’s column is checkBox, you can define the value of the field in the database when checkBox is selected or not selected. Values must be listed separated by commas (without spaces). The first value is used when checkBox is selected, the second when it’s not selected. The boolean values of checkBox are mapped to the values entered by the developer. You can only enter values with the same type as type of the column related to the input field. For example: mapping="T,F"If checkBox is selected, the value of the specified field of the specified record will be a T character within the database. (In this case, the type of the column is char(1).) mapping="1,0"If checkBox is selected, the value of the specified field of the specified record will be 1 within the database. (In this case, the type of the column is smallint (or some other integer).) Please note: May be overriden by the control mapping or the dataGrid column mapping attribute. |
options | Item list of comboBox or radioButton, also used to display selected record of comboBox or a column of a table (searches for a record from options with the same value as the column’s value – the displayed value is label from options). An options name value must be entered here. |
value | An expression for the column value. Saving will set the value of the field of the current record with the value evaluated from this expression. The current record can be accessed using the selectedRecord variable. E.g. selectedRecord.net_price==null ? (this.getOption_ops_products(selectedRecord.prod_id).net_price) : selectedRecord.net_price |
parentColumnName | If the layout is oneToMany or manyToMany, you can use this attribute to specify the column that refers (column name attribute) to the column in the parent table (parentColumnName) in the one-to-many or many-to-many relationship. This must be specified in the column element that refers to the specified column (parentColumnName) of the referenced (or parent) table. |
transient | Indicates whether the column’s contents are saved to the database. It is used for calculated columns. The value of the column is defined by the expression in the value attribute. (See value attribute) If true, only the record in memory contains this column. In this case, it does not even have to be present in the database table under this name. Possible values: true or false Default value: false |
thousandsSeparatorUsed | Indicates whether thousands separator is used for formatting numbers. If true, the numbers are formatted with thousands separators. If false, the numbers are formatted without thousands separators (useful for ID). Possible values: true or false Default value: true |
<column name="per_id" key="true" type="integer" nullable="false" /> <column name="lastname" type="varchar(100)" nullable="false" /> <column name="firstname" type="varchar(100)" nullable="false" /> <column name="gender" type="char(1)" nullable="false" /> <column name="is_active" type="char(1)" /> <column name="birth_date" type="date" />
<global> <![CDATA[ include "utils.php"; function sendEmailAfterInsertUpdate($connection, $table, $keyColumnName, $oldObject, $newObject) { $sql = "SELECT * FROM users WHERE user_id in " . "(SELECT DISTINCT user_id FROM taskgrantedroles WHERE " . "task_id = ".intval($newObject["task_id"]).")"; $result = $connection->query($sql); while($user = $result->fetch_assoc()) { $headers = array(); $headers[] = "MIME-Version: 1.0"; $headers[] = "Content-Type: text/html; charset=UTF-8"; $emailto = mb_encode_mimeheader($user["user_fullname"], 'UTF-8', 'Q') . ' <'.$user["email_addr"].'>'; $headers[] = "From: " . mb_encode_mimeheader("Task Manager App", 'UTF-8', 'Q') . " <noreply@example.com>"; $headers[] = "Sender: " . mb_encode_mimeheader("Task Manager App", 'UTF-8', 'Q') . " <noreply@example.com>"; $message = '<html><head><meta charset="utf-8" /></head><body>' . $newObject["task_name"] . ' (#' . $newObject["task_id"] . ') has been created or modified.</body></html>'; mail($emailto, mb_encode_mimeheader($newObject["task_name"], 'UTF-8', 'Q'), $message, implode("\r\n", $headers)); } } ]]> </global> <functions> <executeAfterInsert> <![CDATA[ $r = true; sendEmailAfterInsertUpdate($connection, $table, $keyColumnName, null, $newObject); return $r; ]]> </executeAfterInsert> <executeAfterUpdate> <![CDATA[ $r = true; sendEmailAfterInsertUpdate($connection, $table, $keyColumnName, $oldObject, $newObject); return $r; ]]> </executeAfterUpdate> </functions>
<checkPermission> <![CDATA[ return $_SESSION["admin"]=="T"; ]]>
</checkPermission>
Parameter | Description |
---|---|
$connection | The database connection. (Legacy mysql interface: the link identifier; mysqli interface: the mysqli object; pgsql interface: the PgSql\Connection object) |
$table | The name of the database table. |
$keyColumnName | The name of the table’s key column. |
$oldObject | The object or record loaded by the server from the database. This parameter contains the record’s previous, unmodified state. When using SELECT, COUNT or INSERT ($action), this parameter is null. |
$newObject | The object or record the server will store in the database. This parameter contains the record’s new, not yet saved state. When using SELECT, SELECT_SINGLE, COUNT or DELETE ($action), this parameter is null. |
$action | The action to execute (if enabled). Possible values: SELECT_SINGLE, SELECT, INSERT, UPDATE, DELETE |
<functions> <checkPermission> <![CDATA[ return $_SESSION["admin"]=="T"; ]]> </checkPermission> </functions>
<functions> <checkPermission> <![CDATA[ $r = true; if($action=="INSERT" || $action=="UPDATE" || $action=="DELETE") { $r = $_SESSION["order-manager"]=="T"; } return $r; ]]> </checkPermission> </functions>
<functions> <checkPermission> <![CDATA[ $r = true; if($action=="INSERT" || $action=="UPDATE" || $action=="DELETE") { $roleSQL = "SELECT * FROM `system_roles` WHERE `user_id` = " . intval($_SESSION["userid"]) . " AND `role_id` = (SELECT `id` FROM `roles` " . "WHERE `role_name` = 'order-manager')"; $result = $connection->query($roleSQL); $r = $result->num_rows > 0; } return $r; ]]> </checkPermission> </functions>
<functions> <checkPermission> <![CDATA[ $r = true; if($action=="UPDATE" || $action=="DELETE") { $r = $oldObject["is_archived"] != "T" || $_SESSION["superadmin"]=="T"; } return $r; ]]> </checkPermission> </functions>
Parameter | Description |
---|---|
$connection | The database connection. (Legacy mysql interface: the link identifier; mysqli interface: the mysqli object; pgsql interface: the PgSql\Connection object) |
$table | The name of the database table. |
$oldObject | The object or record loaded by the server from the database. This parameter contains the record’s previous, unmodified state. When using SELECT, COUNT or INSERT ($action), this parameter is null. |
$newObject | An object (or record) already stored in the database by the server. This parameter contains the new, already saved state of the record, reloaded from the database by the server before the function call, so it reflects other changes as well (e.g. at saving, a trigger modified some fields of the record). When using SELECT, SELECT_SINGLE, COUNT or DELETE ($action), this parameter is null. |
$action | The action to execute (if enabled). Possible values: SELECT_SINGLE, SELECT, INSERT, UPDATE, DELETE |
$sql | The executed SQL statement. |
<functions> <log> <![CDATA[ $r = true; $t="oldObject:\r\n". json_encode($oldObject); $t.="\r\n\r\n"; $t.="newObject:\r\n". json_encode($newObject); $logSQL = "INSERT INTO `log` " . "(`table`, `action`, `user_id`, `sql`, `description`) " . " VALUES (" . "'".$table."', " . "'".$action."', " . intval($_SESSION['userid']).", " . "'".mysqli_real_escape_string($connection, $sql)."', " . "'".mysqli_real_escape_string($connection, $t)."' " . ")"; $result = $connection->query($logSQL); if($result===false) { $r = false; } return $r; ]]> </log> </functions>
Parameter | Description |
---|---|
$connection | The database connection. (Legacy mysql interface: the link identifier; mysqli interface: the mysqli object; pgsql interface: the PgSql\Connection object) |
$table | The name of the database table. |
$keyColumnName | The name of the table’s key column. |
$newObject | The object (or record) sent by the client to the server, not yet stored by the server in the database. This parameter contains the record’s new, not yet saved state, which can be changed by the developer. |
<functions> <executeBeforeInsert> <![CDATA[ $newObject["recorder_user_id"] = $_SESSION['userid']; return true; ]]> </executeBeforeInsert> </functions>
<functions> <executeBeforeInsert> <![CDATA[ $r = true; if(strcmp($newObject["order_date"], date("Y-m-d"))>0) { $r = "The order date cannot be in the future."; } return $r; ]]> </executeBeforeInsert> </functions>
<functions> <executeBeforeInsert> <![CDATA[ $r = true; $sql = "SELECT * FROM `customers` WHERE `cust_id` = " . intval($newObject["cust_id"]); $result = $connection->query($sql); if($result!==false) { if($customerROW = $result -> fetch_assoc()) { if($customerROW["is_blacklisted"]=="T") { $r = "This customer has been blacklisted. " . "You cannot record an order for this customer."; } } else { $r = "This customer has been deleted. " . "You cannot save your order."; } } else { $r = $connection->error; } return $r; ]]> </executeBeforeInsert> </functions>
Parameter | Description |
---|---|
$connection | The database connection. (Legacy mysql interface: the link identifier; mysqli interface: the mysqli object; pgsql interface: the PgSql\Connection object) |
$table | The name of the database table. |
$keyColumnName | The name of the table’s key column. |
$oldObject | The object or record loaded by the server from the database before it is changed. This parameter contains the record’s previous, unmodified state. |
$newObject | The object (or record) sent by the client to the server, not yet stored by the server in the database. This parameter contains the record’s new, not yet saved state, which can be changed by the developer. |
<functions> <executeBeforeUpdate> <![CDATA[ $newObject["last_modifier_user_id"] = $_SESSION['userid']; return true; ]]> </executeBeforeUpdate> </functions>
<functions> <executeBeforeUpdate> <![CDATA[ $r = true; if(isset($oldObject["shipping_date"])) { $r = "This order has already been shipped. " . "You cannot modify this order."; } else if($oldObject["cust_id"])!=$newObject["cust_id"]) { $r = "You cannot modify the customer field of an order."; } else if(strcmp($newObject["shipping_date"], date("Y-m-d"))<0) { $r = "The shipping date cannot be in the past."; } return $r; ]]> </executeBeforeUpdate> </functions>
<functions> <executeBeforeUpdate> <![CDATA[ $r = true; if(!isset($oldObject["delivery_date"]) && isset($newObject["delivery_date"])) { $sql = "SELECT * FROM `couriers` AS cs WHERE ". "(SELECT count(*) FROM `deliveries` AS ds " . "WHERE ds.`courier_id` = cs.`id` AND ds.`delivery_date` = '" . mysqli_real_escape_string($connection, $newObject["delivery_date"]) . "') < 20 LIMIT 1"; $result = $connection->query($sql); if($result!==false) { if($courierROW = $result -> fetch_assoc()) { $newObject["courier_id"] = $courierROW["id"]; } else { $r = "No courier is available for this delivery date: " . $newObject["delivery_date"]; } } else { $r = $connection->error; } } return $r; ]]> </executeBeforeUpdate> </functions>
Parameter | Description |
---|---|
$connection | The database connection. (Legacy mysql interface: the link identifier; mysqli interface: the mysqli object; pgsql interface: the PgSql\Connection object) |
$table | The name of the database table. |
$keyColumnName | The name of the table’s key column. |
$oldObject | The object or record loaded by the server from the database before deleting it. This parameter contains the record’s previous state. |
<functions> <executeBeforeDelete> <![CDATA[ $r = true; if(isset($oldObject["shipping_date"])) { $r = "This order has already been shipped. " . "You cannot delete this order."; } return $r; ]]> </executeBeforeDelete> </functions>
<functions> <executeBeforeDelete> <![CDATA[ $r = true; $sql = "SELECT * FROM `orderitems` WHERE `order_id` = " . intval($oldObject["id"])." LIMIT 1"; $result = $connection->query($sql); if($result!==false) { if($itemROW = $result -> fetch_assoc()) { $r = "You cannot delete this order. ". "You must delete the order items first."; } } else { $r = $connection->error; } return $r; ]]> </executeBeforeDelete> </functions>
Parameter | Description |
---|---|
$connection | The database connection. (Legacy mysql interface: the link identifier; mysqli interface: the mysqli object; pgsql interface: the PgSql\Connection object) |
$table | The name of the database table. |
$keyColumnName | The name of the table’s key column. |
$newObject | An object (or record) already stored in the database by the server. This parameter contains the new, already saved state of the record, reloaded from the database by the server before the function call, so it reflects other changes as well (e.g. at saving, a trigger modified some fields of the record). |
<functions> <executeAfterInsert> <![CDATA[ $r = true; $sql = "UPDATE `customers` " . "SET `num_of_orders` = `num_of_orders` + 1 " . "WHERE `cust_id` = " . intval($newObject["order_id"]); $result = $connection->query($sql); if($result===false) { $r = $connection->error; } return $r; ]]> </executeAfterInsert> </functions>
Parameter | Description |
---|---|
$connection | The database connection. (Legacy mysql interface: the link identifier; mysqli interface: the mysqli object; pgsql interface: the PgSql\Connection object) |
$table | The name of the database table. |
$keyColumnName | The name of the table’s key column. |
$oldObject | The object or record loaded by the server from the database before it is changed. This parameter contains the record’s previous, unmodified state. |
$newObject | An object (or record) already stored in the database by the server. This parameter contains the new, already saved state of the record, reloaded from the database by the server before the function call, so it reflects other changes as well (e.g. at saving, a trigger modified some fields of the record). |
<functions> <executeAfterUpdate> <![CDATA[ $r = true; if(!isset($oldObject["delivery_date"]) && isset($newObject["delivery_date"])) { $sql = "SELECT * FROM `couriers` WHERE `id` = " . intval($newObject["courier_id"]); $result = $connection->query($sql); if($result!==false) { $sql = "INSERT INTO `deliveries` " . "(`courier_id`, `order_id`, `delivery_date`) VALUES (". intval($newObject["courier_id"]).", ". intval($newObject["order_id"]).", ". "'" . mysqli_real_escape_string($connection, $newObject["delivery_date"])."')". $result = $connection->query($sql); if($result!==false) { sendEmailToCourier($courierROW["email_address"], "You have a new delivery (order ID: " . $newObject["order_id"].")", "Dear Courier, ..."); } else { $r = $connection->error; } } else { $r = $connection->error; } } return $r; ]]> </executeAfterUpdate> </functions>
Parameter | Description |
---|---|
$connection | The database connection. (Legacy mysql interface: the link identifier; mysqli interface: the mysqli object; pgsql interface: the PgSql\Connection object) |
$table | The name of the database table. |
$keyColumnName | The name of the table’s key column. |
$oldObject | The object or record loaded by the server from the database before deleting it. This parameter contains the record’s previous state. |
<functions> <executeAfterDelete> <![CDATA[ $r = true; $sql = "UPDATE `customers` " . "SET `num_of_orders` = `num_of_orders` - 1 " . "WHERE `cust_id` = ".intval($newObject["order_id"]); $result = $connection->query($sql); if($result===false) { $r = $connection->error; } return $r; ]]> </executeAfterDelete> </functions>
Parameter | Description |
---|---|
$connection | The database connection. (Legacy mysql interface: the link identifier; mysqli interface: the mysqli object; pgsql interface: the PgSql\Connection object) |
$table | The name of the database table. |
<functions> <getSelectWhereClause> <![CDATA[ return "`recorder_user_id` = ".intval($_SESSION['userid']); ]]> </getSelectWhereClause> </functions>
<functions> <getSelectWhereClause> <![CDATA[ $roleSQL = "SELECT * FROM `system_roles` " . "WHERE `user_id` = " . intval($_SESSION["userid"]) . " AND `role_id` = (SELECT `id` FROM `roles` " . "WHERE `role_name` = 'order-manager')"; $result = $connection->query($roleSQL); $r = null; if($result->num_rows == 0) { $r = "1 = 2"; } return $r; ]]> </getSelectWhereClause> </functions>
Parameter | Description |
---|---|
$connection | The database connection. (Legacy mysql interface: the link identifier; mysqli interface: the mysqli object; pgsql interface: the PgSql\Connection object) |
$table | The name of the database table. |
<functions> <getDisabledActions> <![CDATA[ return array("INSERT", "UPDATE", "DELETE"); ]]> </getDisabledActions> </functions>
<functions> <getDisabledActions> <![CDATA[ return array("DELETE"); ]]> </getDisabledActions> </functions>
<functions> <getDisabledActions> <![CDATA[ $roleSQL = "SELECT * FROM `system_roles` ". "WHERE `user_id` = " . intval($_SESSION["userid"]) . " AND `role_id` = (SELECT `id` FROM `roles` " . "WHERE `role_name` = 'order-manager')"; $result = $connection->query($roleSQL); $r = null; if($result->num_rows == 0) { $r = array("INSERT", "UPDATE", "DELETE"); } return $r; ]]> </getDisabledActions> </functions>
Parameter | Description |
---|---|
$connection | The database connection. (Legacy mysql interface: the link identifier; mysqli interface: the mysqli object; pgsql interface: the PgSql\Connection object) |
$table | The name of the database table. |
$keyColumnName | The name of the table’s key column. |
$parentObject | The parent object (record) loaded by the server (the parent of the files). |
$fileFolder | The folder which will contain the uploaded file. |
$fileControlName | The name of the file control. |
$originalFileName | The name of the uploaded file before it has been sanitized. |
$sanitizedFileName | The sanitized name of the uploaded file. |
<functions> <executeBeforeFileUpload> <![CDATA[ $r = true; if(file_exists($fileFolder . DIRECTORY_SEPARATOR . $sanitizedFileName)) { $r = "There is already a file with this name in this folder, " . "and you cannot overwrite it. Your save is aborted!"; } return $r; ]]> </executeBeforeFileUpload> </functions>
Parameter | Description |
---|---|
$connection | The database connection. (Legacy mysql interface: the link identifier; mysqli interface: the mysqli object; pgsql interface: the PgSql\Connection object) |
$table | The name of the database table. |
$keyColumnName | The name of the table’s key column. |
$parentObject | The parent object (record) loaded by the server (the parent of the files). The file has not been deleted yet. |
$fileFolder | The folder which contains the file which will be deleted. |
$fileControlName | The name of the file control. |
$deletedFileName | The name of the file which will be deleted. |
<functions> <executeBeforeFileDelete> <![CDATA[ $r = true; if(strpos($deletedFileName, ".pdf")!==false && pdf_is_signed($fileFolder . DIRECTORY_SEPARATOR . $sanitizedFileName)) { $r = "Signed PDF files cannot be deleted!"; } return $r; ]]> </executeBeforeFileDelete> </functions>
Parameter | Description |
---|---|
$connection | The database connection. (Legacy mysql interface: the link identifier; mysqli interface: the mysqli object; pgsql interface: the PgSql\Connection object) |
$table | The name of the database table. |
$keyColumnName | The name of the table’s key column. |
$parentObject | The parent object (record) loaded by the server (the parent of the files). |
$fileFolder | The folder which contains the uploaded file. |
$fileControlName | The name of the file control. |
$originalFileName | The name of the uploaded file before it has been sanitized. |
$sanitizedFileName | The sanitized name of the uploaded file. |
<functions> <executeAfterFileUpload> <![CDATA[ $r = true; $insertSQL = "INSERT INTO files " . "(folder_name, original_file_name, file_name) " . "VALUES " . "('" . $connection->real_escape_string($fileFolder) . "', '" . $connection->real_escape_string($originalFileName) . "', '" . $connection->real_escape_string($sanitizedFileName) . "')"; if($connection->query($insertSQL)===false) { $r = "Unable to insert a record in the files table! - " . $connection->error; } return $r; ]]> </executeAfterFileUpload> </functions>
Parameter | Description |
---|---|
$connection | The database connection. (Legacy mysql interface: the link identifier; mysqli interface: the mysqli object; pgsql interface: the PgSql\Connection object) |
$table | The name of the database table. |
$keyColumnName | The name of the table’s key column. |
$parentObject | The parent object (record) loaded by the server (the parent of the files). The file has already been deleted. |
$fileFolder | The folder which has contained the deleted file. |
$fileControlName | The name of the file control. |
$deletedFileName | The name of the file which has been deleted. |
<functions> <executeAfterFileDelete> <![CDATA[ $r = true; $deleteSQL = "DELETE FROM files WHERE folder_name = '" . $connection->real_escape_string($fileFolder) . "' AND file_name = '" . $connection->real_escape_string($deletedFileName) . "'"; if($connection->query($deleteSQL)===false) { $r = "Unable to delete a record in the files table! - " . $connection->error; } return $r; ]]> </executeAfterFileDelete> </functions>
<onApplicationStart> <![CDATA[ alert("This is the new version of our application. The old version has been removed."); ]]>
</onApplicationStart>
<jsFunctions> <onApplicationStart> <![CDATA[ alert("This is the new version of our application. The old version has been removed."); ]]> </onApplicationStart> </jsFunctions>
Parameter | Description |
---|---|
httpRequest | A HTTP request, which will be sent to the server. It is an instance of org.haxentric.http.AsynchronousHttpRequest. You can set/add parameters and headers with the following methods: (setParameter(param:String, value:String), addParameter(param:String, value:String), setHeader(header:String, value:String), addHeader(header:String, value:String). |
context | The application sends more than one HTTP request, so the m13e_onBeforeHttpRequest function is executed several times. In order to distingish these calls the context parameter contains a string to help the developer which HTTP request will be executed in the next step. Possible values: GET_DISABLED_ACTIONS, SELECT, SELECT_SINGLE, INSERT, UPDATE, DELETE or the name value of any options element. GET_DISABLED_ACTIONS: After the application downloaded all of the options from the server, the application requests the disabled actions from the server. For more information: getDisabledActions SELECT: After the application downloaded all of the options from the server and disabled actions, the application requests the records from the server. You can add extra parameters to the request parameters and you can use them at server side in the getSelectWhereClause PHP function. For more information: getSelectWhereClause SELECT_SINGLE: If the recordRefreshedOnOpen attribute of definition is set to true, the application requests the selected record from the server to refresh it. INSERT: This request is sent to the server when the user tries to insert a new record. You can add extra parameters to the request parameters and you can use them at server side in the executeBeforeInsert and in the executeAfterInsert PHP function. For more information: executeBeforeInsert and executeAfterInsert UPDATE: This request is sent to the server when the user tries to update the selected record. You can add extra parameters to the request parameters and you can use them at server side in the executeBeforeUpdate and in the executeAfterUpdate PHP function. For more information: executeBeforeUpdate and executeAfterUpdate DELETE: This request is sent to the server when the user tries to delete the selected record. You can add extra parameters to the request parameters and you can use them at server side in the executeBeforeDelete and in the executeAfterDelete PHP function. For more information: executeBeforeDelete and executeAfterDelete name of an options element: This request is sent to the server when the application requests the records of an options element. You can add extra parameters to the request parameters and you can use them at server side in the getSelectWhereClause PHP function of the M13E application of the options. For more information: getSelectWhereClause and options |
<jsFunctions> <onBeforeHttpRequest> <![CDATA[ if(context=="roles") { httpRequest.addParameter("type_filter", "task"); } ]]> </onBeforeHttpRequest> </jsFunctions>
<jsFunctions> <onAfterTabChange> <![CDATA[ this.c_organization_city.set_enabled(this.c_organization.get_selected()); this.c_organization_address.set_enabled(this.c_organization.get_selected()); this.c_organization_zip_code.set_enabled(this.c_organization.get_selected()); this.c_organization_country.set_enabled(this.c_organization.get_selected()); ]]> </onAfterTabChange> </jsFunctions>
Direction | Content | Description |
---|---|---|
From child to parent | {action: "OPEN"} |
When you use oneToMany or manyToMany layout for a child application, the child application sends a message to the parent application after the child application starts.
|
From child to parent | {action: "CLOSE"} |
When you use oneToMany or manyToMany layout for a child application, the child application sends a message to the parent application after the child application stops.
|
From parent to child | { parentRecord: <parent_record>, action: "SELECT", tableName: "<parent_table_name>" } |
When a record is selected by the user in the dataGrid, the parent application sends a message to the child application(s). The message contains the selected parent record and the name of the database table, in which the parent record is stored. <parent_record> is a real JS object and <parent_table_name> is a name of a database table, e.g. customers if the parent application is generated for the customers table. |
From parent to child | { parentRecord: null, action: "DESELECT", tableName: "<parent_table_name>" } |
When a record is deselected by the user (the user deselects a record or selects an other record) in the dataGrid, the parent application sends a message to the child application(s). The message does not contain the deselected parent record, it is set to null. The message contains the name of the database table, in which the parent record is stored. <parent_record> is null and <parent_table_name> is a name of a database table, e.g. customers if the parent application is generated for the customers table. |
From parent to child | { parentRecord: null, action: "NEW", tableName: "<parent_table_name>" } |
When the user presses the New button to create a new record in the parent application, the parent application sends a message to the child application(s). The message does not contain the a parent record (it is not stored yet and empty), it is set to null. The message contains the name of the database table, in which the new parent record will be stored. <parent_record> is null and <parent_table_name> is a name of a database table, e.g. customers if the parent application is generated for the customers table. |
From parent to child | { parentRecord: <parent_record>, action: "DELETE", tableName: "<parent_table_name>" } |
When the user deletes a record in the parent application, the parent application sends a message to the child application(s). The message contains the deleted parent record and the name of the database table, in which the deleted parent record was stored. <parent_record> is a real JS object and <parent_table_name> is a name of a database table, e.g. customers if the parent application is generated for the customers table. |
From child to parent | { childRecord: <child_record>, action: "DELETE", tableName: "<child_table_name>" } |
When the user deletes a record in the child application, the child application sends a message to the parent application. The message contains the deleted child record and the name of the database table, in which the deleted child record was stored. <child_record> is a real JS object and <child_table_name> is a name of a database table, e.g. orders if the child application is generated for the orders table. |
From parent to child | { parentRecord: <parent_record>, action: "INSERT", tableName: "<parent_table_name>" } |
When the user inserts a new record in the parent application (a new record has been saved), the parent application sends a message to the child application(s). The message contains the new parent record and the name of the database table, in which the new parent record was stored. <parent_record> is a real JS object and <parent_table_name> is a name of a database table, e.g. customers if the parent application is generated for the customers table. |
From child to parent | { childRecord: <child_record>, action: "INSERT", tableName: "<child_table_name>" } |
When the user inserts a new record in the child application, the child application sends a message to the parent application. The message contains the new child record and the name of the database table, in which the new child record was stored. <child_record> is a real JS object and <child_table_name> is a name of a database table, e.g. orders if the child application is generated for the orders table. |
From parent to child | { parentRecord: <parent_record>, action: "UPDATE", tableName: "<parent_table_name>" } |
When the user modifies a record in the parent application (the record has been modified and saved), the parent application sends a message to the child application(s). The message contains the modified parent record and the name of the database table, in which the modified parent record was stored. <parent_record> is a real JS object and <parent_table_name> is a name of a database table, e.g. customers if the parent application is generated for the customers table. |
From child to parent | { childRecord: <child_record>, action: "UPDATE", tableName: "<child_table_name>" } |
When the user modifies a record in the child application (the record has been modified and saved), the child application sends a message to the parent application. The message contains the modified child record and the name of the database table, in which the modified child record was stored. <child_record> is a real JS object and <child_table_name> is a name of a database table, e.g. orders if the child application is generated for the orders table. |
Parameter | Description |
---|---|
message | The message object posted by the child or parent application. For more information check the previous table which summarizes the messages sent by the M13E applications. |
<jsFunctions> <onMessage> <![CDATA[ if(message.action == "INSERT" || message.action == "UPDATE" || message.action == "DELETE") { calculateTotalSpentTimes(); } ]]> </onMessage> </jsFunctions>
Parameter | Description |
---|---|
optionsName | The name attribute of an options element. |
<jsFunctions> <onOptionsLoad> <![CDATA[ if(optionsName=="products") { if(!this.m_products.iterator().hasNext()) { alert("You should maintain your products before recording an order!"); } } ]]> </onOptionsLoad> </jsFunctions>
<jsFunctions> <onRecordsLoad> <![CDATA[ var len = this.get_m13e_records().get_length(); var count = 0; var nowInMillis = new Date().getTime(); var weekInMillis = 1000 * 60 * 60 * 24 * 7; for(var i=0; i<len; i++) { var user = this.get_m13e_records().getItemAt(i); var d = Date.parse(user.registration_date); if(nowInMillis - d.getTime() <= weekInMillis) { count++; } } if(count>0) { alert("You have " + String(count) + " new registered user(s) in the last 7 days."); } ]]> </onRecordsLoad> </jsFunctions>
<jsFunctions> <onRecordsRefresh> <![CDATA[ if(window.previousRecordCount == undefined) { window.previousRecordCount = this.get_m13e_records().get_length(); } else { if(this.get_m13e_records().get_length() > window.previousRecordCount) { alert("You have " + String(this.get_m13e_records().get_length() - window.previousRecordCount) + " new registered user(s)."); } } ]]> </onRecordsRefresh> </jsFunctions>
<jsFunctions> <onBeforeSave> <![CDATA[ // At this point all controls are validated with their validators. // We check the relation of two fields here. // Date values are in ISO format. var startTimeInMillis = Date.parse(this.c_start_time.get_text()).getTime(); var endTimeInMillis = Date.parse(this.c_end_time.get_text()).getTime(); var r = true; if(startTimeInMillis >= endTimeInMillis) { r = false; alert("Start time must be earlier than End time!"); } return r; ]]> </onBeforeSave> </jsFunctions>
<jsFunctions> <onAfterSave> <![CDATA[ alert("Your HTML template has been saved. Don't forget to upload your image files."); ]]> </onAfterSave> </jsFunctions>
<jsFunctions> <onBeforeDelete> <![CDATA[ // If a document is archived, it cannot be deleted. var r = true; if(this.get_m13e_selectedRecord().is_archived == "T") { r = false; alert("You cannot delete an archived document!"); } return r; ]]> </onBeforeDelete> </jsFunctions>
<jsFunctions> <onAfterDelete> <![CDATA[ if(confirm("Do you also want to delete image files that are no longer used?")) { deleteUnusedImageFiles(); } ]]> </onAfterDelete> </jsFunctions>
<jsFunctions> <onBeforeNew> <![CDATA[ // If the record is unsaved, user must confirm creating a new one. var r = true; if(this.get_m13e_selectedRecord().id == null) { if(!confirm("You have an unsaved record. Do you really want to continue?")) { r = false; } } return r; ]]> </onBeforeNew> </jsFunctions>
<jsFunctions> <onAfterNew> <![CDATA[ var now = new Date().toISOString(); // 012345678901234567890123 // YYYY-MM-DDThh:mm:ss.xxxZ now = now.substring(0, 10) + " " + now.substring(11, 19); this.c_start_time.set_text(now); this.c_end_time.set_text(now); ]]> </onAfterNew> </jsFunctions>
<jsFunctions> <onBeforeCancel> <![CDATA[ var r = true; if(!confirm("You have unsave modifications. Do you really want to continue?")) { r = false; } return r; ]]> </onBeforeCancel> </jsFunctions>
<jsFunctions> <onAfterCancel> <![CDATA[ if(this.get_m13e_selectedRecord().id != null) { alert("Your record has been restored.") } ]]> </onAfterCancel> </jsFunctions>
Parameter | Description |
---|---|
exportedData | This is an Array of indexed Arrays (the records are NOT ASSOCIATIVE arrays). It contains all records (including transient fields), which will be exported. |
exportedDataTypes | This is an indexed Array. It contains the data types of the fields. |
exportedFieldLabels | This is an indexed Array. It contains the labels of the fields. |
<jsFunctions> <onBeforeExport> <![CDATA[ var len = exportedData.length; for(var i = 0; i < len; i++) { var row = exportedData[i]; row[11] = null; } return true; ]]> </onBeforeExport> </jsFunctions>
<jsFunctions> <onAfterExport> <![CDATA[ alert("The data has been exported and downloaded to your computer. You can find the exported data in your file system, e.g. in the Downloads folder."); ]]> </onAfterExport> </jsFunctions>
this.get_m13e_selectedRecord()
<jsFunctions> <onSelectedRecordChange> <![CDATA[ if(this.get_m13e_selectedRecord()!=null) { var organization = this.get_m13e_selectedRecord().is_organization == "T"; this.c_org_city.set_enabled(organization); this.c_org_address.set_enabled(organization); this.c_org_zip.set_enabled(organization); } ]]> </onSelectedRecordChange> </jsFunctions>
<jsFunctions> <onBeforeConstruction> <![CDATA[ window.previousRecordCount = 0; window.logToConsole = function(msg) { console.log(msg); } ]]> </onBeforeConstruction> </jsFunctions>
<jsFunctions> <onAfterConstruction> <![CDATA[ this.c_task_id.setStyle("background-color", 0x0011ff); ]]> </onAfterConstruction> </jsFunctions>
<jsFunctions> <onBeforeDetailWindowClose> <![CDATA[ var r = true; if(this.c_task_id.get_text() == null || this.c_task_id.get_text()=='') { alert("You have a new and unsaved record."); r = false; } return r; ]]> </onBeforeDetailWindowClose> </jsFunctions>
Parameter | Description |
---|---|
controlName | The value of the name attribute of a control element. (The value of the type attribute of this control must be files.) |
fileName | The name of the file. (E.g. manual.docx) |
file | The file object. For more information: https://developer.mozilla.org/en-US/docs/Web/API/File |
fileApp | The JavaScript file application. For more information: m13e_files.php |
<jsFunctions> <onBeforeFileUpload> <![CDATA[ var r = true; if(!fileName.endsWith(".pdf")) { r = false; alert("Only PDF files can be uploaded!"); } return r; ]]> </onBeforeFileUpload> </jsFunctions>
Parameter | Description |
---|---|
controlName | The value of the name attribute of a control element. (The value of the type attribute of this control must be files.) |
fileName | The sanitized name of the file. (E.g. manual.docx) |
fileApp | The JavaScript file application. For more information: m13e_files.php |
<jsFunctions> <onAfterFileUpload> <![CDATA[ alert("Your file has been uploaded and saved as " + fileName + "."); ]]> </onAfterFileUpload> </jsFunctions>
Parameter | Description |
---|---|
controlName | The value of the name attribute of a control element. (The value of the type attribute of this control must be files.) |
fileName | The name of the file. (E.g. manual.docx) |
fileApp | The JavaScript file application. For more information: m13e_files.php |
<jsFunctions> <onBeforeFileDelete> <![CDATA[ var r = true; if(fileName.endsWith(".pdf")) { r = false; alert("You cannot delete a PDF file!"); } return r; ]]> </onBeforeFileDelete> </jsFunctions>
Parameter | Description |
---|---|
controlName | The value of the name attribute of a control element. (The value of the type attribute of this control must be files.) |
fileName | The name of the file. (E.g. manual.docx) |
fileApp | The JavaScript file application. For more information: m13e_files.php |
<jsFunctions> <onAfterFileDelete> <![CDATA[ alert("The file has been deleted. " + "It has been moved to the recycle bin. " + "You have 30 days to restore it. " + "After that, it is permanently deleted."); ]]> </onAfterFileDelete> </jsFunctions>
Attribute | Description |
---|---|
name | Name of the value list (options), used by the program to identify value lists (options). Required! |
value | If values (JavaScript object with properties) are downloaded from a specified address, contains the name of the property, which contains the identifier values. Default value: id |
label | If values (JavaScript object with properties) are downloaded from a specified address, contains the name of the property, which contains the name or the label (plain text representation of the value). You can use a template. Default value: name |
sourceURL | If values are downloaded from a specified address, this attribute specifies the URL of the values. Data maintenance app generated with M13E can be used as a source of options, but you must provide an action parameter with SELECT value in the URL. (E.g. cities.php?action=SELECT) |
maintenanceURL | If values are downloaded from a specified address, this attribute specifies location (URL) of the php file required to maintain the possible values. It is relevant to the comboBox input field. When the user clicks the modify (edit) button in the dropdown list of the comboBox, a maintenance window pops up, similar to the current one, but with a different content. Only data maintenance app generated with M13E can be used as a maintenance app for options (E.g. cities.php) |
orderBy | What the value list is ordered by. (List of columns, SELECT statement’s ORDER BY part.) |
valueType | Type of the value in the value field. Only use when possible values are listed with XML elements (option element). Default value: string Possible values: string, number, date, time, dateTime, boolean |
filter | A filtering condition. Usable variables: option: Contains the currently checked (whether it matches or not) element. selectedRecord: Contains the record selected in the dataGrid. |
refreshedAfterModification | If options records are modified by the user through the dropdown list’s modify (edit) option, a true value means that options records are updated. Possible values: true or false Default value: false |
... <options name="countries" value="c_id" label="c_name" sourceURL="countries.php?action=SELECT" maintenanceURL="countries.php" orderBy="c_name" refreshedAfterModification="true"/> <options name="cities" value="ci_id" label="{ci_name}, {countries(c_id).c_name}" sourceURL="cities.php?action=SELECT" maintenanceURL="cities.php" filter="option.c_id == selectedRecord.c_id"/> ... <table name="customers"> ... <column name="c_id" type="integer" key="false" nullable="true" label="Country" options="countries"/> <column name="ci_id" type="integer" key="false" nullable="true" label="City" options="cities"/> ... </table> ... <control name="c_id" type="comboBox" width="300" /> <control name="ci_id" type="comboBox" width="300" /> ...
Attribute | Description |
---|---|
value | The ID or value. Required! |
label | The name or label of the ID or value, appearing in a drop-down list (comboBox) or a radio label. Required! |
<options name="genders"> <option value="F" label="Female" /> <option value="M" label="Male" /> </options>
Attribute | Description |
---|---|
label | The label of tab. This is what appears on the tab at the top of the panel. Required! |
maxLabelWidth | The maximum width of the form item labels on tab, in pixels. Default value: 150 |
columnCount | Determines how many columns the input fields are displayed in (a value greater than 1 results in a multiple-column layout). Default value: 1 |
labelPlacement | Determines whether the labels are displayed on the left side of the input fields or above them. Possible values: left, top Default value: left |
buttonsEnabled | If this tab is selected by the user, this tab will, depending on the true or false value of buttonsEnabled, enable (true) or disable (false) pushbuttons. An example: The tab has an iframe control. If the iframe contains a child application with oneToMany or manyToMany layout, you should set the buttonsEnabled attribute of the tab to false. When the user selects this tab, the push buttons of the application (the parent application to whom this tab belongs to) will be disabled when the child application appears in the iframe. This way you can avoid confusing the user whether a push button belongs to the parent application or the child application in the iframe. Setting the fullTab attribute of the iframe control to true is also recommended. (See fullTab of control.) Possible values: true, false Default value: true |
iframesRefreshed | If this tab is selected by the user, the contents of the iframes on the tab will be updated (refreshed), depending on the true or false value of iframesRefreshed. Possible values: true, false Default value: false |
<tab label="Data"> <control name="..." /> ... </tab>
Attribute | Description |
---|---|
width | Width of the header, in pixels. (Default value: 300) |
height | Height of the header, in pixels. (Default value: 50) |
<tab label="Data"> <header width="500" height="30"><![CDATA[<font style="font-weight: bold;">Delivery Address</font>]]></header> ... <control name="..." /> ... </tab>
Attribute | Description |
---|---|
width | Width of the footer, in pixels. (Default value: 300) |
height | Height of the footer, in pixels. (Default value: 50) |
<tab label="Data"> ... <control name="..." /> ... <footer width="500" height="30"><![CDATA[<font style="font-weight: bold; color: red;">WARNING! The delivery address is not the same as the Billing address!</font>]]></footer> ... </tab>
Attribute | Description |
---|---|
name | Contains the name of the column from the database whose value you want to display. The column must be a column element of the table element. Required (except: image, urlButton, iframe)! |
label | Label of the input field. It is displayed before or above the input field. Please note: Default value is the table‘s column label. |
type | Type of the input field. Possible values: label, textInput, textArea, checkBox, comboBox, radio, dateField, timeField, dateTimeField, image, urlButton, iframe, richTextEditor and files. Default value: textInput |
richTextEditor | Vendor or implementation of the rich text editor. Possible values: trumbowyg and tinymce. Default value: trumbowyg For more information: Trumbowyg: https://alex-d.github.io/Trumbowyg/ (Recommended! Really free!) TinyMCE: https://www.tiny.cloud (Free for 1000 downloads/month!) |
fileFolder | The folder where the files are saved by the files control. If your folder is /opt/mysever/protected and the name of your table is users and the files control has no name (the name attribute is empty) and the value of the key column is 178 (the user ID), the files will be saved in this folder: /opt/mysever/protected/users/178 If your folder is /opt/mysever/protected and the name of your table is users and the name of the files control is pictures (the value of name attribute is pictures) and the value of the key column is 178 (the user ID), the files will be saved in this folder: /opt/mysever/protected/users/178/pictures |
editable | Indicates whether the input field can be edited. When a developer associates the key column to an input field, the input field becomes uneditable (equivalent with editable="false"). Possible values: true, false Default value: true |
password | Indicates whether the input field is a password. Only used with textInput. Possible values: true, false Default value: false |
visible | Indicates whether the input field is visible. Possible values: true, false Default value: true |
width | Width of the input field, in pixels. Default width of the input field used, if not specified. |
height | Height of the input field, in pixels. Default height of the input field used, if not specified. |
mapping | See mapping attribute of table element’s column element. Please note: Default value is the table‘s column mapping. |
options | See options attribute of table element’s column element. Please note: Default value is the table‘s column options. |
rowCount | Number of rows in the comboBox drop-down list. Default value: 5 |
url | If the input field type is image, it contains the url of the image displayed. Currently, the image displayed cannot be edited. If the input field type is urlButton, clicking the button causes the user to go to the url, or the contents of the url open in a new window. The url can be dynamic. In this case, a template is chosen by the developer. For more information about templates see popupWindowTitle attribute of definition element. When an other record is selected in the dataGrid, the value of the url is reevaluated. This happens every time you change records, and at every record events (save, cancel, etc.). For example: https://www.makelovenotcode.com/pics/person_{per_id}.jpg If the user selects the person with per_id 17, the url will be: https://www.makelovenotcode.com/pics/person_17.jpg |
target | If the input field type is urlButton, clicking the button causes the user to go to the url, or the contents of the url open in a new window, depending on the value of target – _self, _blank, etc. Works the same as HTML links. Possible values: _self, _blank, _top, other window’s name. Default value: _blank |
buttonLabel | If the input field type is urlButton, the developer can specify the displayed pushbutton’s label in this attribute. |
comment | Comment text to be displayed under the control. |
commentWidth | Width of the comment control. |
commentHeight | Height of the comment control. |
help | Help. A small "i" appears in a cirle next to the input field. If a user hovers over it, the text entered here will be displayed. (Currently not supported, development in progress.) |
labelPlacement | Determines whether the label is displayed on the left side of input field or above it. Possible values: left, top Default value: left |
columnSpan | Determines how many columns does the input field span over (when using multiple-column layout). Default value: 1 |
rowSpan | Determines how many rows does the input field span over (when using multiple-column layout). Default value: 1 |
fullTab | If true, the control occupies the whole tab, without a label. If false, it will be displayed according to the width and height values, with a label. An example: when a child application with oneToMany or manyToMany layout is displayed in an iframe, the fullTab attribute of the iframe should be set to true. This way the child application will occupy the whole tab. Possible values: true, false Default value: false |
<tab ... > <control name="lastname" label="Last name" type="textInput" width="200"> <validator ... /> </control> <control name="firstname" label="First name" type="textInput" /> <control name="activeMember" type="checkBox" label="Active member" mapping="T,F" /> <control name="gender" type="radio" label="Gender" options="genders" /> <control name="comment" type="textArea" label="Comment" width="200" height="100"/> </tab ... > <tab ... > <control name="" type="files" fileFolder="/opt/mysever/protected" fullTab="true" /> </tab ... > <tab ... > <control name="pictures" type="files" fileFolder="/opt/mysever/protected" fullTab="true" /> </tab ... >
Attribute | Description |
---|---|
type | Type of verification. Required! Possible values: email: Checks whether the entered text is an e-mail address. string: Checks whether the length of the text entered is within the limits (minLength, maxLength). number: Checks whether the text entered is a number, whether its value falls within the developer-defined range (minValue, maxValue), and whether the user added the required number of decimals after the decimal separator (precision). date: Checks whether the text entered is a date, and whether its value falls within the developer-defined range (minValue, maxValue). time: Checks whether the text entered is a time, and whether its value falls within the developer-defined range (minValue, maxValue). dateTime: Checks whether the text entered is a date+time value, whether its value falls within the developer-defined range (minValue, maxValue). minimal: This type of validator is only useful for comboBoxes. If the column associated with a comboBox control cannot be null, you can check with this validator whether the user selected a value or not. Set the required attribute of the validator element to true. custom: A custom validator based on one of the previous mentioned validator types (baseType). You can write your own validation code for a control. Put your code in the text node of the validator element. The code is the body of a validator method. The method has a value parameter. If the value is invalid, your code must return a string, an error message. If the value is valid, your code must return null. (See Example #1.) |
baseType | Base type of verification. It is empty if you use a non-custom validator (type attribute with a value other than custom) otherwise use one of the following values: Possible values: email, string, number, date, time, dateTime or minimal |
minLength | The minimal length of the text for verifying a string, in characters. |
maxLength | The maximum length of the text for verifying a string, in characters. |
minValue | Contains the lowest acceptable number for verifying a number. Contains the lowest acceptable date for verifying a date (format: YYYY-MM-DD). Contains the lowest acceptable time for verifying a time (format: JJ-NN-SS, where JJ stands for hour, NN stands for minute, SS stands for second). Contains the lowest acceptable date+time for verifying a dateTime (format: YYYY-MM-DD JJ-NN-SS). |
maxValue | Contains the highest acceptable number for verifying a number. Contains the highest acceptable date for verifying a date (format: YYYY-MM-DD). Contains the highest acceptable time for verifying a time (format: JJ-NN-SS). Contains the highest acceptable date+time for verifying a dateTime (format: YYYY-MM-DD JJ-NN-SS). |
precision | Contains the highest acceptable number of decimals for verifying a number. (If only integers are accepted, its value is 0.) |
required | Indicated whether entering (or selecting) the value is required. Possible values: true or false Default value: false |
<control ...> <validator type="string" minLength="2" maxLength="200" /> </control> <control ...> <validator type="email" /> </control> <control ...> <validator type="number" precision="0" minValue="0" maxValue="100" /> </control> <control ...> <validator type="number" minValue="0" maxValue="100.00" precision="2" /> </control> <control ...> <validator type="custom" baseType="string" minValue="0" maxValue="100.00" precision="2"> <![CDATA[ var r = null; // In this example, the first character must be a letter. // Its baseType is string. Its type is custom. // The upper case version of a non-letter character is // the same as the lower case version. if(value!=null && value.length>0 && value.charAt(0).toLowerCase()==value.charAt(0).toUpperCase()) { r = "The first character must be a letter."; } return r; ]]> </validator> </control>
Attribute | Description |
---|---|
headerHeight | Height of the header row, in pixels. |
rowHeight | Height of the rows, in pixels. |
filterRowHeight | Height of the filter row, in pixels. |
filterRowVisible | Indicates whether the filter row is visible. Possible values: true or false Default value: true |
<dataGrid> <column ... /> ... <column ... /> </dataGrid>
Attribute | Description |
---|---|
name | Contains the name of the column from the database whose value you want to display. The column must be provided as a column element of the table element. Required! |
label | Label of the column. Please note: Default value is the table‘s column label. |
width | Width of the column, in pixels. |
minWidth | Minimum width of the column, in pixels. If width is empty string or not provided, minWidth will be applied automatically, since it has a default value. The importance of minWidth: if the columns of the dataGrid do not fill the available area, the free space is evenly distributed among the columns with minWidth. Default value: 100 |
renderer | The control required to display values. Possible values: label, checkBox, checkMark Default value: label |
mapping | See mapping attribute of table element’s column element. Please note: Default value is the table‘s column mapping. |
options | Allows developers to use a previously defined value list. The value of an options element’s name value must be entered here. If the column contains keys and codes only and the options attribute is not provided or is an empty string, no meaningful (for the user) data can be displayed (only ids or codes). For example: The city_id column only contains city IDs. We want to display the name of the cities, so we provide the name of an options element here, or its value is inherited from table element's column element. See options attribute of table element’s column element. Please note: Default value is the table‘s column options. |
sortIndex | If the developer wants to sort the records of the dataGrid upfront, the sortIndex attribute can direct the application to sort the records by certain columns. If sortIndex >= 1, the column takes part in the sorting. sortIndex also determines in which order should the values of the columns be compared when sorting the records. |
descendingSort | If the developer wants to sort the records of the dataGrid upfront, and the column takes part in the sorting (sortIndex >=1), the descendingSort attribute can specify whether the records are sorted in a descending (true) or ascending (false) order by the column. Possible values: true, false Default value: false |
<dataGrid> <column name="lastname" label="Last name" width="150" /> <column name="firstname" label="First name" width="150" /> <column name="city_id" label="City" options="cities" width="150" /> <column name="gender" label="Gender" options="genders" width="50" /> <column name="activeMember" label="Active member" renderer="checkBox" mapping="T,F" width="100" /> </dataGrid>
Attribute | Description |
---|---|
header | The header text of the control. |
options | A name of an options element. The records of the options will be the records of the checklist. |
headerHeight | Height of the header row, in pixels. |
rowHeight | Height of the rows, in pixels. |
filterRowHeight | Height of the filter row, in pixels. |
filterRowVisible | Indicates whether the filter row is visible. Possible values: true or false Default value: true |
<checkList header="usergroups" options="usergroups" headerHeight="26" rowHeight="26" filterRowHeight="26" filterRowVisible="true" />
Attribute | Description |
---|---|
name | The unique name of the button. Required! The created button can be accessed with its variable. (this.<buttonName>, e.g. this.publish if the button name was "publish") |
label | Label of the button. Required! |
placement | Placement of the button. Possible values: master, detail Default value: detail |
width | Width of the button in pixel. Default value: 70 |
... <button name="publish" label="Publish" placement="detail" width="70"> <![CDATA[ var xhr = new XMLHttpRequest(); xhr.open('GET', '/publish.php?_id=' + this.get_m13e_selectedRecord()._id, true); var f = function(event) { if (xhr.readyState == 4) { if(xhr.status == 200 && xhr.responseText == "OK") { alert("Your article is published!"); } else { alert("Error during publishing!"); } } } xhr.addEventListener("readystatechange", f); xhr.send(null); ]]> </button> ...
https://localhost/orders.php?selectedrecord=339 https://localhost/orders.php?selectedrecord=339&selectedtab=1 https://localhost/orders.php?selectedrecord=339&selectedtab=Order%20items