Hello, I am working with AEM Designer to map a PDF form and use actions on the form. I added two text field objects and bound data to each of them. Then I added an action to set the value of one of the fields to null if the other field is not empty. I am able to save the action and do not get any errors, but upon previewing the form, the action does not work. In the XML source, I noticed that the action was added as a comment:
Hi, it is NOT commented. // are line comments and not comment ranges. The actual code line is active. When I do the same thing here it works as expected. The way this is done is that on exiting the field in the action (here Vin) the code gets executed. So you must exit Vin before you see the result.
@TK0215 Different situation - it is a print PDF that you fill based on incoming data. Here my assumption: The data can contain both data values, if it does then VIN shall take precedence and clear field make. You have to remove the current action as it will not help you. A simple form with 2 text field. I simulate your data by using the Default value for both fields. In the initialize event of the field VIN I check the content and empty Make if it is filled.
Preview as Print, no logic applied, both fields show content
Thank you for the clarification. In that case, perhaps I should provide more context because it is still not working for me. We build static PDF forms in AEM Designer that get rendered through AEM servers with XML data based on a data schema. For this test, I mapped a form with the two fields and added the action on one of the fields. When I do a Preview PDF from within AEM Designer, the action does not work. I even tried changing the order of the fields in the hierarchy and it still did not work. Here is my action: