Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

Using Template DOM/Dynamic JavaScript

Avatar

Level 5
Hey everyone:



I'm attempting to write a script in the "click" event of a button that changes the script in the "enter" event of a text field for the rest of the time the form is open (or permanently will work too). I've been playing with the Template DOM with things like:



xfa.layout.mySubform.myTextField.event__enter.script.value += //the line being added.



I figure there will also have to be some kind of remerge afterwards. Anyone know if I'm on the right track? Anyone done something like this before? Anyone proven that it's impossible?



Any feedback or help would be greatly appreciated!



Ryan D. Lunka

Cardinal Solutions Group

rlunka@cardinalsolutions.com
1 Reply

Avatar

Level 10
You cannot do that .....Your code is working but the changes to the template DOM are being discarded the next time the form lays itself out. It will go back to the original template thus ignoring your changes. Once the form is rendered you canno get at it. Can you modify the template before rendering (while it is in XDP mode)?