No reset from instances if turn from "on" to "off" and "on" again

Avatar

Avatar

Philipp_Abendro

Avatar

Philipp_Abendro

Philipp_Abendro

27-01-2017

Hello,

i have build a dynamic pdf file with some "hidden" pages.

The pdf had one title page and the other pages are hidden and only visible if the user click to a checkbock at the title page.

now my Problem, if a user would set some pages to visible and fill out the textfield or so and hide this pageset again, all entrys are deletet (if visible again).

is it possible to Change this Setting from livecycle designer, or did a make something wrong.

my script:

(this.rawValue == "1"){ 

_autostore.setInstances(1)

else{ 

_autostore.setInstances(0)

} 

"AutoStore" is a partial form from 3 pages.

Thanks for Support or any idea.

Accepted Solutions (0)

Answers (2)

Answers (2)

Avatar

Avatar

Philipp_Abendro

Avatar

Philipp_Abendro

Philipp_Abendro

10-07-2017

Hi,

thnaks for Reply, this would work, if i set the complete page to "hidden" and with this script to vissible. 🙂

greetings

Philipp

Avatar

Avatar

radzmar

MVP

Total Posts

2.6K

Likes

387

Correct Answer

485

Avatar

radzmar

MVP

Total Posts

2.6K

Likes

387

Correct Answer

485
radzmar
MVP

31-01-2017

The setInstances() method adds or removes elements to the form DOM and also the data DOM. So, once deleted the entered data is lost and a newly added instance will be populated with the default values.

To keep the data use another way to controll the visibility, like the presence property:

if ((this.rawValue == "1") { 

    autostore.presence = "visible";

} else{ 

    autostore.presence = "hidden";

}