PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Focusing
  • ScreenFirst, SetFocus and ReturnToCapture
  • Error
  • ReturnToCapture on the last selected control
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
Stops the current process and forces the input in the specified control, window or page.
WEBDEV - Browser code ReturnToCapture can be used in a browser event (onchange, onclick, ...) but it cannot be used in a local browser procedure or in a global browser procedure.
Example
// Si l'utilisateur n'a rien saisi dans le champ
IF SAI_Saisie1 = "" THEN
// On affiche un message et on remet l'utilisateur en saisie sur le champ
Error("Saisissez une valeur")
ReturnToCapture(SAI_Saisie1)
END
Syntax
ReturnToCapture([<Name of the control, window or page>])
<Name of the control, window or page>: control name, window name or optional page name
Name of control, column or window that will take focus (see Notes). If this parameter is not specified, the current control takes focus.
To indicate an control belonging to an open window different from the current one, <Name of control, window or page> must be of the form <Window name>.<Name of control>.
WEBDEV - Browser code Name of control or page that will take focus (see Notes). If this parameter is not specified, the last current control takes focus.
Remarks

Focusing

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 ReturnToCapture

These functions have a different behavior:
  • ReturnToCapture 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

ReturnToCapture on the last selected control

ReturnToCapture 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.
  • by programming, use the Alias property.
Business / UI classification: UI Code
Component: wd260obj.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Exemplo Fechar Window
//Global
gn_fechando_manual is int=0

//Closing
IF gn_fechando_manual=0 THEN
IF YesNo("Deseja Fechar Nota Fiscal") THEN
ELSE
ReturnToCapture(EDT_cliente_cnpj_cpf_codigo)
END
END


//Botao Fechar
gn_fechando_manual=1
Close(WIN_GeraNotaFiscal)

//Blog com Video e Exemplo
http://windevdesenvolvimento.blogspot.com.br/2016/03/windev21-curso-233-window-fechar-ou-nao.html
De matos AMARILDO
17 Mar. 2016