Prefill Service in Adaptive Form | Community
Skip to main content
ShaileshBassi
Community Advisor
Community Advisor
June 23, 2022
Solved

Prefill Service in Adaptive Form

  • June 23, 2022
  • 1 reply
  • 995 views

I am trying to implement the prefill services as per the documentation present in https://lhotsetechnologies.com/blog/prefill-service-in-adaptive-forms/

 

 

But I am not getting the values prefilled when I am previewing the same

 

 

I have check that the name in the java class and the field are the same as mentioned in the document.

Please help with the pointers, which might have been missed for the implementation.

Thanks 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by MorisMonk

I believe you will need to manually bind (if not already done) each field to /data/name and /data/title respectively.

 

Also, looked at the code in that link you provided, can you add the following 2 lines

           rootElement.appendChild(name);
           rootElement.appendChild(title);

just before  ByteArrayOutputStream outputStream = new ByteArrayOutputStream();

 

Cheers Moris

1 reply

Mayank_Gandhi
Adobe Employee
Adobe Employee
June 23, 2022

@shaileshbassi The form tries to search for the element in the xml  with name maping and then binds the value to the field. You should check the structure of the xml being returned by the component.

Try to use this option and see if the data is merged fine in the form.

 

 

ShaileshBassi
Community Advisor
Community Advisor
June 23, 2022

@mayank_gandhi Yes, if I use this option, it works perfectly fine.

But I want to use the option to get it pre-filled from backend i.e. either by 

  • public class MyPrefillAdaptiveForm implements DataProvider (which is not working for me), or
  • public class MyPrefillAdaptiveForm implements DataXMLProvider (this one is working), as I am having the binding of the schema with the XSD file that I mentioned while creating the form.

So, want to know when we use the service to prefill the form via backend using by implementing DataProvider, is there any binding that needs to be done. If yes, how to configure that binding.

Thanks 

Mayank_Gandhi
Adobe Employee
Adobe Employee
June 24, 2022

@shaileshbassi if you have binding then the data will adhere to the binding and it will be under afbounddata else just the object name