PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
New WINDEV 26 feature!
  • In this lesson you will learn the following concepts
  • Overview of the example used in this part
  • Creating a window to list products
  • Creating the window
  • Creating controls
  • Window test
  • Creating a "Product form" window
  • Creating the window
  • Creating edit controls
  • Creating buttons
  • Improving the window interface
  • Displaying the form from the list of products
  • Modifying a product
  • Modifying the product image
  • Validate the product modifications
  • Checking the product modification
  • Creating a new product
  • Adding a Button control
  • Adding a new record in the data file
  • Testing the addition of a product
  • Viewing records
Lesson 4.1. Full application: Addition and modification windows
In this lesson you will learn the following concepts
  • Overview of the example project.
  • Creating a menu window to list products.
  • Creating a product form.
  • Adding and modifying products.
Lesson duration

Estimated time: 50 mn
Previous LessonTable of contentsNext Lesson
Overview of the example used in this part
In this part, we will create an application that manipulates data files in HFSQL Classic format.
This order management application will be used to:
  • View, enter and modify products,
  • Print reports,
  • Display statistics,
  • Manage use levels,
  • Send emails,
  • ...
The development of this application will also allow us to see how to deploy and distribute applications to end users.
You will see the main points for developing an application.
In the previous part of this tutorial we saw how to create a project and an analysis. We won't go back to it. We will work with a project that already contains an analysis and data files with data. The application analysis is an improved version of the analysis that was created in the previous part.
We are going to:
  • create different windows to list, add and modify products.
  • create different reports.
  • deploy the application.
  • use functionalities specific to the development of the application (Dashboard, Audits, SCM).
  • integrate functionalities (User Groupware, email management, etc.).
These operations will allow you to discover several aspects regarding the management of data files and will also allow you to use some WINDEV features­.

  • Open the "WD Full Application" project:
    1. Start WINDEV.
    2. Go to the WINDEV home page (Ctrl + <).
    3. On the home page, click "Tutorial", then in "Part 4 - Full application with data", double-click "Full application (Exercise)".

      Answers

      A corrected project is available. This project contains the different windows that will be created in this lesson. To open the corrected project, go to the home page and click "Tutorial", then in "Part 4 - Full application with data", double-click "Full application (Answers)".
Creating a window to list products
To create the window that will be used to list the products, we will create a blank window and then add all the controls: this will allow us to present the steps required to create this type of window.

Creating the window

  • To create a window to list products:
    1. Create a new blank window.
      • Click Create an element in the quick access buttons (or press Ctrl + N).
      • The element creation window appears: click "Window" then "Window".
      • In the wizard, click the "Based on a template" tab and choose "Use: WINTPL_Template". Validate.

        Note

        Window templates
        A window template is used to give a standard style to the different application windows.
        A window template contains all graphic elements common to all application windows. A window template can also contain code. In this case, this code will also be common to all application windows.
        For this example, we have created the WINTPL_Template window template. This template contains a logo that will be displayed in all windows:
        Window template
    2. The new window is displayed in the editor. The save window appears.
    3. In this window, specify the window title: "Menu".
      Save an element
    4. The window name (that will be used in the code) is created automatically from the window title. However, you can specify a name different from the window title.
    5. Validate.

Note

The name of this window is "Menu" because it will be the main window of our application. It will be used as a menu and will also display information.

Creating controls

We will use a Table control to create the list of products. This control will be related to the "Product" data file.

Note

What is a Table control?
Do not confuse "Table" and "Table control".
  • We refer to a Table for an SQL database.
  • A Table control is used to display the values of a data source in a GridView. In this case, the data can be entered directly or come from a data file (or table).
