ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / Developing an application or website / Controls, windows and pages / Page
  • Overview
  • How to?
  • The available WLanguage functions
  • Managing a dialog via popups
  • Managing a dialog via cells
  • Managing a dialog via pages
  • Managing a dialog via YesNo and OKCancel
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Communicating with the Web user
Overview
With the new Web technologies, the sites can look more like Windows applications and they can display dialog boxes.
In order for the Web user to easily identify the active page, the system for graying the pages is automatically used. The inactive page is grayed, so the active pages can be easily viewed by the Web user.
For example:
The dialog with the Internet user can be managed:
How to?

The available WLanguage functions

WEBDEV proposes several functions allowing you to communicate with the Web user:
CellCloseDialogHides a Cell control previously displayed in the page via CellDisplayDialog.
CellDisplayDialogDisplays a Cell control in a page with a DDW effect (Dim Disabled Windows). This function is used to easily simulate a dialog box in browser code, by using a Cell control in a page.
OKCancelDisplays a message in a standard dialog box that proposes "OK" and "Cancel" and returns the user's choice.
PageCloseDialogCloses the current page. This page was opened by PageDisplayDialog. A return value can be returned to the calling page.
PageDisplayDialogDisplays a page in modal mode. This function is used to establish a dialog with the user. The page is displayed in the foreground while the opening page is displayed in the background, grayed by the DDW mechanism.
PopupCloseHides a popup displayed in the page via PopupDisplay.
PopupDisplayDisplays a popup in a page with a DDW effect (Dim Disabled Windows).
YesNoDisplays a message in a standard dialog box that proposes "Yes" and "No" and returns the user's choice.
All these functions are used to communicate with the user and take into account the DDW parameters defined by the following functions:
PageEnableDDWEnables or disables the DDW (Dim Disabled Window) when displaying a modal page (the pages used to communicate with the user for example).
PageRateDDWDefines and returns the rate of gray used by DDW.
WEBDEV - Server codeWEBDEV - Browser codeWindows

Managing a dialog via popups

Let's see an example that is used to manage a dialog via a popup found in a page.
To manage a dialog via a popup, you must:
  1. Create a popup in the page that must display the dialog: on the "Creation" tab, in the "Containers" group, click "Popup". This popup will be used to communicate with the user. This popup must contain:
    • a static control used to display the text of dialog.
    • a button used to validate the dialog box.
      The "Style" tab of the popup description window is used to define all the desired style options (popup background image, etc.). For more details, see Popup control.
  2. The button for closing the dialog (found in the popup) contains the following code:
    PopupClose()

    PopupClose closes the popup.
  3. To communicate with the Web user from the page (from a button of the page for example), all you have to do is use PopupDisplay and specify the name of the popup that will be used for the dialog. This popup is associated with the page or with the page template used by the page.
WEBDEV - Browser codeWindowsLinux

Managing a dialog via cells

Let's see an example that is used to manage a dialog via a cell found in a page. This solution is recommended if a single page of the site must propose a dialog with the Web user.
To manage a dialog with a cell:
  1. Create a cell in the page that must display the dialog. This cell will be used to communicate with the user. This cell must contain:
    • a static control used to display the text of dialog.
    • a button used to validate the dialog box.
  2. The cell (as well as its controls) is invisible. It must also be stackable.
    You have the ability to add controls into the cell if necessary (image, ...).
    Remark: To avoid displaying unnecessary scrollbars in the browser, check the "Force position at the top left of the page when loading" option ("Advanced" tab of the Cell control description window). This option is used to automatically position the Cell control at position (0,0) when loading the page.
  3. The button for closing the dialog (found in the cell) contains the following code:
    CelluleFermeDialogue(CELL_MaCellule)

    CellCloseDialog is used to make the previously displayed cell invisible.
  4. To communicate with the Web user from the page (from a button of the page for example), all you have to do is use CellDisplayDialog and specify the name of the cell that will be used for the dialog.
WEBDEV - Server codeWindows

Managing a dialog via pages

Let's see an example that is used to manage a dialog via a site page. This solution is recommended if several pages of the site must propose a dialog with the Web user. The dialog page can be opened from any page of the site.
To manage a dialog via a page:
  1. Create a page (named PAGE_Info for example). This page will be used to communicate with the user. This page must contain:
    • a cell that defines the dialog box.
    • a static control used to display the text. This static control is contained in the cell.
    • a button used to validate the dialog box. This button is contained in the cell.
      You have the ability to add controls into the cell if necessary (images, ...).
      We advise you to center the page in the browser.
  2. The button for closing the dialog (found in the page) contains the following code:
    PageCloseDialog()

    PageCloseDialog is used to return a value to the page that opened the dialog.
  3. To call the dialog page from another page, use PageDisplayDialog and specify the name of the page to open as well as the parameters to pass if necessary. These parameters can be used to dynamically fill the text displayed in the static for example.
WEBDEV - Server codeWEBDEV - Browser codeWindows

Managing a dialog via YesNo and OKCancel

YesNo and OKCancel can also be used to manage a simple dialog with the Web user. These functions are used to ask a question to the Web user who will answer by either "Yes" or "No", or "OK" or "Cancel".
To manage a dialog with the YesNo and OKCancel functions:
1. Include specific internal pages in your project. These internal pages contain the dialog box:
To include these pages:
  • Click in the quick access buttons.
  • The new element window appears: click "Page" then "Page".
  • The page creation wizard starts.
  • In the wizard, click "Internal page".
  • Select "OK/Cancel" or "Yes/No". These pages must be saved in your project with the name proposed by default.
2. Use YesNo and OKCancel in the code of the application.
Minimum version required
  • Version 12
Comments
Click [Add] to post a comment

Last update: 05/18/2024

Send a report | Local help