Long time lurker, first time poster :)
I have a web browser form which needs cascading dropdowns that is almost working. I'm attempting to do this:http://www.bizsupportonline.net/browserforms/dynamically-fill-drop-down-list-box-browser-form-using-other-form-as-source.htm (but using the owssvr XML queries & dynamic URL - this works fine)
Here's my code:
// Get the name of the InfoPath form to use from the groupSize drop-down list boxstring selectedXMLFile = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:Details/my:groupSize", NamespaceManager).Value;
// Retrieve the data connection bound to the partNum drop-down list boxFileQueryConnection con = (FileQueryConnection)DataConnections["owssvr"];
// Change the location of the data connection to point to the XML file selected in groupSizecon.FileLocation = @"http://<servername>/_vti_bin/owssvr.dll?Cmd=Display&List={F3A6AFDC-446C-472B-B9A3-887EE49685D8}&View={05C554A2-458C-47FC-92D1-0DE2EA8454FB}&XMLDATA=TRUE&FilterField1=PART_Group&FilterValue1=" + selectedXMLFile+ "&?noredirect=true";
// Query the data connection to fill the partNum drop-down list box with owssvrcon.Execute();
While this works for the Group Size filter, it applies the same filter to all rows in the repeating table.
So I found this: http://www.infopathdev.com/blogs/david/archive/2007/08/24/implementing-cascading-dropdowns-in-forms-server.aspx which provides a workaround & even a working template. When I attempt to modify this, I get lost in the code.
Since I don't really code, I am unsure which piece(s) of the code I should be adding to get the repeating field (partNumSource) in repeating table loaded with the query. I realize that last line of code above makes the dropdown become populated by the query results. How do I fix this? I hope I’m making sense!