The Table control in WINDEV is used to display or modify data:
  • in memory: it is referred to as a memory Table control or Table control filled by programming.
  • coming from data files or queries: it is referred to as a browsing Table control.
  • coming from WLanguage variables: it is referred to as a Table control on source.
  • To create the Table control:
    1. On the "Creation" pane, in the "Data" group, expand "Table and List Box" and select "Table (Vertical)". The control will follow the movement of the mouse.
    2. Click inside the window: the Table control creation wizard starts.
    3. The Table control that is currently created must display the records found in the "Product" data file. In the wizard, select "Display the data found in a file or in an existing query".
      Table control creation wizard
      Go to the next step of the wizard ("Next").
    4. The next step of the wizard shows the different data files and queries in the current project. Expand "Analysis" if necessary and select the "Product" data file.
      Select data file
      Go to the next step.
    5. The wizard proposes the list of items found in the "Product" data file.
      By default, all items are checked in order to be displayed in the Table control. In our case, we will display all items EXCEPT the "ProductID" identifier that corresponds to the automatic identifier of the data file.
      Uncheck "ProductID".
      Table control creation wizard
      Go to the next step.
    6. Then, the wizard proposes to select the sort item. This item will be used to sort the data displayed in the Table control. The items proposed in the wizard correspond to the items defined as key items in the analysis. The products will be sorted according to their caption. Click on the "Caption" row.
      Table control creation wizard
      Go to the next step.
    7. The following steps correspond to additional parameters. Keep the default options until the end of the wizard and then finish the wizard.
    8. The Table control is automatically created in the window. The control is automatically positioned and enlarged in order to occupy the entire available space in the window.
      Window with the Table control in the editor
Let's take a look at the control we have just created: the data is already displayed in the control, even in the editor. This concept is called "Live data": the content of data files found on the development computer is used in the windows or reports handled in the editor. This feature is very useful to define the size of the controls in a window for example.

Window test

  • We will test the window we have just created.
    1. Click Test window in the quick access buttons.
    2. The window is automatically displayed with its data at runtime.
    3. You have the ability to scroll the products with the scrollbar (or with the keyboard arrows).
  • Let's imagine that we are the end user to see how the Table control works at runtime.
    Testing the window containing the Table control
Some remarks:
  • First of all, the Table control has the same aspect at runtime and in the editor: this is the WYSIWYG concept ("What You See Is What You Get").
  • Small logos appear at the top of the columns:
    • the double arrow indicates that the column can be sorted ("Reference" or "Caption" column for example).
      Double arrow indicating that the column can be sorted
      Click the "Caption" column twice for example: the data is displayed according to a different order. An arrow on the left of columns indicates that the column is sorted as well as the sort direction.
    • the magnifier indicates that a search can be performed in the column.
      Magnifier in a column of a Table control
      Click the magnifier of "Reference" column for example. An input area is displayed, allowing you to type the sought reference. Type "REF-010". The product corresponding to this reference is automatically displayed.
      Search in a column
  • A context menu is available for the Table control and for each one of its columns. This context menu can be displayed:
    • by right-clicking the column of the Table control.
    • by clicking the arrow in the upper-right corner of the column headers.
  • This context menu is used to export the content of the Table control in Excel format (or OpenOffice.org Calc), in Word format (or OpenOffice.org Writer), to print, etc, ...
    Control context menu
In just a few minutes, we have presented some features that are automatically included in the Table control. No programming is required to propose these features to your users. These features are called "AAF" (Automatic Application Features).

Note

Several controls propose default AAFs. If these features must not be proposed (for security or confidentiality reasons), they can be disabled in the editor or by programming.
Now that the list of products is displayed, you may want to modify a product. To do so, we are going to create a window used to display the product details.
  • Close the test window using the "X" at the upper-right corner of the screen. The WINDEV editor is redisplayed.
Creating a "Product form" window

Creating the window

We are going to create a window used to display the characteristics of the product selected in the Table control. This type of window is called a "Form" because it corresponds to a descriptive form of the desired element.
  • To create a window used to display the product details:
    1. Open the "WD Full Application" project if necessary.
    2. Create a new blank window.
      • Click Create an element in the quick access buttons.
      • The element creation window appears: click "Window" then "Window".
      • The window creation wizard starts.
      • In the "Based on a template" tab, choose "Use: WINTPL_Template" and validate the wizard.
    3. The save window is displayed. Type the window title: "Product form". The name ("WIN_Product_form") is automatically proposed.
    4. Validate the save window.

Creating edit controls

In our case, this "Form" window will display the content of the different items found in the "Product" data file.

  • To create the controls in the window:
    1. Open the "Analysis" pane if necessary: on the "Home" pane, in the "Environment" group, expand "Panes" and select "Analysis". The different data files described in the "WD Full Application" analysis appear in the pane.
    2. Click Arrow on the left of the "Product" data file: the items found in the data file are listed.
      Analysis pane
    3. With the mouse, select all items displayed in the pane (except for the "ProductID" item). You can select multiple elements by holding the Ctrl key down.
    4. Drag and Drop these items to the window we have just created.
      Drag and Drop of items
    5. Different controls are automatically created in the window. These controls are automatically bound to the corresponding item in the data file. To check this:
      • Select the "Reference" control for example.
      • Open the context menu (right click) and select "Description".
      • Go to the "Binding" tab in the description window:
        Edit control description
        This tab shows that the current edit control is bound to the "Reference" item in the "Product" data file.
    6. Close the description window.
    7. Save the window.
  • Reposition the controls in the window and resize the window in order to get the following interface:
    Window interface in the editor

