Skip to content
Snippets Groups Projects
Commit 84e57068 authored by enured's avatar enured
Browse files

F15098: Added documentation for function column. refs #15098

parent 3906ea81
No related branches found
No related tags found
4 merge requests!638Merge Develop to B16343,!637develop into F17086-Multiple-Forms-on-a-page,!626New version v23.10.1,!621F15098 as function in variable
Pipeline #10773 passed
......@@ -44,7 +44,7 @@ provided. Access to:
* :ref:`store-variables`
* :ref:`sql-variables`
* :ref:`row-column-variables`
* :ref:`link-column-variables`
* :ref:`link-function-column-variables`
Some examples, including nesting::
......@@ -72,6 +72,12 @@ Some examples, including nesting::
# Link Columns
{{p:form=Person&r=1|t:Edit Person|E|s AS link}}
# Function Columns
{{getFullname(pId) => fullname AS function}}
# Function Columns > direct tt_content output
{{getFullname(pId) AS function}}
Leading and trailing spaces inside curly braces are removed.
* ``{{ SELECT "Hello World" }}`` becomes ``{{SELECT "Hello World"}}``
......@@ -421,10 +427,13 @@ General note: using this type of variables is only the second choice. First choi
:ref:`access-column-values`) - using the STORE_RECORD is more portable cause no renumbering is needed if the level keys change.
.. _`link-column-variables`:
.. _`link-function-column-variables`:
Link column variables
---------------------
Link/Function column variables
------------------------------
Link column
^^^^^^^^^^^
These variables return a link, completely rendered in HTML. The syntax and all features of :ref:`column-link` are available.
The following code will render a *new person* button::
......@@ -435,7 +444,38 @@ For better reading, the format string might be wrapped in single or double quote
{{"p:form&form=Person|s|N|t:new person" AS link}}
These variables are especially helpful in:
Function column
^^^^^^^^^^^^^^^
These variables execute a qfqFunction::
// Report with qfqFunction. Subheader: getFullname
render = api
10 {
sql = SELECT CONCAT(lastName, ', ', firstName) AS _fullname
FROM Person
WHERE id = {{pId:R0}}
}
// Usage function column
{{getFullname(pId) => fullname AS function}}
{{SELECT '{{fullname:RE}}'}}
Usually it is preferred to get the output from a function without using the variable {{_output:RE}}::
// Report with qfqFunction. Subheader: getFullname
render = api
10 {
sql = SELECT CONCAT(lastName, ', ', firstName)
FROM Person
WHERE id = {{pId:R0}}
}
{{getFullname(pId) AS function}}
These two column variables are especially helpful in:
* `report`, to create create links or buttons outside of an SQL statement. E.g. in `head`, `rbeg`, ...
* `form`, to create links and buttons in labels or notes.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment