Button

A button can be configured to perform such actions as setting the values of dynamic variables, exporting the contents of a particular widget to a specified target, triggering a refresh of invalidated widgets, saving the dynamic state of the QuickApp to a configuration file, or loading the state from a previously-saved configuration file.

Type
Determines the type of button.

Valid options are:

Dummy
Display a message in a dialog box stating the button worked.
Submit
Submit an update request to specified widgets in order to trigger a refresh of those widgets.

The list of widgets is specified in the Submit widgets field. If no widgets are specified, then all widgets receive an update request.

Reset
Reset the QuickApp to its initial state.
Export
Export the results from the query associated with this widget to the target selected in the Export target list.
Render
Download all tables and charts contained in the QuickApp to an Excel workbook.

The Excel workbook is downloaded with the file name specified by Download filename and the extension .xlsx.

If no file name is specified, the file is downloaded as download.xlsx.

Set variables
Set the value of one or more dynamic variables.

See Variable for set value and Value to set for details.

Dump configuration to table
Save the current dynamic state of the QuickApp into a table consisting of a single row with one column per dynamic variable name.

By default, the values of all dynamic variables in the QuickApp will be saved to a table in your My Data folder with the title "QA configuration dumped at YYYYMMDD HHMMSS" (where YYYYMMDD HHMMSS is the timestamp).

Additional attributes can be specified via Ad-hoc properties to customize the configuration dump. These attributes allow you to specify the folder in which the new table is created, the title of the table, the variables to include in (or exclude from) the configuration file, access permissions, and whether to replace the table or append to it. See the 1010data Reference Manual for a complete list of these attributes.

When the dynamic state of the QuickApp is successfully saved, the path to the table containing the configuration is saved in the variable specified in the Value to set field.

Configure from query
Load the dynamic state from the results of a query.

Using the results of the 1010data query associated with this widget, the value of each dynamic variable in the QuickApp is set to the value in the last row of the column with the same name as that dynamic variable.

Therefore, tables created using Dump configuration to table can be used directly by the query associated with this type of button.

