1
0
-1

I have a custom component in the form which contain some fields. These fields are prepopulated using the Page Change Controller, which renders correctly on the page. I call Form.backgroundSave(). However, I cannot see the data being bound in the form xml.

    CommentAdd your comment...

    2 answers

    1.  
      2
      1
      0

      I just tried this and it worked perfectly for me.

      Created a custom component, added it to the form, had a button that pushed data into those fields and a button that called Form.backgroundSave(). The saved XML includes the data from the fields in the Custom component.

      Can you confirm that for each of the fields in the custom component you have got the 'Include in Submission Data' checkbox selected on the Data tab?

      1. Diana Pattenden

        Hi Ben, yes I have got the Include in Submission Data checkbox selected on the Data tab. I have made another discovery. When I use $("form").scope().Form.getDataXml(true, true), I can see the fields being bound. However, in TM Form Data XML tab it is not there.

      2. Ben Warner

        No data tab at all! I had misunderstood that you were seeing all data in the XML except the custom component fields but if you're not seeing any data at all this is a different problem. I don't think this is related to the custom component. Sounds like the Form.backgroundSave() call may not be getting executed.

      3. Diana Pattenden

        Ben Warner sorry to clarify I am seeing the data in the XML (in TM) except the custom component fields. However if I do $("form").scope().Form.getDataXml(true, true) in the browser Console , the custom component fields are there, which is strange. I did add a call to do a backgroundSave() after the prepop code as I did wonder if it was that. My breakpoint is reaches there, but if I look at the history in TM for that transaction, I cannot see the backgroundSave() call entry.

      4. Ben Warner

        Does the data appear when you do an explicit Save & Close?

      5. Diana Pattenden

        Ben Warner thanks I have figured out what is wrong.

      6. Ben Warner

        Great! Can you share?

      7. Diana Pattenden

        Ben Warner I added a timeout when calling Form.backgroundSave(). So setTimeout(Form.backgroundSave(), 100);

      CommentAdd your comment...
    2.  
      1
      0
      -1

      Hi Ben, yes I have got the Include in Submission Data checkbox selected on the Data tab.

      I have made another discovery. 

      When I use $("form").scope().Form.getDataXml(true, true), I can see the fields being bound. However, in TM Form Data XML tab it is not there.

        CommentAdd your comment...