6. Linking Content on a Screen

Linking Views using a background filter

Data is displayed in PhixFlow using views. The grid and the card container are both considered types of views. At present, the Employee card container is showing all employees and ideally we only what to show those associated with the company selected on the Companies grid. We will achieve this using a background filter, which is a filter hidden from the end user.

We will create a background filter as follows:

  1. Make sure your screen is unlocked.
  2. Drag Company ID from the grid onto the card container. 
  3. Confirm you want to create a background filter by clicking Yes on the pop up box.
  4. Select Company ID from the drop down and click Confirm.
    1. The prompt is for us to select which attribute on the card container we want to compare to the Company ID we just dragged across.
  5. The background filter is created and applied automatically. The filter properties open on the right.
  6. In the properties pane, change the Name to Selected Company.
  7. Click  Apply.

Filter Explanation

  1. Filter Details: here is an overview of the filter details, for more information see Filter.
  2. Our Clause, Companies.CompanyID, is referencing the component on the screen called Companies and its attribute CompanyID. One very important factor here is that our clause is set to be an expression. 
    1.  Literal Value indicates the value is expected to be a string. Click this icon to switch to an expression.
    2.  (Expression String) indicates the value is expected to be an expression. Click this icon to switch to a string.

Accessing the Filter

The filter we created is owned by the card container. This means to access the filter we navigate to it through the card container.

  1. Click on the Employees card container in the  Layers or click on the card container header on the screen
  2. The  Styles tab will open on the right.
  3. Click the  Properties tab.
  4. Expand the Background Filter Rules, here we see a list of all background filter rules applied to the card container.
  5. Double-click on any rule to open it. For our example, double-click Selected Company.
  6. We see the Filter Rule. This is the condition that needs to be satisfied in order for the Filter to be applied. Our example is blank, this means it will always be true and therefore apply the background filter. However, we can create a filter condition using PhixScript. We will see examples of this later in the course.
  7. We also have the option to disable the filter here by unticking the Enabled check box. This is helpful if debugging.
  8. There is also the option to Stop if True. If ticked, if this filter rule is true, no filter rules after this one will be checked.
  9. To open the filter we created click the Filter hyperlink above the filter name.
  10. Close the Filter and Filter Rule.
  11. Switch to  Application Mode and when you select different companies in the grid the associated employees will be displayed.
  12. Switch back to  Design Mode.