Hi,
I have a parameter that is part of a table column and it's configured as a toggle button (with values 0 = Disable and 1 = Enable). I would like this toggle to:
- Have a default value of
0
when a new row is created. - Persist its last state (value) after a protocol restart.
I'm not sure where to define the DefaultValue
tag for a table column parameter. I couldn't find documentation or a working example that allows me to add the default value for a table column properly.
Could you please confirm how to define a default value for a table column parameter and ensure it retains its last state between restarts?
Thank you!
<Paramid="1804"trending="false"save="true" >
<Name>NetworkTable1AvailableMonitor</Name>
<Description>Monitoring Interface</Description>
<Type>read</Type>
<Information>
<Subtext>.</Subtext>
</Information>
<Alarm>
<Monitored>false</Monitored>
<Normal>Enabled</Normal>
<CH>Disabled</CH>
</Alarm>
<Interprete>
<RawType>numeric text</RawType>
<Type>double</Type>
<LengthType>next param</LengthType>
</Interprete>
<Display>
<RTDisplay>true</RTDisplay>
</Display>
<Measurement>
<Type>discreet</Type>
<Discreets>
<Discreet>
<Display>Enable</Display>
<Value>1</Value>
</Discreet>
<Discreet>
<Display>Disable</Display>
<Value>0</Value>
</Discreet>
</Discreets>
</Measurement>
</Param>
<Paramid="1904"setter="true">
<Name>NetworkTable1AvailableMonitor</Name>
<Description>Monitoring Interface</Description>
<Type>write</Type>
<Interprete>
Hi Jose,
The DefaultValue tag is only compatible with standalone parameters (see note at the bottom of this docs page DefaultValue element | DataMiner Docs) and, as such, will not work for your use case
The only way you have of achieving your goal is to use a QAction to fill in that column's value if none is currently filled in, and then ensure the column has the save option defined in the table definition itself and not on the parameter definition.
If you are populating the table from a QAction, you can use the same one to add this default value. If your table is filled in via SNMP or WMI, then you can add a QAction that triggers on the change of the table.