Creating buttons

The "WIN_Product_form" window will be used to add a new product or to modify a product in the list.
We are going to add a validation button and a cancelation button.
  • To create the Button control to validate the data entered:
    1. On the "Creation" pane, in the "Usual controls" group, expand "Button" (click the arrow under Button control ).
    2. The list of preset buttons is displayed.
    3. Click "OK": the Button control shape appears under the mouse pointer.
    4. Then, click on the right of edit controls to create the Button control.
  • Add the Button control to cancel the input using the same principle.
    1. On the "Creation" pane, in the "Usual controls" group, expand "Button" (click the arrow under Button control ).
    2. In the list of preset buttons, click "Cancel": the Button control shape appears under the mouse pointer.
    3. Then click below the "OK" Button control to create the control.
      Interface in the editor

Improving the window interface

This window being quite simple, let's try to improve its interface. Several details can become very annoying for the user so let's try to sort them out right now.
Aligning controls
  • One of the first optimizations consists in aligning the controls and in giving them the same size:
    1. Select the "Caption" control then all edit controls found in the window (hold the Ctrl key down while clicking the different controls for example). The first selected control will be used as reference to set the size of the other controls.
    2. In the ribbon, display the "Alignment" pane of WINDEV. This pane contains all alignment options available for the controls.
      Alignment pane
    3. We will align the outside and inside borders of the controls. Click "Justify (Ins. and Out.)".

      Note

      If you don't know which alignment to choose, hover the different options proposed by the "Alignment" pane of WINDEV. When hovering an option with the mouse cursor, the controls selected in the window are automatically positioned and/or resized according to the hovered option.
      If the positioning suits you, all you have to do is click the option.
      If the positioning does not suit you, all you have to do is hover the alignment options: the controls move back to their initial position.
      Window size
Resizing the window
Once we have positioned all the controls in the window, we can define its final size. In our example, the window is still too big.
  • We can use the sizing handles, as we have done previously. However, WINDEV also offers the possibility to directly enter the window dimensions.
    1. Click on the window in the editor. The window is selected.
    2. In the message bar, enter the new window size.
      Interface in the editor
      In this example, the initial dimension is set to 609 x 270, we will enter 554 x 252.
    3. The window is automatically modified. To undo the changes and select another size, press Ctrl +Z.
Managing anchors
  • Let's see the visual aspect of our window:
    1. On the "Modification" pane, in the "Preview" group, click "Preview". This runtime mode is used to display the window interface. The different codes are not run.
    2. Enlarge the window via the sizing handles at the bottom of the window. The position of the controls does not change, so there is a large empty area in the window. Two methods can be used to solve this problem:
      • Prevent the window from being resized.
      • Define the anchors, i.e., the behavior of the controls when the window is resized. That's what we are going to do.
        Window preview
    3. Close the preview: click the "Close" button or the "X" icon at the upper-right corner of the window.

      Note

      How to manage anchors in a window?
      To manage anchors:
      1. In the editor, reduce the window to its minimum size. All outside window borders must be "stuck" to a control.
      2. Analyse the controls and consider : "How will the controls react when the window is enlarged?". Then, apply the corresponding anchor.
  • For this window, we are going to define the anchors together:
    1. The "OK" and "Cancel" Button control must be anchored to the right.
      • Select these two controls.
      • Open the context menu (right click) and select "Anchor".
      • In the window for defining anchors, select "Right".
        Set anchors
      • Validate.
      • Small red arrows appear in the editor, indicating that the controls are anchored to the right.
    2. The edit controls must be enlarged horizontally:
      • Select the 4 edit controls.
      • Open the context menu (right click) and select "Anchor".
      • In the window for defining anchors, select "Width" ( Horizontal anchors ).
      • Validate.
    3. We will test the behavior of this window in the preview:
      • On the "Modification" pane, in the "Preview" group, click "Preview".
      • Enlarge the window: the controls adapt to the horizontal enlargement.
      • We will now define the vertical anchors of the controls.
    4. The "Description" control can contain a larger or smaller product description. It is the largest control in the window: it must fill all the available space. Set a horizontal and vertical anchor ( Width and height anchors ).
    5. The "Price BT" control is automatically bordered by a red line: the window editor signals an anchoring problem. If the "Description" control stretches down, the "Price BT" control must also move down.
    6. Open the anchoring window of the "Price BT" control. The best anchoring option is automatically proposed: "Width and bottom" (a green checkmark is displayed). Select the proposed anchor and validate.
    7. We will test the behavior of this window in the preview:
      • On the "Modification" pane, in the "Preview" group, click "Preview".
      • Enlarge the window: the controls adapt to the vertical and horizontal enlargement.
        Window preview
    8. Close the window preview to go back to the editor.

