Filter variable

VariableIcon Description

Nodes of this type are used inside Filters nodes. Using this node, filters can be added to a grid, which will determine the data shown in them.

Runtime appearance

The runtime appearance of this control depends on the "theme" property, and the properties inside "appearance" category. The variable will appear inside the "filters" section in the grid.

VariableFIlterRT
Filter variable

Properties

Category Name Value
General Name (Id) Contains the variable name.
Based On Defines the Type for the variable. Variables must be defined based on an Attribute or a Domain.
Is Collection Determines if the variable is a collection or not. See Collection variables in K2BTools.
Description Description text to be set to the filter.
Filter Type

Defines the filter's type. Possible options are:

  • Standard: Typically used to create filters with simple conditions that involve only one attribute and allow the end user to select one value.
  • StringSearch: Used to create filters to search for a character value in several attributes. See String Search filters.
  • Multiple: Used to create filters that allow the user to select several values. See Multiple filters. Note: Only available in Web Panels.
  • Date Range: Used to create From/To filters for a date attribute using one filter only. Can be used to create "Semantic Filters" (eg: "Last Week", "Last Month", etc)
  • Numeric Range: Used to create From/To filters for a numeric attribute. Several UI options are available, see Numeric Range Filters.
Condition

Contains a condition that uses this variable's value, and should be used to determine which data will be included in the grid.

The default value depends on variable "Based On" and the "Filter Type" properties. The default value can be modified by changing the property's value.

Filter Type = Standard

If it's based on a domain the default value is empty.

If it's based on an attribute:

  • If attribute data type is numeric att = &att when not &att.IsEmtpy()
  • If attribute data type is date att = &att when not &att.IsEmpty()
  • If attribute data type is a string will depend on K2BObjectDesigner->WebPanelDesigner->(Filters) String Search (Search) Search when not &att.IsEmpty()

Filter Type = Multiple

The default value is calculated as "<Att> in &<Selected_Items_Collection> when &<Selected_Items_Collection>.Count > 0".

Filter Type = StringSearch

The default value is calculated as "<Att1> like '%'+&<Filter>+'%' or <Att2> like '%'+&<Filter>+'%' or .... <AttN> like '%'+&<Filter>+'%' when not &<Filter>.IsEmpty()"

Condition Attributes Contains a list of the attributes that should be searched. Only available in "StringSearch" filters. See String Search filters.
Display In Determines if the filter should be included in the Detailed filters section or should be associated with a column. This property is available only when the associated grid is a standard grid. See Filters in column titles
Associated Column References the grid column this filter is associated to. This property is visible only when Display In = "Column".

MultipleFilter

(Only available in Web Panels)

Multiple Filter Type

Determines the UI that will be generated for this Multiple Filter. Possible values are: "Multiple Combo", "Multiple List" and "TagsCollection".

Only visible if "Filter Type" = "Multiple".

For more information on how this option affects the UI, see Multiple filters.

Summary Max Visible Items

Contains the maximum amount of values shown as a summary in the combo's control (when the control is closed).

Only visible if "Filter Type" = "Multiple" and "Multiple Filter Type" = "Combo". See Multiple filters.

No Items Selected Label

Contains the text shown in the combo's control (when the control is closed) if no items are selected.

Only visible if "Filter Type" = "Multiple" and "Multiple Filter Type" = "Combo". See Multiple filters.

Allow Search In List

Indicates if the multiple combo control should include an option to search in the combo's elements.

Only visible if "Filter Type" = "Multiple" and "Multiple Filter Type" = "Combo". See Multiple filters.

Search In List Condition

Contains the condition used to search in the list contents.

Only visible if "Filter Type" = "Multiple", "Multiple Filter Type" = "Combo" and "Allow Search In List" = "True". See Multiple filters.

Search In List InviteMessage

Contains the Invite Message associated to the search control for the list.

Only visible if "Filter Type" = "Multiple", "Multiple Filter Type" = "Combo" and "Allow Search In List" = "True". See Multiple filters.

Generate Clear Selection Action

Indicates if a "Clear Selection" action should be included in the UI.

Only visible if "Filter Type" = "Multiple" and "Multiple Filter Type" = "Combo". See Multiple filters.

Default Value (Comma-separated expressions)

Contains the values that will be selected in the filter by default. This property's value should be a list separated by commas, where each item is an expression. For example, valid values are:

  • 1,2,3,4 (for a filter based on a numeric type)
  • "a","b","c" (for a filter based on a character type)
  • K2BTrnMode.Display,K2BTrnMode.Update (for a filter based on an enumerated domain, in this case "K2BTrnMode")
Default Value Provider

Procedure used to initialize the selected values for this filter. The procedure must return selected values in a collection of the same type as the filter's.

This property is useful when the filter's values are not known during design time, but a default selection based on a defined criteria is desired. For example, in a "Country" filter, the default provider could specify that only the countries associated with the current user are selected by default.

If this property is set and the "Default Value" property is also set, both sets of values are used.

Date Range Filter

(Only in Web Panels)

Date Range Type

Possible values for this property are "Semantic" and "Manual".

If set to "Manual", From/To fields will be shown to the user.

If set to "Semantic", a combobox with the ranges defined in the "Semantic Date Range Set" property will be shown to the user. If the "Include Manual Option" property is set to "True", From/To fields will be generated as well.

