I am inserting red lines in the following code when a button is pressed, and it works. However, none of the red lines are there when I reopen the form. What is the problem?
form1.page1.sub1.rows.N1::click - (JavaScript, client)
if(xfa.resolveNode("rl.value.line.edge.color").value == "0,0,0")
{
xfa.resolveNode("rl.value.line.edge.color").value = "255,0,0";
xfa.resolveNode("rl.value.line.edge.thickness").value = "0.0035in";
xfa.resolveNode("form1.page2.sub.lines[" + this.parent.index + "].carrierName").borderColor = "255,0,0";
}
else
{
xfa.resolveNode("rl.value.line.edge.color").value = "0,0,0";
xfa.resolveNode("rl.value.line.edge.thickness").value = "0.0035in";
xfa.resolveNode("form1.page2.sub.lines[" + this.parent.index + "].carrierName").borderColor = "0,0,0";
}
When Acrobat loads the LiveCycle PDF it merges the data model into the template to create the real form the user sees on the screen, called the Form Model. When the form is submitted or saved, the data in the Form Model is saved back into the data model. Each of these components is represented by a SOM path. For example the template is "xfa.template", the data model is "xfa.datasets", the form model is "xfa.form". In LiveCycle scripting the Form model is the default. The only changes made to the form model that are sticky are changes to data. nothing else will matter. It's possible to make some kinds of changes to the template, but not from Reader. The whole idea is that data drives the system.
If you want to make persistent changes you have to somehow link them to the data, and setup initialization code that recreates the features you want on startup.
Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]
The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]
Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script