I have a folder level script (below):
function AddNewRow(sName, sAddress, sCompany, sSalesRep)
{
var NewRow = this.xfa.form.Root.Page2.Company.Detail.instanceManager.addInstance(0);
NewRow.Name.rawValue = sName;
NewRow.Address.rawValue = sAddress;
NewRow.SalesRep.rawValue = sSalesRep;
}
The function is called from a VB app to populate the form table (LiveCycle form) from a recordset. All works fine except that the drop down (SalesRep) has the same data for each row (which is the value for the last row added). They appear to be synched if the value is changed in the PDF. If I change one all of the rows change to that value. The drop down is populated on initialize event of the PDF and that is working fine as well.
Can anyone help with what I am missing to have the correct value showing in the drop down for each row? I was thinking that the problem was using the fully qualified reference, but I have not been able to figure out how to pass a reference and set a field variable to that object in the script.
Thank you for any assistance.
If it's not the binding issue, then look through the form for code that might affect the value of the field, like the init event. Place "console.println()" statments in each relevant place. Then do some tests and see what shows on the console window. Try calling this function from the console so see if there is a differnce in action. Also try setting the value of "SalesRep" with code run from the console window.
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]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script