Displaying the form from the list of products

Now, let's see how to display the form of the product selected in the list of products. The principle is very simple: the user will select the product in the Table control and display the product details via a Button control.
  • We are going to modify the "WIN_Menu" window to create a Button control:
    1. Position the cursor on the "Menu" window: click "WIN_Menu" in the open document tabs:
      Open document tabs
    2. Currently, the Table control occupies the entire window. Enlarge the window to the right via the sizing handles.
    3. Reduce the size of the Table control:
      • Hold the Shift key down.
      • Reduce the Table control via its sizing handles.

        Note

        The Shift key allows you to ignore the anchoring options when resizing the controls.
    4. We now have space on the right to create the Button control that will allow us to view the selected product in the Table control.
  • To create the Button control to view the product:
    1. On the "Creation" pane, in the "Usual controls" group, expand "Button" (click the arrow under New Button control ).
    2. Enter "Modify" in the search box at the top of the list of preset Button controls. Click "Modify button". The shape of the control appears under the mouse pointer. Then, click on the right of the Table control to create the Button control.
      Window with Button control in the editor
    3. Right-click the control that was just created. Select "Code" in the menu that appears.
    4. In the code window that appears, write the following WLanguage code in the "Click" event:
      WIN_Product_form.Open()

      Note

      The assisted code input (also called "completion") is going to help you: when you enter a dot after the window name, a drop-down list with the functions that can be used in the window will appear. Simply select the function you want with the keyboard or mouse.
    5. Let's take a look at this WLanguage code: <Window>.Open is used to open the "WIN_Product_form" window. This function was already presented in the first part of this tutorial.
    6. Save the changes by clicking Save element in the quick access buttons.
    7. Close the code window (click the "X" in the upper-right corner of the code editor).
We are now going to modify the "WIN_Product_form" window to display the selected product in the Table control.
  • Open the "WIN_Product_form" window in the editor: click the corresponding button in the open document tabs.
  • To display the product data:
    1. Open the events associated with the window:
      • Right-click outside the window.
      • Select "Code" in the context menu that appears.
      • The code editor appears. The WLanguage events associated with the window are displayed.
    2. Enter the following WLanguage code in the event "End of initialization of WIN_Product_form":
      // Assigns the content of items to the controls
      FileToScreen()

      FileToScreen is used to display in the controls the data found in the data file, for the current record. In our case, the current record will be the record selected in the Table control of "WIN_Menu" window.
    3. Close the code window.
    4. Save the window (Ctrl + S).
  • Open the "WIN_Menu" window in the editor: click the corresponding button in the open document tabs.
  • Test the window (click Test window in the quick access buttons).
    • In the list of products, click one of the products.
    • Click the "Modify" button.
    • The detailed product window is displayed.
  • Close the different test windows using the "X" at the upper-right corner of the windows.
Modifying a product
We will now modify the "WIN_Product_form" window to modify a product.
We are going to:
  • allow the user to modify the product image.
  • add Button controls to save or cancel changes made in the product form.

Modifying the product image

