Commit 3dc3ca92 authored by Carsten  Rose's avatar Carsten Rose

Fixes #9929: New keyword '_noWrap' for column names (alias) - skips wrapping of fbeg/fskip/fend.

parent cb651bd8
Pipeline #3219 passed with stages
in 3 minutes and 57 seconds
......@@ -785,7 +785,9 @@ QFQ Keywords (Bodytext)
+-------------------+---------------------------------------------------------------------------------+
| <level>.fsep | Separator token between fields (=columns) |
+-------------------+---------------------------------------------------------------------------------+
| <level>.fskipwrap | Comma separated list of column id's. Skip wrapping of indexed columns. |
| <level>.fskipwrap | Skip wrapping (via fbeg, fsep, fend) of named columns. Comma separated list of |
| | column id's (starting at 1). See also the special column name '_noWrap' to |
| | suppress wrapping. |
+-------------------+---------------------------------------------------------------------------------+
| <level>.shead | Static start token for whole <level>, independent if records are selected |
| | Shown before `head`. |
......@@ -1621,7 +1623,7 @@ Get Parameter
Post Parameter
--------------
Per `FormElement` (HTML input) the default is to `htmlspecialchars()` the input. This means &<>'" will be encoded as htmlentity
Per `FormElement` (HTML input) the default is to `htmlspecialchars()` the input. This means ``&<>'"`` will be encoded as htmlentity
and saved as a htmlentity in the database. In case any of these characters (e.g. for HTML tags) are
required, the encoding can be disabled per FormElement: `encode=none` (default is `specialchar`).
......@@ -6057,7 +6059,7 @@ Special column names
Twig: respect that the 'special column name'-columns are rendered before Twig becomes active. The recommended
way by using Twig is *not to use* special column names at all. Use the Twig version *qfqLink*.
QFQ typically don't care about the content of any SQL-Query - it just copy the content to the output (=Browser).
QFQ don't care about the content of any SQL-Query - it just copy the content to the output (=Browser).
One exception are columns, whose name starts with '_'. E.g.::
......@@ -6068,6 +6070,16 @@ One exception are columns, whose name starts with '_'. E.g.::
content will be hidden.
* The fourth column (alias name 'link') uses a QFQ special column name. Here, only in this example, it has no
further meaning.
* All columns in a row with the same special column name (e.g. ``... AS _page``) will have the same column name: 'page'.
To access individual columns a uniq column title can be added::
10.sql = SELECT '..1..' AS '_page|column1', '..2..' AS '_page|column2'
Those columns can be accessed via ``{{10.column1}}`` , ``{{10.column2}}`` or ``{{column1:R}}`` , ``{{column2:R}}``
* To skip wrapping via ``fbeg``, ``fsep``, ``fend`` for dedicated columns, add the keyword ``|_noWrap`` to the column alias.
Example::
10.sql = SELECT 'world' AS 'title|_noWrap'
Summary:
......@@ -8206,7 +8218,7 @@ Best practice *recommendation* for using parameter - see `access-column-values`_
}
}
Create HTML tables::
Create HTML tables. Each column is wrapped in ``<td>``, each row is wrapped in ``<tr>``::
10 {
sql = SELECT p.firstName, p.lastName, p.country FROM Person AS p
......@@ -8218,9 +8230,9 @@ Create HTML tables::
fend = </td>
}
Maybe a few columns belongs together and should be in one column.
Maybe a few columns belongs together and should be in one table column.
Joining columns, variant A: firstName and lastName in one column::
Joining columns, variant A: firstName and lastName in one table column::
10 {
sql = SELECT CONCAT(p.firstName, ' ', p.lastName), p.country FROM Person AS p
......@@ -8232,7 +8244,7 @@ Joining columns, variant A: firstName and lastName in one column::
fend = </td>
}
Joining columns, variant B: firstName and lastName in one column::
Joining columns, variant B: firstName and lastName in one table column::
10 {
sql = SELECT '<td>', p.firstName, ' ', p.lastName, '</td><td>', p.country, '</td>' FROM Person AS p
......@@ -8242,7 +8254,7 @@ Joining columns, variant B: firstName and lastName in one column::
rend = </tr>
}
Joining columns, variant C: firstName and lastName in one column::
Joining columns, variant C: firstName and lastName in one table column. Notice ``fbeg``, ``fend` and ``fskipwrap``::
10 {
sql = SELECT '<td>', p.firstName, ' ', p.lastName, '</td>', p.country FROM Person AS p
......@@ -8255,6 +8267,18 @@ Joining columns, variant C: firstName and lastName in one column::
fskipwrap = 1,2,3,4,5
}
Joining columns, variant D: firstName and lastName in one table column. Notice ``fbeg``, ``fend` and ``fskipwrap``::
10 {
sql = SELECT CONCAT('<td>', p.firstName, ' ', p.lastName, '</td>') AS '_noWrap', p.country FROM Person AS p
head = <table class="table">
tail = </table>
rbeg = <tr>
rend = </tr>
fbeg = <td>
fend = </td>
}
Recent List
^^^^^^^^^^^
......
......@@ -1585,9 +1585,18 @@ const COLUMN_MAILTO = "mailto";
const COLUMN_SENDMAIL = "sendmail";
const COLUMN_VERTICAL = "vertical";
const COLUMN_NO_WRAP = "noWrap";
const COLUMN_HIDE = "hide";
const C_FULL = 'full';
const C_TITLE = 'title';
const C_NO_WRAP = 'noWrap';
const C_SPECIAL = 'special';
const C_HIDE = 'hide';
const COLUMN_WRAP_TOKEN = '+';
const COLUMN_STORE_USER = '=';
const FORM_NAME_FORM = 'form';
const FORM_NAME_FORM_ELEMENT = 'formElement';
const FORM_LOG_MODE = '_formLogMode'; // Variable to call the form in debug mode.
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment