Description

The BqlToWidgets component is used to generate a Px view by duplicating a view template for each result of a BQL query. It allows creation of automatic menus, enriched lists, etc.


In the BQL query that is run in the station, the column names (in green below) can be used to define the .px views used as templates.   (warning)


Implementation

  • Copy / paste the component into the station from the palette.
  • Indicate the path to a file folder in the PxContainer field.
  • Indicate the name of the Px that will be generated in the PxName field. (It is possible to use BFormat but special characters should be avoided).
  • Enter the BQL query with the relevant column names in the Query field. Column names can be used to choose view templates or provide variables to these view templates (similar to pxlnclude).
  • Choose the duplication style via the ColumnMode property.
  • The .px view template(s) must be added to the PxModels field. Their variables must match the column names defined in the BQL.
  • The design of the view generated by the BqlToWidgets can be modified using the properties found in WidgetConfig.
  • Run the Execute action.
  • For automatic periodic execution, specify an interval in the ExecuteTime field.


Properties

  • ExecuteTime: Specifies a time interval for running the Execute action. PeriodicExecutionEnabled must be true.
  • PeriodicExecutionEnabled: Enables the automatic running of the Execute action at the interval defined by the ExecuteTime property.
  • PxContainer: The destination path of the generated .px view.
  • PxName: The name of the generated .px view.
  • Query: The BQL query. The column names must match the variables in the .px view templates.
    (warning) the query won't be optimized if it contains a "neql" scheme
  • OptimizedQuery: Similar to the Query property, but optimized to run faster (by modifying the 'slot' scheme). Optimization is done using the Optimize action.
  • PxModels: Allows .px view templates to be defined, containing variables for the column names of the BQL query, which will be copied. It is possible to define .px view templates using conditions related to the results of the BQL query. The first true condition found applies.

When the mode is Dual Axis (ColumnMode property), the view templates are defined for the left part, the top part, the main part and the corner.

  • ColumnMode: The Simple mode duplicates the Px templates next to each other, while the Dual Axis mode classifies them according to the two axes each defined as a column of the BQL or to their alias. Thus, a query with a select name as 'name' for example allows the use of a variable $(name). The Simple Mode can use two different Niagara panes for the result, either a GridPane (fixed number of columns) or a FlowPane for responsive views (dynamic number of columns depending on the available space).

  (warning) After a change of mode it is necessary to refresh the page to update the view of the PxModels field.



  • WidgetConfig: Groups all the properties related to the design.
    • LimitOn: Defines whether the Limit slot should specify a limit for the rows or columns of the table.
    • Limit: Specifies the maximum number of columns when the LimitOn field is set to Column or the maximum number of rows when the LimitOn field is set to Row.
    • Background: Sets the background of the view.
    • BandBrush: Indicates the color of the even lines. The ColorRows slot must be true.
    • ColorRows: Enables / disables the coloring of the even lines. The color must be set via the BandBrush slot.
    • Valign: Indicates the vertical position of all elements.
    • Halign: Indicates the horizontal position of all elements.
    • RowAlign: Indicates the horizontal position of the cell contents.
    • ColumnAlign: Indicates the vertical position of the cell contents.
    • UniformRowHeight: Allows all lines to be of the same height.
    • UniformColumnWidth: Allows all lines to be of the same width.
    • StrechRow: Defines the row of the table that will be stretched if needed (0 equals the first line).
    • StrechColumn: Defines the column of the table that will be stretched if needed (0 equals the first column).
    • RowGap: Allows space between the rows in the table to be defined.
    • ColumnGap: Allows space between the columns of the table to be defined.


Advanced configuration properties

  • InitOnStart: Sets whether the Execute action should be performed when the component is started.
  • InitOnClone: Sets whether the Execute action should be performed when copying the component.


Actions

  • Optimize: Improves the speed with the BQL query defined in the Query field is executed by optimizing the 'slot' scheme. The optimized query is saved in the OptimizedQuery field.
  • Execute: Generates the view. In most cases, just refreshing the view is sufficient to see the changes applied (F5 in the browser, Refresh button in the workbench). The only special case is the use of the workbenchView BqlToWidgetsView in another view: the changes require a logoff / reconnection to be taken into account.


Training

You can follow this e-learning course to practice