Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Insert excerpt
_Banners
_Banners
nameactionflow
nopaneltrue

By the end of this chapter you will understand what an Open Screen action is and how to use them, and you will have created an Open Screen Actionflow in your application.

What is an Open Screen Action?

The 

Insert excerpt
_action_screen
_action_screen
nopaneltrue
 action opens new screens in PhixFlow. Open Screen actions run once per flow, or once after receiving the final record.

Creating Open Screen Actions

How do you add them (toolbar click and drag, or drag from toolbar), 


Add excerpt to properties page in hidden area


Worked Example

Here's a worked example using the school course data.

We want to be able to add and edit the courses in our School Courses grid. To do this, we will create two Open Screen Actionflows. Both will open the same screen 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.

Note: When creating a new screen in PhixFlow there is a Grid Actions wizard that will 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.

Open Screen to Add New Data

  1. Open the Course Management screen where the Actionflow will be initiated from
  2. Right-click on the button and choose 
    Insert excerpt
    _actionflow_add
    _actionflow_add
    nopaneltrue
  3. Enter a name for the action
    1. Name: Add Course
  4. Click the 
    Insert excerpt
    _action_screen
    _action_screen
    nopaneltrue
     icon in the toolbar to display the existing screens in your application
  5. Drag the Course Form screen from the Repository onto the canvas to create an Open Screen node
    1. Alternatively, drag the 
      Insert excerpt
      _action_screen
      _action_screen
      nopaneltrue
       icon from the toolbar onto the canvas and follow the steps to create or open an existing screen
  6. Connect the Open Screen node to the button by selecting Click to Connect
  7. For the input, choose the On Click Action Event, then select Connect Input
  8. Click and drag the 
    Insert excerpt
    _driving_interface_connection_point
    _driving_interface_connection_point
    nameicon
    nopaneltrue
     icon onto the Open Course Form node to connect the input to the action
  9. Close the Actionflow to return to the Course Management screen
  10. Lock the screen and press the  button to see the Actionflow in action
    1. We can see that the Actionflow is working because it displays an empty form
Tip
titleWhy do we use an On Click input?

An input of On Click means that the Actionflow is initiated by the user clicking a button. We use an input of On Click where an Actionflow does not require any data to perform the action.

In the exercise above, we are creating an Actionflow that opens a screen where new courses will be created, therefore no data needs to be transferred across to the Course Form screen.

Open Screen to Edit Existing Data

  1. On the Course Management screen, where the Actionflow will be initiated from, right-click on the  button and choose 
    Insert excerpt
    _actionflow_add
    _actionflow_add
    nopaneltrue
  2. Enter a name for the action
    1. Name: Edit Course
  3. Click the 
    Insert excerpt
    _action_screen
    _action_screen
    nopaneltrue
     icon in the toolbar to display the existing screens in your application
  4. Drag the Course Form screen from the Repository onto the canvas to create an Open Screen node
    1. Alternatively, drag the 
      Insert excerpt
      _action_screen
      _action_screen
      nopaneltrue
       icon from the toolbar onto the canvas and follow the steps to create or open an existing screen
  5. Connect the Open Screen node to the  button by selecting Click to Connect
  6. For the input, choose the School_Courses View Component, then select Connect Input
  7. The Mappings window will open:
    1. Drag the CourseID attribute from the left (Tile Body) to the right (Edit Course), then click Save
  8. Click and drag the 
    Insert excerpt
    _driving_interface_connection_point
    _driving_interface_connection_point
    nameicon
    nopaneltrue
     icon onto the Open Course Form node to connect the input to the action
  9. Right-click the connection wire between the input node and Open Screen node on the canvas
  10. Choose Open Mappings and the Mappings window will open:
    1. Drag the CourseID attribute from the left (Edit Course) to the right (Open Course Form), then click Save
  11. Close the Actionflow to return to the Course Management screen
  12. Lock the screen and press the button to see the Actionflow in action
    1. We can see that the Actionflow is working because it displays the data from the School Courses grid to the edit form
Tip
titleWhy do we use a datasource input?

A datasource input means that the Actionflow requires data to perform the action.

In the exercise above, we are creating an Actionflow that opens a screen where existing courses will be edited, therefore data needs to be transferred from the School Courses grid, through the Actionflow and out to the Course Form screen.