Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

setFocus not working when jumping to a different subform - grrrr

Avatar

Level 2

LC 8.2.1

hi,

I have a script attached to a button click event  that checks if all mandatory fields have values, and puts up a message and jumps to the first one that is empty using xfa.host.setFocus().

It works fine when placed in within the subform where the field is missing, but does not work correctly when jumping to a different subform.

It appears to jump into the missing field but  then jumps out again !?!  The correct page and part of the form is displayed but the field does not have focus (no field has focus).  I have  put display messages on the enter and exit events of the field and they *both* display.  If I move the button to this subform it works fine, if I copy the field and move  it to the subform that contains the button it works fine. It just doesn't work when jumping between subforms.  I have tried using the full SOM address and just the relative address but the behaviour is the same.

Anyone had this problem, anyone  have any ideas how I can fix this problem ? The form has mixed formcalc and javascript and sets subforms hidden and visible at different times, but I don't see anything that would lead to this problem

thanks  for any help.

0 Replies