type_="config"

Using type_="config" creates a button that sets the values of dynamic variables from the results of a query.

Description

Using the results of the 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.

By default, the button is labeled with the text Load; however, you can specify a different button label using the text_ attribute.

This is useful for loading a configuration dump that was previously saved to a table using a button of <widget class_="button" type_="dump">. See the example in this topic as well as type_="dump" for more information.

Syntax

<dynamic>
    <widget class_="button" type_="config">
      [1010data_QUERY]
    </widget> 
</dynamic>

Example

<dynamic output="" load_table="" dump_table="">
      <widget class_="button" dumptitle_="Doc Widget HTML" 
       height_="22" type_="dump" value_="@dump_table" vars_="output"/>
      <widget class_="button" invmode_="hide" disabled_="{@load_table = ''}" 
       type_="config" update_="auto">
        <if test="{@load_table<>''}">
          <then>
            <base table="{@load_table}"/>
          </then>
        </if>
      </widget>
      <widget accept_="table" class_="browser" dropheight_="250" 
       filter_="table" holdfor_="{@dump_table}" inputwidth_="400" 
       label_="Select file to load:" labelwidth_="130" path_="uploads" 
       show_="title" update_="auto" value_="@load_table" showtimestamp_="1" 
       sortby_="time" sortdir_="down"/>
    </layout>
    <layout>
      <widget class_="textbox" base_="pub.demo.retail.item" height_="800" 
       width_="800" mode_="rich" value_="@output"/>
      <ignore>
        <layout width_="500">
          <widget class_="text" text_="{@output}"/>
        </layout>
      </ignore>
    </layout>
  </layout>
</dynamic>