Face¶
Each face tag determine template that render engine use for generate output tags.
In fact faces is block of html than concatenated to each other with render engine for generate result.
Note
Renderable Commands at last must have one face tag.
1 2 3 | <face level="" filter="" replace="" function="" rowtype="">
[template]
</face>
|
Important
The face tag has no child tags.
Attributes¶
- level
string[]optional[##-notaion Determine level of data. This property use in hierarchy structure data that present in parent and child record and use in Tree Command and List Command.
- filter
stringoptional[##-notaion Represent sql where clauses that apply to data source and remove unneeded rows.
- replace
booleanoptional[##-notaion Boolean flag that determine replace process must be apply over face render result or no. for more details see Replace
- function
booleanoptional[##-notaion Boolean flag that determine user-defined function must call over face render result or no.
- rowtype
FaceRowTypeoptional[##-notaion Enum that determine type of row that face can apply to it. For more details see FaceRowType
template html [##-notaion¶
Determine template that rendering process use it to format output result.
In face tag, child elements considered as template.
Note
For see more Information about [##-notaion,see [## Notation
Remarks¶
During rendering process,for each data item (object or row) in data source (collection or table) presented with ../../data-binding
, data part (property or cell) injected in template of face tag and add to rendering result.
Data injection apply with @ notation like @col[index] or @[name].
@col[index] notation use for inject data based on index of cell or property in data item and @[name] notation use property or cell name in data item.
For example suppose data source db.users exist like bellow:
id |
managerid |
fname |
lname |
team-name |
|---|---|---|---|---|
1 |
-1 |
s.alireza |
qamsari |
team-a |
2 |
1 |
amir |
jalali |
team-b |
3 |
1 |
akbar |
karimi |
team-a |
And we have a Print Command command like this:
1 2 3 4 5 6 7 | <basis core="print" datamembername="db.users">
<face>
<div>@fname</div>
</face>
</basis>
|
The face has no filter, so all data item (row in this example) use this face for generate result.
As you see, template is:
<div>@fname</div>
As mentioned earlier, @ notation use in template of face for data injection.
@fname in this example use @[name] notation that say replace value of name property or cell with me.
So for first row of collection, injection result is:
1 | <div>s.alireza</div>
|
and as same, for second and third data row result is:
1 2 | <div>amir</div>
<div>akbar</div>
|
Like @[name] notation that use name, we can do data injection by use of data index with @col[id] notation.
For example if face template change to:
<div>@col4<div>
present this result:
1 2 3 | <div>qamsari</div>
<div>jalali</div>
<div>karimi</div>
|
Note
In @col[index] notation, base index is 1 that means first cell of row has index 1
, second cell has index 2 and so on.
Each template can contain more than one data injection in deferent notaion.
For example, following template generate a tag for each row:
<a href="/@col1">@fname - @lname</a>
and result is:
1 2 3 | <a href="/1">s.alireza - qamsari</a>
<a href="/2">amir - jalali</a>
<a href="/3">akbar - karimi</a>
|
Note
Data injection process is case-insensitive, so @col1 or @Col1 is equal.