Unofficial Content
  • This documentation is valid for:

In many cases we want our users to specify which registers of a list they want to see. There are many ways to do this, in this article we will explain one of them. It consists in doing an Entry Panel where the parameters can be specified and then it links to our list and shows only the items that fulfill a condition which contains with those parameters.

1. Lets do a really easy model. We will use the following transaction:

SDFilterTrn

NOTE: We want to see the different users depending the value of the attribute SDTTRNLaListaType

This att is based on a Domain Enumerated with two possible values:

FilterDomain

2. Lets do an Entry Panel which will have the variables for the user to put the values to filter the list.

File/New Object/ Work With Devices

We want to create a Detail/Edit section. So delete the list node (right-click/delete), and create a Detail also create only on Edit Mode

SDFilterEntryPanel1

filterAddDetail

SDFilterEntryPanel2

SDFilterEntryPanel3 

Lets add a Variable to the Entry Panel

SDFilterAddVariable

Remember that the type of this variable should the Type Domain (same as SDTTRNLaListaType). We selected the Domain Type=Character(1)

Add that variable to the layout. (Right Click over the Pink table on the layout tab)

SDFilterLayout

Finally we have to create an action that will invoke the list we want to see.

Events/AddAction

SDFilterAddAction

SDFilterActionProperties

3. Now on our list we have to define that we are going to receive a parameter.

Just add the following rule the Rules tab of the List.

SDFilterReceiveParm

4. Now we have to create a Data Selector which will filter the list for us.

File/New/Object/Data Selector

This Data Selector will receive a parameter (the variable with the value we want to filter by)

rihg-click on parameters/ Add Var Parameter

SDFilterDSParam

we have to set a condition

right-Click on Conditions/ addCondition

SDFilterDSCond

5. Lastly we have to tell GeneXus that our List is going to use the Data Selector we recently created.

To do so we have a parameter named Data Selector on the properties of the List Node.

We select the Data Selector we just Created

and on the property Data Selector Parameter we specify the variable we receive is the one he needs to filter by.

SDFilterListDSProp

Done!

Let see how it works:

SDFilterAndroid1 SDFilterAndroid2

SDFilterAndroid3 SDFilterAndroid4

SDFilterAndroid5 SDFilterAndroid6

Last update: November 2023 | © GeneXus. All rights reserved. GeneXus Powered by Globant