Home Search

DriveWorks Pro 22
Default Value

Send Feedback

Default Value

The Default Value property sets an initial value to the control while allowing a new value to be entered or selected by the user.

Property Type:  Static

Default Value: (Check Box) False

Default Value: (Combo Box, List Box, Text Box, Option Group) No default value is applied to this property

Default Value: (Numeric Text Box, Slider, Spin Button) 0

Hierarchical Reference: ControlName.DefaultValue

Behavior

The Default Value property only affects the value of the control when a rule applied to it recalculates while in a running State.

Any other interaction with the control, that affects its value, will override the Default value.

A rule applied to this property is not recalculated when starting a new specification or when transitioning to another State.

To Change the Default Value

Ensure the property is a static property (It will display the gray orb alongside the property name)

  1. Click in the property for the control to be changed.
  2. Enter the required value directly in the property field.
If the value of a Control is set in Specification Test Mode, this does not become the Default Value this is only the Display Value.

Examples

Default Value Property Value (static)Result
True (Check Box)Will set the value of the control to be True until changed by the user.
Blue (Combo Box, List Box, Text Box, Option Group)Will set the value of the control to be Blue until changed by the user.
The value being returned by the Default Value rule must be selectable from the listed Items.
200 (Numeric Text Box, Slider, Spin Button)Will set the value of the control to be 200 until changed by the user.

A rule can also be built for this property by changing the type to dynamic.

See How To: Change A Static Property To A Dynamic Property.

Default Value Property Value (Dynamic)Result
IF(LengthReturn<500, True, False) (Check Box)

Will set the value of the control to be True when the control Length is less than 500.

IF(CheckBoxReturn=True, Blue, Red) (Combo Box, List Box, Text Box, Option Group)

Will set the value of the control to be Blue when the control Checkbox is True.

IF(CheckBoxReturn=True, 500, 100) (Numeric Text Box, Slider, Spin Button)

Will set the value of the control to be 500 when the control CheckBox is True.

Any time a Control is interacted with or the result of the Rule changes it will trigger an update to the control, overwriting the Default Value.

Using the Default Value property, controls can reference each other. The circular reference created is handled by DriveWorks.

Default Value Property Value (Dynamic)Result
On a control named NumericTextBox

SliderReturn

Will set the Default Value to be the result of the control NumericTextBox

On a control named Slider

NumericTextBoxReturn

Will set the Default Value to be the result of the control Slider

If the control is required to have a value set that cannot be changed consider the Override Rule property.

DriveWorks Tech Tips Portal

Default Value Rule

Default Value and Override Value rules on your controls can be utilized to produce desirable form behavior.

View all Tech Tips

Editing Table Data

This project shows how to add, edit and delete data from a Simple Table. The methods used in this can be transferred to Group Tables and also SQL Tables.

View all Tech Tips

DriveWorks Tech Tips Portal is available to DriveWorks Pro customers with an active subscription and support contract.

Tech Tips provide cut down projects that highlight specific functionality for faster and more effective learning.

To access the portal:

  1. Go to https://my.driveworks.co.uk/learn/tech-tips/
  2. Login with your DriveWorks Pro account credentials, if asked
  3. Click the Visit Tech Tips Portal button for access

The portal provides a search facility, start typing the name of the Tech Tip (as indicated above) to display the Tip you require.

Value set in Form Designer. Static properties can be made Dynamic by double clicking the gray radio button.