Expand my Community achievements bar.

SOLVED

LiveCycle Designer ES2 some scripted changes not preserved after Save

Avatar

Former Community Member

Hi,

I have some Text Field names that are changed by Javascript in certain Click Events. These renamed fields are used for navigation purposes in conjunction with xfa.form.resolveNode, and all works flawlessly until the form is saved, and re-opened.

After opening the saved form, all data entered is preserved, but the new Field names have not been preserved and resolveNode returns a null value.

The "Preserve scripting changes to form when saved" is set to "Automatically" in the Form Properties.

Any ideas/comments?

Thanks,

Ron

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi Ron,

I don't think that you will get this to work. I suspect that when the form is reopened the Template DOM contains the original name of the text field and that this is used when the form is rendered.

You could test this with a temporary button with this is the click event:

console.println("Textfield name BEFORE remerge: " + TextField.name);

xfa.form.remerge();

console.println("Textfield name AFTER remerge: " + TextField.name);

You would click this AFTER your other script has changed the name of the text field. Also you will need to open the JavaScript Console (Control+J) in order to see the results.

Good luck,

Niall

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hi Ron,

I don't think that you will get this to work. I suspect that when the form is reopened the Template DOM contains the original name of the text field and that this is used when the form is rendered.

You could test this with a temporary button with this is the click event:

console.println("Textfield name BEFORE remerge: " + TextField.name);

xfa.form.remerge();

console.println("Textfield name AFTER remerge: " + TextField.name);

You would click this AFTER your other script has changed the name of the text field. Also you will need to open the JavaScript Console (Control+J) in order to see the results.

Good luck,

Niall

Avatar

Former Community Member

Niall, you were right, the original name is being used after the save and re-open.

I have come up with another method for getting the same result, which uses a hidden Textfield to retain the desired name value. The Textfield used for navigation is renamed each time the initialize event fires. Slightly less elegant, but it is working perfectly.

Thanks for the help!

Ron