Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 4 Next »

Overview

The purpose of this lesson is explain the Actions in Wayfast. This “Actions” are events that allow us to interact with our Project DB. To make this connection, it’s mandatory to associate an action with a control. In previous tutorials, we analyzed how to create controls and how they are connect to dataset. Actions will be connected to those entities when the application user has to interact with the interface.     

Actions

Preconditions

We need to create a Dataset and Controls in our project’s page:

  1. Inputbox: This control will allow us to insert data into our Project DB

  2. Button: This control will trigger the insert and it should be connected to the Action that we are going to create

  3. Grid_column: This control will display the values that we have stored into our Project DB 

This is the Page’s structure in preview on the Application environment.  

Also a Stored Procedure is needed to save the input information in the frontend

See that the @Dato1 and @Dato2 are connected to the inputbox controls and the grid_column controls previously created in Wayfast. Once that the Stored Procedure is created, we can go back to Wayfast application and synchronize the SP in the environment.

Click “End Task” button related to Project’s requirement. This step is only needed for synchronization of the new Table and Stored Procedure generated in DB.

Now we have the new objects available in Wayfast Application to associate with Controls and Actions.

How to create new Action?

Return to Page’s information details.

Click “Button” link and select “Actions” tab. Then click “New Action” button to generate this new relation

A new popup is displayed on screen.

Complete the “Name of the Action” field with the identification for this new action, then select “Stored Procedure” in “Action Groups” since we created a SP in our DB for this purpose. After we select the option, Wayfast will display 2 options on “Action” field:

  • FORM is used in Wayfast as unique execution in the whole page. 

  • LIST is an action that can be executed as many times that it’s requested. Mostly this is needed when the page has multiple registries in grid views.

In this case, we are going to execute the action over the entire form.

Make sure that search on “Stored Procedure” lookup field remain the created SP in DB. Automatically Wayfast detect the SP parameters: “Dato1” and “Dato2”. These parameters should also be added in the “Parameters” text field “&InpDato1” and “&InpDato2”. They have to be separated by commas.

Finally choose the instance (environment) where we are going to apply the Actions setting. Click “Accept” and the new action is created and connected to the Application.

Click “Preview” button on the page and input new values. Then click on “Agregar” button which is the control associated to the action.

Verify in the DB that the “Hola_Mundo_Acciones” table has the new input values inserted through the app

How to update Dataset with new Action created?

If the action created and linked to the control (button) is updating the DB but the new data is not displayed on screen in the moment that we inserted, we need to check how the new action is connected to the Dataset.

Click “Edit” icon related to Dataset in Page’s detail

A popup is displayed with dataset information. Turn to “Data Binding” tab

Focus on “Control run” field and search by the “Button” control that trigger the insert into our DB and click “Add Relationship” button. This interaction will update the input data on page in real time.  

 Click “Preview” button again on Page

Input new data and click “Agregar” button. Every time that we click on the button, the Dataset will be executed and consequently, the information will be refreshed in the grid.

Recap

In the first part, we reinforced the preconditions to create pages with basic structure (dataset and controls) and then we learnt about how to create new action items and how they can be related to these Controls previously created. In the second part, we verified how the interaction is executed in the application environment and how this can be edited to adjust the interaction regarding what we display and what we insert in the DB.


  • No labels