_QLButton
Shows a button that, when pressed, executes some QL and can show the result --
Function
The same Type -> _QLButton
(label, ql, target, append, replace, noIcon, noDiv, updateSectionAfter) -> Value has not been set
- Receives -- The same Type
- The value that will be passed to the QL.
- label
- The text to display on the button.
- ql
- The QL to execute when the button is pressed.
- target (optional)
- The id of a div or span to put the results into; if it
is not given, the results will be displayed below the button.
- append (optional)
- If set to true, pressing the button again runs
the QL again, and appends the result to the target div. Otherwise, pressing the button again
closes the div.
- replace (optional)
- If set to true, pressing the button again re-runs
the QL, and replaces the value in the target div. (This is rarely useful.)
- noIcon (optional)
- Normally, Querki adds an indicator icon to the button,
showing that it opens and closes. If
noIcon
is set to True
, that won't be shown.
- noDiv (optional)
- Normally, Querki displays the result of the QL expression
in a div. If
noDiv
is set to True
, the results will be added with nothing around them.
- updateSectionAfter (optional)
- If this is contained within an
_updateableSection
,
and you set updateSectionAfter
to true
, that enclosing section will be redisplayed after this is clicked.
- Produces
- The button
This function is unusual, in that it is a way to do something only if the user presses a button.
It displays a button with the given label; if the user presses that, it evaluates the given ql
(using the received Thing as its context).
As an example of how to use this, say you have a complex Model Property that you want to make
editable on the Thing's page, but you only want to show it when needed. You can say:
[[QLButton(""Edit My Model Property"", My Model Property.edit)]]