PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
New WINDEV, WEBDEV and WINDEV Mobile 27 feature!
  • Focus gain
  • ScreenFirst, SetFocus and SetFocusAndReturnToUserInput
  • Error
  • SetFocusAndReturnToUserInput on the last selected control
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
Stops the current process, sets the focus to the specified control, window or page, and allows the user to enter data.
WEBDEV - Browser code SetFocusAndReturnToUserInput can be used in a browser event (onchange, onclick, etc.), but it cannot be used in a local procedure or a global browser procedure.
Versions 27 and later
Remark: This function replaces ReturnToCapture.
New in version 27
Remark: This function replaces ReturnToCapture.
Remark: This function replaces ReturnToCapture.
Example
// If no value was entered by the user in the control
IF EDT_Edit1 = "" THEN
// Display a message and position the user in edit on the control
Error("Enter a value")
SetFocusAndReturnToUserInput(EDT_Edit1)
END
Syntax
SetFocusAndReturnToUserInput([<Control, window or page name>])
<Control, window or page name>: Optional control, window or page name
Name of control, column or window that will gain focus (see Notes). If this parameter is not specified, the current control gains focus.
To specify a control that belongs to a window other than the current window, <Control, window or page name> must be in the following format: <Window name>.<Control name>.
WEBDEV - Browser code Name of the control or page that will gain focus (see Notes). If this parameter is not specified, the last current control gains focus.
Remarks

Focus gain

Taking "focus" is represented in different ways:
  • Blinking cursor (or "Caret") for the edit controls.
  • Dotted rectangle for the other types of controls (Buttons, List Boxes, Radio Buttons, etc.).

ScreenFirst, SetFocus and SetFocusAndReturnToUserInput

These functions have a different behavior:
  • SetFocusAndReturnToUserInput stops the current process to force the input in the specified control.
  • ScreenFirst describes the next control that will be in edit (when the current code stops and when the input resumes).
  • SetFocus stops the current process, describes the next control that will be in edit and resumes the current process.

Error

A WLanguage error occurs if <Object name> does not correspond to a control found in the current window or page.
WEBDEV - Browser codeAjax

SetFocusAndReturnToUserInput on the last selected control

SetFocusAndReturnToUserInput used without parameters sets the focus on the current control. This function, called in the exit code of edit control, is used to force the input in the selected control if the information typed does not correspond to the expected information.
The control must be one of the following types of controls:
  • Edit control.
  • Check Box control.
  • Radio Button control.
  • List Box control.
  • Combo Box control.
  • Click Area control.
If the name of the control corresponds to a string that is built, the alias of the control must be used ("ControlAlias"+Num for example). In this case, no check is performed: JavaScript errors may occur if focus is given to a control that does not exist.
Reminder: The alias of a control corresponds to the name of this control in the HTML page. To find out this alias:
  • in the code editor, press Shift + F1.
  • through programming, use the Alias property.
Business / UI classification: UI Code
Component: wd270obj.dll
Minimum version required
  • Version 27
This page is also available for…
Comments
Click [Add] to post a comment