I expected a default value for a Libreoffice form field to be associated with the field itself, but using Xray, there is no property of a Libreoffice form field that holds the default that was set up for it. I’d like to find the default to change it during form execution.
Do you mean you want to change the current value? Suggest executing .dbg_properties and .dbg_methods on the various objects, consulting LO SDK.
Text entry fields have DefaultText property for this purpose.
Are you using HSQLDB or other? The reason I ask is because w/ MySQL the default is not stored in the form, it’s stored in MySQL.
Hello @BillGradwohl,
The “Default value” for a control is used for initial display, and when the control is reset.
Some controls have a different property name for the Default value.
The property names are:
DefaultText for TextField, PatternField, ComboBox, and FileControl
DefaultValue for NumericalField, CurrencyField
DefaultState for CheckBox, RadioButton ( "Default status" in the Properties dialog )
DefaultSelection for ListBox
DefaultDate for DateField
DefaultTime for TimeField
DefaultScrollValue for ScrollBar
EffectiveDefault for FormattedField ( called "Default value" in the Properties dialog )
DefaultSpinValue for SpinButton ( called "Default value" in the Properties dialog )
@librebel The ‘Default’ set in a table definition is only for the user interface. It actually has nothing to do with the default being set in the database field. See Bug 104375.
Thanks @Ratslinger, i’ll remove that part. In my understanding it is like comment 2 and comment 5 of Robert in that bug report. “The default-value of the database will write the default-value into the row, if the field is left empty in the GUI.” … rather confusing indeed.
What it boils down to is that unless you actually submit an Alter statement for the field to specify a default, there is no actual DB field default. Additionally, if you DO set this default, there is no way in Base to see that this is set without actually looking at the specific db info through the use of SQL.