I figured out how to update all my drop down lists from a table as long as the Drop Down list is not in a repeating row. In this case it only apply to the Drop Down list of the first row.
I am using the click function of a button to apply my script.
I clear the Drop Down list with something like this:
Form51188_2013.MaintenancePage.Button3::click - (JavaScript, client)
Form51188_2013.Page_1.Dive_Particulars.CallReceivedBy.rawValue = null;
Form51188_2013.Page_1.Dive_Particulars.CallReceivedBy.clearItems();....................... ...etc
My code to load the info currently read :
var nName = xfa.resolveNodes("Form51188_2013.MaintenancePage.Table3.Row1[*].Name");
var cBox = xfa.resolveNodes("Form51188_2013.MaintenancePage.Table3.Row1[*].cPick");
for (var i=0; i<nName.length; i++)
{
for (var i=0; i<cBox .length; i++)
if(cBox.item(i).rawValue === 1)
{
Form51188_2013.Page_1.Dive_Particulars.CallReceivedBy.addItem (nName.item(i).rawValue);
Form51188_2013.Page_1.Dive_Particulars.AuthorizedBy.addItem (nName.item(i).rawValue);
Form51188_2013.Page_1.Supervisors.Table2.Row2.Supervisors.addItem (nName.item(i).rawValue);
Form51188_2013.Page_2.TeamBreifingSup.addItem (nName.item(i).rawValue);
Form51188_2013.Page_4.DebreifSup.addItem (nName.item(i).rawValue);
Form51188_2013.Page_4.ExhBy.addItem (nName.item(i).rawValue);
Form51188_2013.Page_4.Table1.Row1.TeamDeBriefBy.addItem (nName.item(i).rawValue);
Form51188_2013.topmostSubform.DiveLog.Table1.Row7.Cell7.addItem (nName.item(i).rawValue);
}
}
everything work good to this point.
I tried a loop to clear and hopefully load the info to the Drop Down list located in repeating row with no success as follow:
var nDList = xfa.resolveNodes("Form51188_2013.topmostSubform.DiveLog.Table1.DiverDetails[*].NameList") // "DiverDetails" being the name of the row and "NameList" the name of the Drop Down list to be updated.
var nDlist = xfa.resolveNodes("Form51188_2013.topmostSubform.DiveLog.Table1.DiverDetails[*].NameList") ;
for (var i=0; i<nDList.length; i++)
{
Form51188_2013.topmostSubform.DiveLog.Table1.DiverDetails.NameList.rawValue = null;
Form51188_2013.topmostSubform.DiveLog.Table1.DiverDetails.NameList.clearItems();
}
Load with this:
var nName = xfa.resolveNodes("Form51188_2013.MaintenancePage.Table3.Row1[*].Name");
var cBox = xfa.resolveNodes("Form51188_2013.MaintenancePage.Table3.Row1[*].cPick");
var nDlist = xfa.resolveNodes("Form51188_2013.topmostSubform.DiveLog.Table1.DiverDetails[*].NameList") ;
for (var i=0; i<nName.length; i++)
{
for (var i=0; i<cBox .length; i++)
if(cBox.item(i).rawValue === 1)
{
for (var i=0; i<nDList.length; i++)
{
Form51188_2013.topmostSubform.DiveLog.Table1.DiverDetails.NameList.addItem (nName.item(i).rawValue);
}
}
}
Some assistance please.