hi
I am use TypedInput Select box in my config node
check in this link
https://nodered.org/docs/creating-nodes/edit-dialog
but when open this config all value reset in default value ?
<script type="text/javascript">
RED.nodes.registerType('ClientConfig',{
category: 'config',
defaults: {
name: {value:"name of config" ,required:true},
ASDUAddrLeng: { value: "", required:true,validate:RED.validators.number()},
ASDUAddr : { value: "", required:true},
IOAaddrLeng:{ value: "", required:true,validate:RED.validators.number()},
COTaddrLeng:{ value:"", required:true,validate:RED.validators.number()},
OriginAddr:{ value:"", required:true,validate:RED.validators.number()}
},
label: function() {
return this.name||"ClientConfig";
},
oneditprepare: function () {
var tabs = RED.tabs.create({
id: "node-config-client-config-tabs",
onchange: function(tab) {
$("#node-config-client-config-content").children().hide();
$("#" + tab.id).show();
}
});
tabs.addTab({
id: "config-client-tab-Application",
label: this._("Application Layer")
});
tabs.addTab({
id: "config-client-tab-Link",
label: this._("Link Layer")
});
tabs.addTab({
id: "config-client-tab-option",
label: this._("option")
});
$("#node-config-input-ASDUAddrLeng").typedInput({
types: [
{
value: "ASDUAddrLeng",
options: [
{ value: 1, label: "One Octet"},
{ value: 2, label: "Tow Octet"},
]
}
]
});
$("#node-config-input-IOAaddrLeng").typedInput({
types: [
{
value: "IOAaddrLeng",
options: [
{ value: 1, label: "One Octet"},
{ value: 2, label: "Tow Octet"},
{ value: 3, label: "Three Octet"},
]
}
]
});
$("#node-config-input-COTaddrLeng").typedInput({
types: [
{
value: "COTaddrLeng",
options: [
{ value: 1, label: "One Octet"},
{ value: 2, label: "Tow Octet"},
]
}
]
});
}
});
</script>
<script type="text/html" data-template-name="ClientConfig">
<div class="form-row">
<label for="node-config-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span>name</label>
<input type="text" id="node-config-input-name" data-i18n="[placeholder]common.label.name">
</div>
<div class="form-row">
<ul style="min-width: 600px; margin-bottom: 20px;" id="node-config-client-config-tabs"></ul>
</div>
<div id="node-config-client-config-content" style="min-height:150px;">
<div id="config-client-tab-Application" style="display:none">
<div class="form-row">
<label for="node-config-input-ASDUAddrLeng" style="width: auto;"><i class="fa fa-tag"></i> <span data-i18n="common.label.ASDUAddrLeng"></span>SADU Address Size</label>
<input type="text" id="node-config-input-ASDUAddrLeng" style="width: 17%;">
<label for="node-config-input-ASDUAddr" style="margin-left:30px; width: auto;"><i class="fa fa-tag"></i> <span data-i18n="common.label.ASDUAddr"></span>SADU Address</label>
<input type="text" id="node-config-input-ASDUAddr" style="width: 17%;">
</div>
<div class="form-row">
<label for="node-config-input-IOAaddrLeng" style="width: auto;"><i class="fa fa-tag"></i> <span data-i18n="common.label.IOAaddrLeng"></span>IOA Address Size</label>
<input type="text" id="node-config-input-IOAaddrLeng" style="width: 17%;">
<label for="node-config-input-COTaddrLeng" style="margin-left:30px; width: auto;"><i class="fa fa-tag"></i> <span data-i18n="common.label.COTaddrLeng"></span>COT Address Size</label>
<input type="text" id="node-config-input-COTaddrLeng" style="width: 17%;">
</div>
<div class="form-row">
<label for="node-config-input-OriginAddr" style="width: auto;"><i class="fa fa-tag"></i> <span data-i18n="common.label.OriginAddr"></span>Originator Address</label>
<input type="text" id="node-config-input-OriginAddr" style="width: 17%;">
</div>
</div>
<div id="config-client-tab-link" style="display:none"> </div>
<div id="config-client-tab-options" style="display:none"> </div>
</div>
</script>
<script type="text/html" data-help-name="ClientConfig">
<p>A simple node that converts the message payloads into all Client characters</p>
</script>