AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Controles, páginas y ventanas / Funciones de controles
  • Focus gain
  • ScreenFirst, SetFocus and SetFocusAndReturnToUserInput
  • Error
  • SetFocusAndReturnToUserInput on the last selected control
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Stops the current process, sets the focus to the specified control, window or page, and allows the user to enter data.
WEBDEV - Código Navegador 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.
Note: This function is equivalent to SetFocusAndReturnToUserInput.
Ejemplo
// 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
Sintaxis
SetFocusAndReturnToUserInput([<Element to handle>])
<Element to handle>: 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, <Element to handle> must be in the following format: <Window name>.<Control name>.
WEBDEV - Código Navegador Name of the control or page that will gain focus (see Notes). If this parameter is not specified, the last current control gains focus.
Observaciones

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 (Button, List Box, Radio Button controls, 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 defines which control will receive input focus (when the current code stops and input focus is set back to a control).
  • SetFocus stops the current process, defines which control will receive input focus and resumes the current process.

Error

A WLanguage error occurs if <Element to handle> does not correspond to a control in the current window or page.
WEBDEV - Código NavegadorAjax

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 an Edit control, is used to force the input in the selected control if the data entered and the expected data do not match.
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.
  • "Clickable area" Image 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 verification is performed: Javascript errors may be displayed if the focus is given to a field that doesn't exist.
Reminder The alias of a field corresponds to the name of this field in the HTML page. To find out this alias:
  • in the code editor, press Shift + F1.
  • use the Alias property.
Clasificación Lógica de negocio / UI: Código UI
Componente: wd300obj.dll
Versión mínima requerida
  • Versión 27
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 28/03/2025

Señalar un error o enviar una sugerencia | Ayuda local