LPXXX FM Editor refresh display for inline mode
authorBill Erickson <berickxx@gmail.com>
Mon, 12 Aug 2019 20:44:14 +0000 (16:44 -0400)
committerBill Erickson <berickxx@gmail.com>
Mon, 12 Aug 2019 20:44:16 +0000 (16:44 -0400)
Force the editor to re-render its record in real time when using inline
mode, since the call to open() will never occur for inline mode.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts

index 9753ce5..c6cb25e 100644 (file)
@@ -200,6 +200,11 @@ export class FmRecordEditorComponent
     setRecord(record: IdlObject) {
         this.record = record;
         this.recId = null;
+        if (!this.isDialog()) {
+            // in inline mode, update the display immediately to reflect
+            // the change in source record.
+            this.initRecord();
+        }
     }
 
     // Translate comma-separated string versions of various inputs
@@ -257,7 +262,8 @@ export class FmRecordEditorComponent
         //
         // Create a new record from the stub record provided by the
         // caller or a new from-scratch record
-        this.setRecord(this.record || this.idl.create(this.idlClass));
+        this.record = this.record || this.idl.create(this.idlClass);
+        this.recId = null; // avoid future confusion
 
         return this.getFieldList();
     }