Filter Node

FilterNodeImg01

The purpose of Filter node is to insert in some part of the form a control which will allow user to filter at runtime the grid´s records which accomplishes certain condition (based on some attributes). There is an ilustration of this below.

Filter node has the following properties:

Category Property  
General Properties Name FilterNodeImg02
Description
Right text
Invite Message
Middle text
Type Definition Data type
Domain / Attribute
Type
Values Default
All
Form Theme Class
Visible condition
Condition Condition
Control Info Control Info
Control Info Based On 
Conditions (Dynamic Controls)
Control Type
Advanced Security Security Functionality Key
Location in father table Cell Theme Class
Column Span
Row Span
Align
Start Col / Fst Avail
Show Description
Description Width
Description Position
Merge with previous cell

General Properties:

Name:

Specifies the name of the variable which will represent the filter control on the form.


Description:

Filter variable's description. Represents the caption of the textblock which will apear next to the variable itself in the form if Show description property is True. In the example above variable is PersonLastName while its description is Last Name. So, "Last Name" will appear next to PersonLastName filter, like we can appreciate below. 


Right text:

Represents a label that will be inserted next to the variable if this property is not empty, in the same cell as it. The theme that will be asigned to this label will be taken from WWP Configuration -> Theme -> Att/Var Right text. An example of this property can be seen on same property of Attribute Node

Invite Message:

Specifies a message that will be displayed in the filter's field in order to describe what you should fulfill on it. 


Middle text:

Represents a label that will be inserted between both fields in the Range filters (only applies for Range filters).

FilterNodeImg03

Properties Of Category Type Definition:

Data Type:

Specifies whether the filter will have a basic type (value Basic) or whether it will be based on some attribute, domain, SDT or BC (value based on).

Domain/attribute:

Represents the domain or attribute in which the filter variable will be based on. This property can be empty. In this case, if the variable's name is equal to any attribute´s name then the variable will be based on that attribute. Otherwise, the variable will be defined as Numeric(4.0) which is the default definition for any variable. In the example above Domain/attribute property is '(none)' and as the variable's name is PersonFirstName (which exists an attribute with its same name), the varable will be defined based on that attribute.

Type:

Specifies the type of the filter. Most of the GeneXus possible types are supported by this property:

VariableImg15

Properties Of Category Values:

Default:

Specifies the default value that will be displayed in the filter when the page loads its first time. In other words, it specifies the filter's value by default. In the example above, Default property is empty so when PersonWW object loads, PersonLastName filter will be empty.


All:

Only applies to variables in which their control type is combo box, and specifies whether an option to select all values will be added to the combo box or not.

Properties of Category Form:

Theme class:

Filter's theme class.

Visible condition:

Specifies a condition that will determine whether the filter will be visible or hidden.

Properties Of Category Condition:

Condition:

Specifies the sentence that will be executed within the filter variable value and the attribute value of every transaction record in order to determine whether the record accomplishes the condition or not, and therefore if the record will be included in grid or not.In other words, represents the condition sentence associated to the filter.

In the example above, condition is "PersonFirstName like &PersonFirstName when not &PersonFirstName.IsEmpty()". This means that if user leaves the filter field empty then all records will be shown but if user set some string in it, grid will display only the records which starts with the filter field value (because of the like command).

If you has the property 'Generate Data Selector' on True we can visualize the condition added in the Data Selector:

FilterNodeImg08

If you has the property 'Generate Data Selector' on False we can visualize the filter condition added in Tab Conditions:

FilterNodeImg09

At runtime, we can visualize that when PersonWW page loads all records are displayed because filter field is empty:

FilterNodeImg04

Then, if we set 'f' to filter field, according to the condition filter, grid will only display records in which its attribute PersonName starts with 'm'. We visualize the results:

FilterNodeImg05

 

There is a possibility to insert filters without setting a condition. This is useful in the following scenarios:

  1. Associate two filters (variables) into one condition concatenated by an ?OR? expression:
    FilterNodeImg06

    FilterNodeImg07
  2. Add a filter which will only show a related attribute of an FK (like in the following example: CompanyId, CompanyName).
    FilterNodeImg10

    FilterNodeImg11

Properties Of Category Control Info:

Control Info:

Specifies whether the filter will have a specific control type based on some domain/attribute, etc or will be defined customized. If you leave this property in its default value (based on) with empty value in 'Control info based on' property the control type of the variable will be the same as its definition.

Depending on the value of 'Control Info' property some properties are visible or hidden automatically.

Control info based on:

Specifies the domain or attribute in which the filter's control info will be based on.


Conditions (Dynamic controls):

Specifies the conditions to be added to the control (only if the control is Dynamic Combo, Listbox or Suggest). 

Control Type:

Specifies the attribute's control type.

Most of the options that GeneXus allows for control types are supported in this property:

AttributeImg16

Properties Of Category Advanced Security:

Security Functionality Key:

Specifies the name of the permission that the filter will have for defining whether that filter will be visible for some role. If the value is empty, it won't add security to the filter in this object.

If you want to read information about the Location in father table properties, follow this link: Location in father table