Hi @SmrithiGo,
Thank you for reaching out regarding the subform visibility issue when rendering PDFs from your Adaptive Form on AEM 6.5.24.
I have investigated the behaviour you described and would like to share my findings along with recommended solutions.
Root Cause:
Base on your form design, the visibility change is triggered by the button click on your Adaptive Form whi h is handled at the UI layer (JavaScript/client-side event). When a PDF is rendered, the XDP template is processed independently and does not replay UI-layer events — it only has access to the submitted data model. As a result, the subform remains in its default hidden state in the rendered PDF.
This is a very common scenario which we have seen with multiple customers working with XFA based forms and Adaptive Forms as well.
Recommended Solution:
The most reliable fix is to bind the subform's visibility to a data field value, so the state is carried through to the PDF renderer:
1. Add a hidden field (e.g., showSubform) of type text/number to your data model with a default value of 0.
2. In the button's click script on the Adaptive Form, set this field's value to 1 alongside your existing visibility logic.
3. In the XDP template, add the following script to the subform's calculate event:
if (xfa.resolveNode("$.showSubform").rawValue == "1") {
this.presence = "visible";
} else {
this.presence = "hidden";
}
This ensures that when the PDF is rendered, the XDP reads the data value and reflects the correct visibility state.
Additional Checks
- Please verify that the prefill/submitted data XML being passed to the PDF renderer includes the updated field values.
- Ensure all relevant AEM 6.5 Forms Service Packs and hotfixes are applied, as some dynamic subform rendering issues have been addressed in recent updates. You can check the bundle version at: system/console/bundles (com.adobe.aemfd.adobe-aemfd-af-core).
Please feel free to reach out if you need assistance with the XDP script syntax, data binding configuration, or any further clarification. We are happy to assist.
Thanks
Pranay