2. SettingWhat is a View Action?
Image Added
The Insert excerpt |
---|
| _action_view |
---|
| _action_view |
---|
nopanel | true |
---|
|
action selects and filters additional data to use in an Actionflow. This is useful where the originating screen or component does not include all of the data that the Actionflow requires.
Creating View Actions
- Click the
Insert excerpt |
---|
| _action_view |
---|
| _action_view |
---|
nopanel | true |
---|
|
icon in the toolbar to display existing tables in the application- Existing tables can be dragged from the Repository onto the canvas - choose
Insert excerpt |
---|
| _action_view |
---|
| _action_view |
---|
nopanel | true |
---|
|
in the pop-up box to create a View action node
- Alternatively, drag the
Insert excerpt |
---|
| _action_view |
---|
| _action_view |
---|
nopanel | true |
---|
|
icon from the toolbar onto the canvas and select a primary table to view from the drop down list
HTML Comment |
---|
|
Insert excerpt |
---|
| View Node |
---|
| View Node |
---|
nopanel | true |
---|
|
|
Worked Examples
Here's a worked example using the School Data (available from the Learning Centre).
We want to be able to add and edit the courses. The first step to doing this is by creating two Open Screen Actionflows. Both will open the same screen containing an input form, but when we are adding a new course, we want an empty input form, and when we are editing an existing course, we want the input form to contain course data. SCREENSHOTS?
Tip |
---|
If you are completing this chapter as part of the Actionflow course and using a training instance, the data and screens have already been pre-loaded into the Actionflow Application. For this example, we'll be working on the Course Management screen and opening the Course Form screen.
|
In this example, we are using:
a Course Management screen containing a grid of the School Courses data - the screen was created using the Tile with Buttons templatea Course Form screen containing form fields, associated with School Courses data by a background filter - the screen was created using the Edit Form template
To save the new or edited course, the Save Action on the input form must be configured. See 1.09 Save Action Configuration.
Note: When creating a new screen in PhixFlow, a Grid Actions wizard can configure the Create, Read, Update and Delete (CRUD) actions for you. For the purposes of understanding the mechanics of Actionflows, we will create these manually.
Updating data for one table dynamically updates data in another table
Setup the View Action
- Open the Save Actionflow for the Teachers Form
- Click on the input connection point to open the Connector Mappings
- Drag the TeacherStatus attribute from the left to the Drag and Drop area on the right
- Click Save
- Drag a View Action from the toolbar onto the canvas
- Name: Get Courses
- Primary Table: choose School Courses
- Select Create Action
- Drag and drop the View action you just created onto the in connector between the input node and the Save action
- Click on the in connector between the input node and the View node to open the Mappings
- Drag both the TeacherID and TeacherStatus attributes from the left to the Drag and Drop area on the right
- Select Save
- Click on the View Action to open the properties
- In the Output Attributres section, select the
Insert excerpt |
---|
| _attributes_icon |
---|
| _attributes_icon |
---|
nopanel | true |
---|
|
icon- Drag the CourseID and CourseStatus attributes into the Output Attributes section in the properties
- Select OK
- In the Data Retrieval Options section, click the
Insert excerpt |
---|
| _addIcon |
---|
| _addIcon |
---|
nopanel | true |
---|
|
next to Filter and create a filter:- Name: ByTeacher
- Filter Details: Image Added
- Select
Insert excerpt |
---|
| _finish |
---|
| _finish |
---|
nopanel | true |
---|
|
- Select
Insert excerpt |
---|
| _finish |
---|
| _finish |
---|
nopanel | true |
---|
|
on the properties
Setup the Calculate Action
- Drag a View Action from the toolbar onto the canvas
- Name: Change Course Status
- Select Create Action
- Drag and drop the Calculate action you just created onto the in connector between the View action node and the Save action node
- Click on the in connector between the View action node and the Calculate action node
- Map across the CourseStatus, TeacherID and TeacherStatus attributes as these are needed for the Calculate action
- Select Save
- Click on the Calculate action to open its properties
- In the output attribute section, click
Insert excerpt |
---|
| _add_icon |
---|
| _add_icon |
---|
nopanel | true |
---|
|