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
  • Simple data binding
  • Complex data binding
  • Error code (syntax 2 and 3)
  • Data-bound Table control file
  • Limitations and special cases
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
Gets, modifies or restores the data binding to a control or group of controls.
ControlAlias does not change the contents of the control, it only changes the data binding. To update the controls with the values of the new data binding, use FileToScreen, TableDisplay, etc.
Advertencia
A partir de la versión 17, FieldAlias se conserva por motivos de compatibilidad. Esta función ha sido reemplazada por ControlAlias.
function is retained for compatibility: this function does not manage data binding.. It is recommended to use the DataBinding property.
Ejemplo
// Get the data binding of "EDT_CustomerName"
ResDataBinding = ControlAlias(EDT_CustomerName)
Sintaxis

Getting the data binding of a control Ocultar los detalles

<Result> = ControlAlias(<Control used>)
<Result>: Character string
Data binding to a specified control. The binding has the following syntax:
"<Base file>.<Base item>[:<Binding>[:<Binding>]]"
where <Binding> corresponds to <Related file>.<Key>:<Bound item>[<Index>]
<Control used>: Control name
Name of the control to be used.

Modifying the data binding of a control or group of controls Ocultar los detalles

<Result> = ControlAlias(<Element used> , <New binding>)
<Result>: Integer
  • 0 if the modification was performed,
  • an error code (value greater than 0) otherwise.
<Element used>: Control name, control group name or window name
Name of the control, group of controls, Tab control, Table control based on a data file, Table columns or window to be used. The data bindings of all the controls in the group, Tab control, Table control based on a data file, Table columns or window will be modified.
WEBDEV - Código Servidor Name of the control, group of controls, Tab control, Table control based on a data file, Table columns or page to be used. The data bindings of all the controls in the group, Tab control, Table control based on a data file, Table columns or page will be modified.
<New binding>: Character string
New data binding. If this parameter corresponds to an empty string (""), the data binding is canceled. This new binding may correspond to:
  • a complex data binding:
    "<Fichier de base>.<Rubrique de base>[:<Liaison>[:<Liaison>]]"
    <Binding> corresponds to:
    <Related file>.<Key>:<Bound item>[<Index>]
  • a simple data binding:
    "<New base file> = <Current base file>

Restoring the initial data binding of a control or group of controls Ocultar los detalles

<Result> = ControlAlias(<Element used> , <caRestore>)
<Result>: Integer
  • 0 if the modification was performed,
  • an error code (value greater than 0) otherwise.
<Element used>: Control name, control group name or window name
Name of the control, group of controls, Tab control, Table control based on a data file, Table columns or window to be used. The data bindings of all the controls in the group, Tab control, Table control based on a data file, Table columns or window will be restored.
WEBDEV - Código Servidor Name of the control, group of controls, Tab control, Table control based on a data file, Table columns or page to be used. The data bindings of all the controls in the group, Tab control, Table control based on a data file, Table columns or page will be restored.
<caRestore>: Constant
caRestaure Constant used to restore the original data binding for a field or set of fields.
Observaciones

Simple data binding

A simple binding corresponds to the following syntax: "<New base file> = <Current base file>".
In this case, only the controls bound to the items of the <Current base file> will be modified and bound to the <New base file>.
For example, the line of code:
ControlAlias(WIN_Window, "CUSTOMER2001=CUSTOMER")
will rename the CUSTOMER file as CUSTOMER2001 for the controls whose base file is "CUSTOMER". The controls with a binding to another data file will not be modified.

Complex data binding

A complex binding corresponds to the following syntax:
"<Base file>.<Base item>[:<Binding>[:<Binding>]]"
where <Binding> corresponds to:
<Related file>.<Key>:<Bound item>[<Index>]
This description corresponds to:

Error code (syntax 2 and 3)

If an error occurs, ControlAlias displays a message and returns the message error code:
  • 1: Syntax error
  • 2: Insufficient memory
  • 3: Uninitialized HFSQL data files
  • 4: File not found
  • 5: Item or file not found
  • 6: Values of keys not found in the link
  • 7: File blocked or link not found
  • 10: File name too long
  • 11: Section name too long
  • 12: Too many links described
  • 13: Index allowed only on last item
  • 14: Index too large
  • 15: Incorrect index value
  • 16: Invalid field type with function ControlAlias
  • 17: Description string too long
  • 18: Prohibited links on a file table
If an error occurs when ControlAlias is called on a control, the previous binding does not change. If ControlAlias is assigned to a group of controls, the control on which the error occurs and the following controls are not modified.

Data-bound Table control file

  • On a Table control based on a data file, only the bindings to the following elements are allowed:
    • <Base file>
    • <Base file>.<Base item>
  • <Base item> must correspond to a key item.
  • The file is replaced for all the table columns.
  • <Base item> applies to the table only.
  • ControlAlias only changes the binding of the internal file to a Table control based on a data file.

Limitations and special cases

  • ControlAlias has no effect on Table controls (and columns) with in-memory data source, buttons and ActiveX controls.
  • It may happen that no browse is currently performed on the HyperFileSQL data files when an alias or a search key is modified. Once the data bindings have been changed by ControlAlias, it is recommended to call:
Componente: wd300obj.dll
}}
Versión mínima requerida
  • Versión 9
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