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 2 Next »

Overview

Previous document go deep on Wayfast Anatomy for Skin & Layout. In this document, we will explain how the Pages that we used on the Application are defined by Controls and how these controls interact with the Project DB depending on the variable conditions that Wayfast allow us to develop.  

How the Pages interact with Project DB?

 

Wayfast Project as a web application is built by multiple Pages. Under each Page, we assign different Controls. These Controls are the ones that we use for user’s interaction.

  

Enter to the Project and you will find all the Pages listed

 

Click on any of the Page associated

 

Initially all the Project’s information come from the DB through Stored Procedures (SP) or Views and it’s available to be displayed by Controls or Grids. These controls that every page has linked will interact directly with our Project DB. But this is not the only relationship that we can establish with the DB information, we can apply logic through Actions (as example using Buttons) that allow us to generate changes in our DB like Insert, Update, Delete but it can be as complex as the requirement needs.

In this section, we will explain how we can make this interaction possible in Wayfast application.

How to create a Stored Procedure in DB and link to Dataset?

A Stored Procedure is an object that we can define and then relate it to the Project. This needs to be created in DB using SQL.

First connect to the DB created for the Project and click “New Query”. Then create the Stored Procedure with the following syntax:

 

This is a simple statement where we indicate 3 input parameters “Ingreso”, “Nombre” and “Puesto”. In next steps, these parameters are going to be used in Wayfast to connect with Controls.  Notice that the executed SP has now 1 row affected and this is the information that are going to use in Page for the Application.

Return to the Wayfast application. Inside the Project’s Requirement, click “End Task”

Click “Synchronize” button to update the new SP object created in DB and generate it into the Wayfast model object.

Now that we created the Stored Procedure and it’s synchronized, we can continue creating a Dataset and establish a relationship between both objects.

How to create a DataSet in Wayfast?

Dataset Definition

On Page detail, click “New Dataset” button

 

A popup is displayed and we need to complete the mandatory fields.

Execution Type field is an important feature since this will define what type of performance has the cursor (dataset).

  • Pre: This type allows to execute the dataset while the page is loaded which is helpful to get the information available from the very beginning.

  • Post: This type allows to bring the Information requested in the moment that we trigger any action and depending the size of the response, it could take some time after the information is loaded on the screen

  • Ondemand: TBD

NOTE: As Precondition, it’s important to build a Stored Procedure directly from DB

 

Turn to “Data Binding” tab in “New Dataset” popup. In this section, the developer can select the Stored Procedure previously created for the information available in DB.

NOTE: If click “Add relationship” button, we can link the Dataset with Controls inside the “Data Binding”

Click “Accept” button.

 

Now that we have the information available from DB and connected to the Project, we need to make it visible in the Application’s UI.

How to create and manage Controls to see the Dataset in the Application?

Controls Definition

Controls will act as a bridge between the Dataset and the information from DB. To create a Control, first we need to select any option from “Controls” dropdown. In this example, select “Grid Column” control.

 

Automatically “New” button will be displayed beside the dropdown selection in “Controls” section. Click this button and a popup will be displayed to fill the information related to new control.

 

It’s important to complete the “Field” value with the same parameter created in Stored Procedure. In this example, we are going to use “Ingreso” at “Field” that matches with the SP previously added to DB.

 

After completing this information, turn to “Data Binding” tab in the same “Grid Column” popup. Select the “Dataset” with the one created in the previous steps. Remember that Dataset is connected to the Stored Procedure.

Finally if click on “Layout” tab, we can set the place where we can put the information available in DB from “Grid Column” controls at the Page associated. Click “Accept” to confirm the new control added

A new row is added in Controls table. If click “Preview” button at the top right corner, we can verify that the information from DB (Dataset linked to SP) is displayed in Page under the Grid Column control

Preview from page is an easy way to check how the interface is representing the information available in our Project DB.

NOTE: There are a lot of options to represent the data in UI. Wayfast allow us to include input fields by forms that can be stored in DB.

Recap

In the first part, we learnt about how to Pages interact with DB by creating Datasets. Then we made a first approach using SQL to create an easy Stored Procedure that was linked to Dataset. In the second part, we explained how the Controls under pages can display in many different ways the information available on DB, assigning the place and source. In the next tutorial, we will learn how to connect the Controls with Actions that user will have in pages to interact with the Application.

  • No labels