The user will be able to modify the product image in the Product form. To do so, we are going to create a "Modify" Button control below the product image. This control will open a file picker to select the desired image.

  • First of all, display (if necessary) the "WIN_Product_form" window in the editor: click the corresponding button in the open document tabs.
  • To create the Button control to modify the image:
    1. On the "Creation" pane, in the "Usual controls" group, expand "Button". Enter "Modify" in the search box at the top of the list of preset Button controls. Click "Modify button".
    2. The shape of the control appears under the mouse pointer. Click in the window, below the product image.
    3. If necessary, resize the Button control (using the handles) so that the control has the same width as the Image control.

      Note

      When resizing the control, an automatic magnetism effect simplifies the alignment of the Button control with the Image control.
      Interface of the form window in the editor
    4. Right-click on the Button control. Select "Code" in the menu that appears.
    5. In the code window that appears, write the following WLanguage code in the "Click" event:
      fImageSelect(
      Function wizard in the code editor
    6. The code editor proposes a code wizard.
      • Click "Wizard for function fImageSelect".
      • The code wizard starts.

        Note

        WINDEV proposes several code wizards that will generate the corresponding code lines via simple questions. Don't hesitate to use them, you will avoid syntax errors.
    7. Keep all the default options proposed by the wizard and validate. The corresponding WLanguage code is automatically entered.
      sFile is string
       
      // Opens the image picker
      sFile = fImageSelect("", "", "Select an image...")
    8. Add the following WLanguage code:
      // If a file was selected
      IF sFile <> "" THEN
      // Assigns the image to the Image control
      IMG_Visual = sFile
      END
      This WLanguage code is used to assign the selected file to the Image control in the window.
    9. Close the code editor (click the "X" icon at the upper-right corner of the code editor).
This feature will be checked when the management of modifications performed in the form is completed.

Validate the product modifications

Two Buttons controls have been created in the "WIN_Product_form" window:
  • an "OK" Button control to validate changes,
  • a "Cancel" Button control to manage the return to the product list.
We are now going to enter the WLanguage code required for them to operate.

  • First of all, display (if necessary) the "WIN_Product_form" window in the editor: click the corresponding button in the open document tabs.
  • We will now write the WLanguage code associated with the "OK" Button control.
    1. Right-click the Button control and select "Code" in the context menu.
    2. Write the following code in the "Click" WLanguage event:
      ScreenToFile()
      Product.Modify()
      Close()

      Let's take a look at this WLanguage code:
      • ScreenToFile initializes the items with the values in the bound controls, for the current record. This function is equivalent to the following code lines:
        Product.Reference = EDT_Reference
        Product.Caption = EDT_Caption
        Product.Description = EDT_Description
        ...

        Our window uses less than 10 controls and the benefit is already there; think of the windows that use a lot more controls: a single code line performs all the assignments!
      • <Data file>.Modify is used to update the file data for the current record.
    3. Save the changes by clicking Save element in the quick access buttons.
    4. Close the code window (click the "X" in the upper-right corner of the code editor).
  • The modifications performed in the "WIN_Product_form" window must be taken into account in the Table control used to list the products. To do this, we will simply modify the WLanguage code associated with the "Modify" Button control in "WIN_Menu".
    1. Open the "WIN_Menu" window in the editor: click the corresponding button in the button bar.
    2. Select the "Modify" Button control and open the code editor (F2).
    3. Modify the "Click" event as follows:
      // Opens the product form for the selected product
      WIN_Product_form.Open()
       
      // Updates the selected row
      TABLE_Product.Display(taCurrentSelection)
      Let's analyze this code:
      • <Table>.Display is used to update the Table control with the data modified in the product form.
      • The taCurrentSelection constant is used to specify that the Table control must be updated from the position of the selection bar.
    4. Save the changes by clicking Save element in the quick access buttons.
    5. Close the code window (click the "X" in the upper-right corner of the code editor).

Checking the product modification

  • To check the modification of a product:
    1. Test the project (click Test project in the quick access buttons).
      Quick access buttons
    2. WINDEV asks you to select the first project window. In our case, this window corresponds to "WIN_Menu". Select this window and validate.

      Note

      The first project window corresponds to the first window that will be opened when starting the application. The first project window can be defined:
      • during the project test.
      • when creating the executable.
      • in the "Project explorer" pane: select the desired window, open the context menu and select "First project window".
      When a first project window is defined, a small red 1 appears in front of the window name in the "Project explorer" pane.
    3. The project starts in test mode and the first window is displayed.
    4. Select a product from the product list (for example the first one) and click "Modify".
    5. The details of the selected product are displayed in the form window.
    6. Modify the price of 100.23 Dollars and enter 200.00 Dollars, then click "OK".
    7. When going back to the list of products, you will notice that the price was updated for this product.
    8. Display the product details again.
    9. Click the "Modify" button below the image. The image picker is displayed. Select an image and validate. The image is displayed in the form.
    10. Click the "Cancel" button. The image modification was ignored in the data file.
    11. Click the "X" to close the application.
Creating a new product
The principle for creating a product is as follows:
  • In the product list window, we will add a "New" Button control that will open the "Product form" window.
  • Then, we will modify the code of the "Product form" window to add a product to the Product data file.

Adding a Button control

  • To add a "New" Button control to "WIN_Menu":
    1. Open the "WIN_Menu" window in the editor: click the corresponding button in the open document tabs.
    2. On the "Creation" pane, in the "Usual controls" group, expand "Button" and select "New button".
    3. The shape of the control appears under the mouse pointer. Click in the window: the Button control is created.
    4. Position the Button control above the "Modify" Button control (if necessary, reposition the "Modify" Button control).
      Window interface in the editor
    5. Modify the WLanguage code of this control:
      • Right-click the "New" button and select "Code" in the context menu.
      • Write the following code in the "Click" WLanguage event:
        Product.Reset()
        WIN_Product_form.Open()
        TABLE_Product.Display(taCurrentRecord)
        Let's analyze this code:
        • Reset initializes the item variables in the "Product" data file with the default values to add a new record.
        • Open is used to open the product form to enter the new record.
        • Display is used to re-display the Table control. The taCurrentRecord constant is used in this code: the Table control is re-displayed from the current record.
    6. Save the changes by clicking Save an element in the quick access buttons.
    7. Close the code window (click the "X" in the upper-right corner of the code editor).

Adding a new record in the data file

  • We will now modify the product form window to add a new record.
    1. Open the "WIN_Product_form" window in the editor.
    2. We will modify the WLanguage code associated with the "OK" Button control:
      • Right-click "OK" and select "Code" in the context menu.
      • In the "Click" event, replace the existing WLanguage code with the following:
        ScreenToFile()
        IF Product..NewRecord THEN
        Product.Add()
        ELSE
        Product.Modify()
        END
        Close()
        Let's take a look at this WLanguage code:
        • The NewRecord property indicates whether the current record should be created.
        • If <Data file>.Reset has been called previously, the property returns True (click on "New") and the record must be created by Add.
        • Otherwise, the current record already exists and must be modified by <Data file>.Modify.
        • <Data file>.Add adds the record to the data file. This function takes the values in memory and writes the content of the file items to the data file. The indexes are immediately and automatically updated. In this case, it is the "Product" data file that is updated.

          Note

          The test code of the new record can be replaced by <Data file>.Save. This function checks whether the record is already in the data file, and allows you to add it or modify it if necessary. The code becomes:
          ScreenToFile()
          Product.Save()
          Close()
    3. Save the changes by clicking Save an element in the quick access buttons.
    4. Close the code window (click the "X" in the upper-right corner of the code editor).

Testing the addition of a product

  • To test the addition of a product:
    1. Test the project (click Test project in the quick access buttons).
    2. In the list of products, click the "New" button.
    3. Enter a new product with the following characteristics:
      • Reference: REF-337
      • Caption: Surf WD
      • Description: Surf with WINDEV colors
      • Price: 150
        Test of the window for adding a product
    4. Validate. The new product is displayed in the list of products.
    5. Click the "New" button again.
    6. Enter a new product with the following characteristics:
      • Reference: REF-337
      • Caption: Surf WB
      • Description: Surf with WEBDEV colors
      • Price: 150
    7. Validate. A specific window is displayed:
      Management of duplicates
      This window informs the user that a duplicate was found: the reference (that is a unique key) is identical for two products. This window is used to modify the reference value: type "REF-338" for example.
      This standard window manages HFSQL errors automatically.

Note

Several errors may occur when adding or modifying a record: duplicate errors, integrity errors, password errors, etc.
WINDEV proposes several modes for managing these errors:
  • the automatic mode: for each error that occurred when managing database records, a specific page is displayed to the user. This window allows the user to modify his data directly.
  • the advanced programmed mode: a procedure or a custom window for error management is called whenever an error occurs when managing the database records.
The example "WD Detecting HFSQL Errors", supplied with WINDEV, allows you to check these different modes for error management. This example can be opened via the WINDEV home page (Ctrl + <), "Open an example" option.

Viewing records

The new added records can be immediately viewed in the Table control of the "WIN_Menu" window.
However, in some cases (when running tests for example), you may want to see the content of the data file directly.
WINDEV proposes a tool used to view the content of data files while the application is being developed (when the viewing windows have not been created yet).
This tool is WDMAP. We are going to use it to see the content of the Product data file.
  • To start WDMAP:
    1. On the "Tools" pane, in the "Database" group, click "WDMap".
    2. Select the "Product" data file. The data file content is displayed.
      WDMAP
    3. Sort the elements by reference (click the header of the "Reference" column) and the two added records appear.
Previous LessonTable of contentsNext Lesson
Minimum version required
  • Version 26
Comments
Click [Add] to post a comment