[JSFIELD-18] Change event is not triggered in root context Created: 14/Nov/22  Updated: 01/Dec/22  Resolved: 01/Dec/22

Status: Closed
Project: Java Script UI (App and Dialog Fields)
Component/s: None
Affects Version/s: 1.1.8
Fix Version/s: 1.2

Type: Bug Priority: High
Reporter: Tobias Kerschbaum Assignee: Riste Drangovski
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Zip Archive test.zip    
Template:
Acceptance criteria:
Empty
Date of First Response:

 Description   

Steps to reproduce

  1. Open a Dialog with a textField and a JS-Dialog field from root in a content app
  2. Try to capture the change event like in the code example
  3. Change something in the textField

 

      window.addEventListener(
        "message",
        function (event) {
          console.log(event.data.action);
          if (event.data.action === "init") {
            correlationId = event.data.correlationId;
            console.log(event.data);
          } else if (event.data.action === "change") {
            textDescription = event.data.state.formFields.textDescription;
            console.log(textDescription);
          }
        },
        false
      ); 

 

Expected results

The change event should be fired and the text should appear in the console.

Actual results

The change event is not fired.

Workaround

Putting the dialog in the folder section of the content app seems to work. So it feels like the problem is the root context.

Development notes



 Comments   
Comment by Riste Drangovski [ 14/Nov/22 ]

I'm not able to reproduce this issue.
On my local environment, it doesn't matter where I open dialog from (root or not), change event is always triggered.
tobias.kerschbaum  can you please double check (maybe html, javascript resource was cached by the browser) ...

Comment by Tobias Kerschbaum [ 22/Nov/22 ]

Hey Riste,
sorry seems to be a really weird one. I got it reproducable.

Just install this light-module: test.zip

Steps to reproduce:

  1. Create a record
  2. Close the app
  3. Open the app frehsly
  4. Open the dialog from root without selecting the node. Type something in the text field. -> no update log message
  5. Select the record and open the dialog then type something -> update message is there in the log
  6. Deselect the node and open the dialog again on root and type something -> now the log message is also there on root

Screen recording is here: https://drive.google.com/file/d/1JZciZ_ohhF5OybNOCYKpPCPFhBB-wn8t/view?usp=sharing

(sorry to big to upload it here)

 

Generated at Mon Feb 12 02:16:18 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.