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
Solved! Go to Solution.
Views
Replies
Total Likes
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
@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.
@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
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
@ShaileshBassi if you have binding then the data will adhere to the binding and it will be under afbounddata else just the object name
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
Thanks @MorisMonk It worked.