I have a browser form (InfoPath 2007 and MOSS2007) that contains a dropdown box. That box is bound to "Look up values in the form's data source" "/my:myFields/my:PayrollPeriods/my:Period" with value and display name both as "my:Combined".
The Combined field is to contain information like "1 - 12/20/2010 - 12/2011".
I'm filling this repeating group programmatically.
I created a Changed event handler for the dropdown box so I can react to the user choosing a new option.
I'm attempting to read the value but am running into a strange problem...I created a multi-line textbox to view what's happening. Here is the code I have:
XPathNavigator MainNavigator = MainDataSource.CreateNavigator();
XPathNavigator PayrollPeriodsElement = MainNavigator.SelectSingleNode("/my:myFields/my:PayrollPeriods", NamespaceManager); // this is the path to the actual dropdown list element
XPathNavigator TestElement = MainNavigator.SelectSingleNode("/my:myFields/my:Test", NamespaceManager); // this is the multi-line textbox
TestElement.SetValue(PayrollPeriodsElement.Value));
The multi-line textbox is filled with EVERY value in the Payroll Periods dropdown box (appended into one long string). It isn't just the value that was selected.
Any thoughts on what I'm doing wrong here?
Thanks!