Label
Button text
The text that will appear on the button.
Button color
The color of the button.
The color can be selected using the color picker or can be specified as:
  • Any valid HTML color name (e.g., red, blue, cyan)
  • An RGB value (e.g., rgb(238,147,12))
  • A hex value (e.g., #d12345)
Text color
The color of the text on the button.
The color can be selected using the color picker or can be specified as:
  • Any valid HTML color name (e.g., red, blue, cyan)
  • An RGB value (e.g., rgb(238,147,12))
  • A hex value (e.g., #d12345)
Text style
The appearance of the text on the button.

When this field gets focus, a dialog is presented that allows the user to select the family, style, size, and other characteristics of the text such as letter spacing and underlining.

Export target
When Export is selected from the Type drop-down, the following determines the target for the results of the query associated with this button.

Valid options are:

Default
The default behavior is to export the results of the query to a 1010data worksheet in a new tab.
Worksheet in new tab
Export the results of the query to a 1010data worksheet in a new tab.
Worksheet in this tab
Export the results of the query to a 1010data worksheet in the current tab, replacing the QuickApp.
Download CSV
Export the results of the query to a comma-separated values file and download it with the extension .txt.

The file is downloaded with the file name specified by Download filename.

If no file name is specified, the file is downloaded as download.txt.

Download compressed CSV
Export the results of the query to a comma-separated values file and download it to your computer as a compressed file with the extension .zip.

The file is downloaded with the file name specified by Download filename.

If no file name is specified, the file is downloaded as download.zip.

Download to Excel
Export the results of the query to an Excel spreadsheet and download it to your computer with the extension .xls.

The file is downloaded with the file name specified by Download filename.

If no file name is specified, the file is downloaded as download.xls.

Target mode
Default
The default behavior is to export the fully expanded query. (See Expanded ops.)
Expanded ops
Export the fully expanded query to worksheet.

If the 1010data query associated with this button contains block code with parameters, the block code is expanded and the parameters replaced with their values.

For example, the following query:
<block name="storeSelection" storechoice="3">
    <sel value="store={@storechoice}"/>
</block>
will be expanded to:
<sel value="store=3"/>
in the target worksheet.
Unexpanded block
Export query to target worksheet as a block.

If the 1010data query associated with this button contains block code, the block code and its parameterizations are left intact in the target worksheet.

For example, the following query:
  <block name="storeSelection" storechoice="3">
    <sel value="store={@storechoice}"/>
  </block>
will be exported as:
<block name="hmadded__9" tag_="13" instid_="t26" changed_="">
  <block name="storeSelection" storechoice="3">
    <sel value="store={@storechoice}"/>
  </block>
</block>
in the target worksheet.

See the 1010data Reference Manual for more information on blocks.

Variable for set value
The variable to set when the button is clicked.

You may select a variable from the dropdown, or you can create a new variable by clicking New... and entering the name in the field following the @ symbol.

Note: If you need to set more than one variable, specify each variable in the Ad-hoc properties tab. Each variable must have the form: value[SUFFIX]_, where each [SUFFIX] is unique for each variable.

If the button type is Dump configuration to table, this variable will be set to the path of the table where the dynamic state has been saved (upon successful completion).

Value to set
The value to set the variable (specified by Variable for set value) when the button is clicked.
Note: If you need to set more than one variable, specify the values to set in the Ad-hoc properties tab. Each value must have the form: newvalue[SUFFIX]_, where each [SUFFIX] is unique for each variable.
Submit widgets
A comma-separated list of manually-updated widgets that will receive an update request when a button of type submit is clicked.

If no list is supplied, all widgets will be refreshed when a submit button is clicked.

Note: See Update control for settings regarding the update mode for a particular widget.
Download filename
The name to use for files downloaded via buttons whose Type is either Export or Render.

The appropriate extension (e.g., .csv, .zip, .xls, .xlsx) will be appended to the file name specified here.

If no file name is specified, the default file name is download (e.g., download.csv).

Example

<note type="base">Applied to table: pub.demo.retail.item</note>
<dynamic store_num="1">
  <widget class_="field" label_="Input Store Number:" max_="3" min_="1" 
name="hmadded__1" relpos_="638,35" type_="numeric" value_="@store_num"/>
  <widget class_="button" color_="#4f81bd" height_="22" name="hmadded__2" 
relpos_="893,34" submit_="hmadded__3" text_="Select" 
textstyle_="font-weight:bold;letter-spacing:0;" type_="submit" width_="84"/>
  <widget base_="pub.demo.retail.item" class_="grid" invmode_="block" 
invmsg_="Press Select for changes to take effect" name="hmadded__3" 
relpos_="9,10" update_="manual">
    <sel value="store={@store_num}"/>
  </widget>
</dynamic>

Example

<note type="base">Applied to table: pub.demo.retail.item</note>
<dynamic store_num="3" display_graph="1" display_grid="1" dump_table="" 
load_table="">
  <widget class_="field" label_="Input Store Number:" max_="3" min_="1" 
name="hmadded__1" relpos_="21,26" type_="numeric" value_="@store_num"/>
  <widget base_="pub.demo.retail.item" class_="grid" errmsg_="Select a store" 
invmode_="hide" name="hmadded__3" relpos_="10,96" require_="{@display_grid=1}" 
update_="auto">
    <sel value="store={@store_num}"/>
  </widget>
  <widget base_="pub.demo.retail.item" class_="graphics" errmsg_="Select a store" 
invmode_="hide" name="hmadded__4" relpos_="613,97" require_="{@display_graph=1}" 
type_="pie" update_="auto">
    <sel value="store={@store_num}"/>
  </widget>
  <widget class_="button" color_="#4f81bd" dumptitle_="Dump Configuration Table" 
height_="22" name="hmadded__7" relpos_="293,25" text_="Dump Config" 
textstyle_="font-weight:bold;letter-spacing:0;" type_="dump" value_="@dump_table" 
width_="110"/>
  <widget class_="text" invmode_="hide" name="hmadded__10" relpos_="292,69" 
require_="{@dump_table<>''}" text_="Config file saved to: {@dump_table}" update_="auto"/>
  <widget class_="button" color_="#4f81bd" height_="22" invmode_="hide" name="hmadded__11" 
relpos_="1008,23" require_="{@load_table <> ''}" text_="Load Config" textstyle_="font-weight:bold;letter-spacing:0;" type_="config" update_="auto" width_="110">
    <if test="{@load_table<>''}">
      <then>
        <base table="{@load_table}"/>
      </then>
    </if>
  </widget>
  <widget class_="checkbox" default_="1" false_="0" label_="Display Graph" 
name="hmadded__8" relpos_="136,67" true_="1" value_="@display_graph"/>
  <widget class_="checkbox" default_="1" false_="0" label_="Display Grid" 
name="hmadded__9" relpos_="21,67" true_="1" value_="@display_grid"/>
  <widget accept_="table" class_="browser" dropheight_="250" filter_="table" 
holdfor_="{@dump_table}" inputwidth_="400" label_="Select config file to load:" 
labelwidth_="130" name="hmadded__2" path_="uploads" relpos_="434,24" show_="path" 
update_="auto" value_="@load_table"/>
</dynamic>