Semantic Date Range Set

Contains a set of "Semantic Date Ranges" that should be included in the filter's combobox. This property is available only if "Date Range Type" is set to "Semantic".

A semantic date range is defined by:

  • An internal identifier (not visible to the end user).
  • An GeneXus expression to get the range's Description (will be shown in the semantic options combobox). This expression must return a Character Value.
  • GeneXus expressions to define the From/To boundaries of the range. These expressions must return DateTime values.
Include Manual Option

If set to "True", an option will be included in the filter's combobox that the user can choose to select a custom range. If this option is selected, From/To fields will be displayed for that purpose.

This property is available only if "Date Range Type" is set to "Semantic".

Date Range Empty Item

Determines if the filter's combobox will include an "Empty Item".

This property is available only if "Date Range Type" is set to "Semantic".

Date Range Empty Item Text

Determines the "Empty Item" text for the filter's combobox.

This property is available only if "Date Range Type" is set to "Semantic".

Date Range Default Date From

Determines the default "From" value for this filter. Must contain an GeneXus expression returning a DateTime value.

This property is available only if "Date Range Type" is set to "Manual".

Date Range Default Date To

Determines the default "To" value for this filter. Must contain an GeneXus expression returning a DateTime value.

This property is available only if "Date Range Type" is set to "Manual".

Numeric Range Filters

(Only in Web Panels)

Numeric Range Type

Defines if the user will select the range freely (Manual) or if the user will be shown a set of predefined options to select from (Dynamic Range Set). See Numeric Range Filters.

Numeric Range Set Provider If Numeric Range Type = Dynamic Range Set, this property specifies a data provider used to load the options for this filter.
Numeric Range Include Manual Option If Numeric Range Type = Dynamic Range Set, this property determines if the user should be allowed to enter a manual custom range instead of selecting one of the predefined ones.
Numeric Range Include Empty Item If Numeric Range Type = Dynamic Range Set, this property determines if an "Empty" option should be included in the list.
Numeric Range Empty Item Text Contains the caption for the empty item in the option list.
Manual Input Type

Determines how the user will select the start/end values of the interval. Only used if Numeric Range Type = Manual.

Possible options are:

  • Fields: Two fields (form/to) will be shown.
  • Slider: A slider control will be shown to allow the user to select the interval.
Default From Contains the numeric range default from value. Only used if Numeric Range Type = Manual.
Default To Contains the numeric range default to value. Only used if Numeric Range Type = Manual.
Slider Minimum Defines the minimum bound of the slider control. Only used if Manual Input Type = Slider.
Slider Maximum Defines the maximum bound of the slider control. Only used if Manual Input Type = Slider.
Slider Step Defines the minimum increment between consecutive values that the user can choose.
RangeFilter Range Selector Control Determines if the selector control for a range filter will be a combobox or a list. See Date Range filters and Numeric Range Filters.
Form Visible When set to false, the filter will be hidden inside the web form. Note: Only available in Web Panels.
No Skip

When set to true, the filter will be shown in the same line as the last one. See NoSkip property.

Important: This property existed until K2BTools 13.2. In K2BTools 14.0 it was replaced by the "Element Relative Position" property.

Element Relative Position

Allows to configure the position of the element relative to the previous element. The possible values are:

  • New row
  • Same cell
  • New cell

For more information read Element Relative Position property

Readonly When set to "False" user can change the variable's value, set to false variable will not be editable. Note: Only available in Web Panels.
Invite Message Contains the string that will be used as an invite message. Only available when using Responsive Web Design. Note: Only available in Web Panels.
Tooltip Tooltip to be used when generating the filter control. Note: Only available in Web Panels.
Left Text Text placed before the filter, after the description. Note: Only available in Web Panels.
Right Text Text placed after the filter. Note: Only available in Web Panels.
Contextual Help Value

A text that will appear alongside the variable to provide help for the user. Character values must be placed between quotes. This property's value must contain an expression. This allows the developer to concatenate values ("Please insert value for " + &ProductDescription)

Example:

VariableContextHelpRT

Note: Only available in Web Panels.

Behaviour

(Only available in Web Panels)

Save State

Determines if the filter's value should be saved through the user's session.

Date Picker Determines if a date picker should be associated to this variable's control.
Date Time Filter Granularity Only valid in filters whose type is "Date Time". If set to "Date", the filter will be shown as a Date Variable and the "Time" will be ignored when evaluating the condition.
Include in filter summary Determines if this filter should be included in the filter summary component.
Appearance Class Filter's theme class. Note: Only available in Web Panels.
Description Class Description's theme class. Note: Only available in Web Panels.
Left Text Class Avaiable only if left text is not empty. Left Text's theme class. Note: Only available in Web Panels.
Right Text Class Available only if right text is not empty. Right Text's theme class. Note: Only available in Web Panels.
Autoresize Indicates if the filter's control should be resized automatically or not. Note: Only available in Web Panels.
Width If autoresize is set to false It allows to set the filter width. Note: Only available in Web Panels.
Height If autoresize is set to false It allows to set the filter height. Note: Only available in Web Panels.
Values Default Default value for the filter. This property is not valid for Multiple or Date Range filters.

Child nodes

ControlInfoIcon ControlInfo