6. Linking Content on a Screen
- Zoe Baldwin
Owned by Zoe Baldwin
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:
- Make sure your screen is unlocked.
- Drag Company ID from the grid onto the card container.
- Confirm you want to create a background filter by clicking Yes on the pop up box.
- Select
Company ID
from the drop down and click Confirm.- 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.
- The background filter is created and applied automatically. The filter properties open on the right.
- In the properties pane, change the Name to
Selected Company
. - Click Apply.
Filter Explanation
- Filter Details: here is an overview of the filter details, for more information see Filter.
- 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.
- Literal Value indicates the value is expected to be a string. Click this icon to switch to an expression.
- (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.
- Click on the Employees card container in the Layers or click on the card container header on the screen
- The Styles tab will open on the right.
- Click the Properties tab.
- Expand the Background Filter Rules, here we see a list of all background filter rules applied to the card container.
- Double-click on any rule to open it. For our example, double-click Selected Company.
- 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.
- We also have the option to disable the filter here by unticking the Enabled check box. This is helpful if debugging.
- 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.
- To open the filter we created click the Filter hyperlink above the filter name.
- Close the Filter and Filter Rule.
- Switch to Application Mode and when you select different companies in the grid the associated employees will be displayed.
- Switch back to Design Mode.