diff --git a/api/js/etemplate/Et2Link/Et2LinkEntry.ts b/api/js/etemplate/Et2Link/Et2LinkEntry.ts index e92dbfb863..efbb7b9090 100644 --- a/api/js/etemplate/Et2Link/Et2LinkEntry.ts +++ b/api/js/etemplate/Et2Link/Et2LinkEntry.ts @@ -301,7 +301,7 @@ export class Et2LinkEntry extends Et2InputWidget(FormControlMixin(ValidateMixin( set value(val : LinkInfo | string | number) { - let value : LinkInfo = {app: "", id: ""}; + let value : LinkInfo = {app: this.only_app, id: ""}; if(typeof val === 'string' && val.length > 0) { @@ -309,9 +309,16 @@ export class Et2LinkEntry extends Et2InputWidget(FormControlMixin(ValidateMixin( { val = val.replace(",", ":"); } - const vals = val.split(':'); - value.app = vals[0]; - value.id = vals[1]; + if (val.indexOf(':') > 0) + { + const vals = val.split(':'); + value.app = vals[0]; + value.id = vals[1]; + } + else + { + value.id = val; + } } else if(typeof val === "number" && val) { @@ -361,4 +368,4 @@ export class Et2LinkEntryReadonly extends Et2Link } -customElements.define("et2-link-entry_ro", Et2LinkEntryReadonly); +customElements.define("et2-link-entry_ro", Et2LinkEntryReadonly); \ No newline at end of file