ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage properties / Various properties
  • Status (Status editor): Visible or invisible field/block
  • State of a group of controls
  • State of a column in a Table control
  • Limitations
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
The State property gets and sets the state:
  • of a control in a window, page or report.
  • of a block in a report,
  • of a window.
WEBDEV - Server codeWEBDEV - Browser code In a page, the State property is used to get and change the state:
  • of a control or group of controls,
  • of a "container" control (Tab control, Internal Page, Layout, etc.),
  • of a group of controls.
WEBDEV - Server code In a report, the State property is used to get and change the visibility of a control or block. This property is kept for compatibility with WINDEV 5.5 and WEBDEV 1.5. To show or hide a control or a block in a report, use the Visible property.
Example
// The STC_Static1 control becomes active
STC_Static1.State = Active
WEBDEV - Server codePHPAjax
// The EDT_Edit1 control becomes active
EDT_Edit1.State = Active
// Modify the content of the Combo Box if it is active
IF COMBO_Combo1.State = Active THEN
	COMBO_Combo1 = "<Enter HERE>"
	SetFocusAndReturnToUserInput(COMBO_Combo1)
END
Syntax
WEBDEV - Server codeWEBDEV - Browser codePHPAjax

Finding out the state of a control in a page Hide the details

<Current state> = <Control name>.State
<Current state>: Integer constant
Current status of object.
Active or VisibleThe control is active and editable.
GrayedGrayed-out control.
InactiveEdit control visible but read-only (applies to the edit controls only).
InvisibleInvisible (it is recommended to use the Visible property).
WEBDEV - Browser code This constant is not available. Use the Visible property.
Please note: on List and Combo Box controls, the 'Inactive' state behaves like the 'grayed' state.
<Control name>: Character string
Name of control or group of controls.
WEBDEV - Server codeWEBDEV - Browser codePHPAjax

Changing the state of a control in a page Hide the details

<Control name>.State = <New state>
<Control name>: Character string
Name of control or group of controls.
<New state>: Integer constant
New object state.
Active or VisibleThe control is active and editable.
GrayedGrayed-out control.
InactiveEdit control visible but read-only (applies to the edit controls only).
InvisibleInvisible (it is recommended to use the Visible property).
WEBDEV - Browser code This constant is not available. Use the Visible property.
Remarks:
  • In List Box and Combo Box controls, 'Disabled' is equivalent to 'Grayed'.
  • The change of state may result in slightly different effects depending on the browser used. For example, the grayed state will be more noticeable in Internet Explorer and Chrome than in Firefox.
WEBDEV - Server code

Getting the state of an element in a report Hide the details

<Current state> = <Element name>.State
<Current state>: Integer constant
Current status of object.
ActiveThe control or block is visible.
InvisibleInvisible control or block (it is recommended to use the Visible property).
<Element name>: Character string
Name of report control or block.
WEBDEV - Server code

Changing the state of an element in a report Hide the details

<Element name>.State = <New state>
<Element name>: Character string
Name of report control or block.
<New state>: Integer constant
New object state.
ActiveThe control or block is visible.
InvisibleInvisible control or block (it is recommended to use the Visible property).
Remarks

Status (Status editor): Visible or invisible field/block

In a report, the only possible state for a control or a block is visible or invisible. To set the visibility of a control, it is recommended to use the Visible property. This property optimizes the management of control visibility.

State of a group of controls

  • Find out the status of a group of fields: the status returned corresponds to the status of the first field in the group.
  • Modify the status of a group of fields: all the fields in the group are modified to match the new status.

State of a column in a Table control

If the State property is applied to a column of a Table control, the state of the entire column is changed (and not only the state of the cell).
Please note: the State property can only be used to restrict the column status defined in the description window.. For example, if the column is read-only, no column cell can become editable.

Limitations

WEBDEV - Server code The State property has no effect on reports created with the report editor.
WEBDEV - Browser code The State property has no effect on the following elements:
  • Table,
  • TreeView Table,
  • Looper
  • Linear Looper
  • Table column.
Minimum version required
  • Version 9
This page is also available for…
Comments
PROCEDURE evento_state_fields(myNameWindow,myNameControl)
// ReadOnlyNoSelection // OutsideScreen // Grayed // DisplayOnly // Active

Indirection is string = myNameWindow +"."+ myNameControl

SWITCH {Indirection}..State
CASE Active
RESULT "1-Active"
CASE ReadOnlyNoSelection
RESULT "2-ReadOnly"
CASE Grayed
RESULT "3-Grayed"
CASE DisplayOnly
RESULT "4-DisplayOnly"
OTHER CASE
RESULT "5-Other"
END
Boller
02 Sep. 2023

Last update: 01/30/2025

Send a report | Local help