PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • Principle
  • Implementation
  • Example
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Validating a page from a control that has no action on the server (list box, combo box, ...)
Overview
By default, the validation of a page must be performed by a "Send the values of controls to the server (submit)" button.
To validate a page when selecting an element in a List Box, Combo Box, Check Box or Radio Button control, use PageSubmit.
Principle
PageSubmit is used to validate a page via a visible or hidden button whose server click code is run. When using PageSubmit, the following processes are run:
  • Sending the data to the server.
  • Server click code of button.
Implementation
To validate a page from a control without action (list box, combo box, check box control, ...):
  1. Create a new button in the page: this dynamic button can have any type, it can be visible or not. This button is used to start the validation of the page. Only the server click code of this button will be run.
  2. In the modification code of the control without action, use PageSubmit and specify:
    • the page to validate if necessary.
    • the name of the button used for the validation (created in step 1).
    • the frame containing the result of the button action (for a frameset for example).
Example
Selecting an element in the List Box control named LIST_CONTINENT is used to display the selected element in a dialog box.
The code of the List Box control is as follows:
// -- Initialization of LIST_CONTINENT
ListAdd(LIST_CONTINENT, "Africa" + CR + "America" + CR + "Asia" + CR + "Europe" + CR + ...
"Oceania")

// -- Modification and exit (onchange) from LIST_CONTINENT
// Validates the page and starts running the server click code of BTN_Button1
PageSubmit("", BTN_Button1)
Code of BTN_Button1:
// -- Click on BTN_Bouton1 button (server code)
Info("Selection: " + LIST_CONTINENT[LIST_CONTINENT])
Minimum required version
  • Version 9
Comments
Click [Add] to post a comment