class_="value"
A value
widget displays the value of its bound variable, formatted
appropriately for its type. (Available as of version 11.19)
Description
In addition to displaying simple types (e.g., integer, decimal, text), complex types are
also handled:
- Lists and packages are displayed, by default, as JSON
- Table values are displayed as tables
- XML (XML tags or lists thereof) is displayed in text form
Syntax
<dynamic var=""> <widget class_="value" value_="@var"/> </dynamic>
Attributes
value_
- Specifies the name of a variable. The value of the variable is displayed by the widget.
Example: Using the value
widget to display different types of
variables
The following example retrieves the Macro Language code for
pub.doc.retail.barchartex, a query that tabulates the total profit,
sales, and cost by date for the data in pub.demo.retail.item. It uses
three value
widgets to display the values of the textvar
,
xmlvar
, and basevar
dynamic variables that are populated
by the <do>
clause.
<dynamic textvar="" xmlvar="" basevar="" lwidth="75"> <do action_="getquery" path_="pub.doc.retail.barchartex" value_="@textvar" xmlvalue_="@xmlvar" basevalue_="@basevar"/> <layout arrange_="v" width_="500"> <widget class_="value" value_="@textvar" label_="value_" labelwidth_="{@lwidth}"/> <widget class_="value" value_="@xmlvar" label_="xmlvalue_" labelwidth_="{@lwidth}"/> <widget class_="value" value_="@basevar" label_="basevalue_" labelwidth_="{@lwidth}"/> </layout> </dynamic>
Example: Using the value
widget to display a table-value
variable
<dynamic tablevar=""> <do action_="getdata" base_="pub.demo.retail.store" tablevalue_="@tablevar"/> <widget class_="value" value_="@tablevar"/> </dynamic>
Example: Using the value
widget to display a package variable
<dynamic packagevar="{pkg('a' 'b' 'c'; 1 2 3)}"> <widget class_="text" text_="An example of displaying a package variable: "/> <widget class_="value" value_="@packagevar"/> </dynamic>