Applying Visibility On UI element on basis of Count of rows in Table - Pega Tutorial

This is a Pega tutorial to show or hide a UI element based on the visibility condition which depends on the count of rows in a table layout




Example Scenario: I want to display a button element when there are at least 3 rows in a table. In this scenario, I will use below function in when rule

Analysis of Requirement

Table layout can be populated only and only from a Pagelist type of data i.e it can be either pagelist or data page of type pagelist.

It means, if we find out a way to count elements in Pagelist, it simply means number of rows in table as Table layout is just a representation of pagelist.

Solution in Pega Infinity

The solution for applying visibility condition on UI element on basis of count of rows in table is following.

  1. Identify the Pagelist / Data Page of pagelist type that is used to display table layout.
  2. On the visibility condition of UI element add when condition , say, IsXYZVisible.
  3. In this when rule write below condition using expression builder in below format
    1. Lengthofpagelist(<name of your pagelist>) <condition> <desired count>

For Example. I want to display a button element when there are at least 3 rows in a table. In this scenario, I will use below function in when rule

Lengthofpagelist(<name of your pagelist>) >= 3




Post a Comment

0 Comments