Well I've almost given up.
I think I've tried every method on the internet and have almost concluded that what I am trying to do is not possible.
I have a repeating table with two drop-downs. The selection of the first drop-down should be the filter for the second drop-down. This is in a browser-enabled form.
The How-To tutorials and sample forms that I have found on this site only show how to do it in a non browser enabled form. They all use filters, be it by editing the view XSL or just by clicking on Filter Data, something which browser-enabled forms do not support.
I have found three methods (which are all similar) for filtering data in browser forms where the drop-downs are NOT inside a repeating table:
- http://blogs.msdn.com/infopath/archive/2006/10/12/cascading-dropdowns-in-browser-forms.aspx which makes use of a web service and re-queries the web service whenever the first drop-down selection changes
- Using a XML secondary data source which gets its data from http://server/_vti_bin/owssvr.dll?Cmd=Display&List={GUID}&XMLDATA=TRUE and, with code, appending "&FilterField1=ColumnName&FilterValue1=FilterVale" to the URL
- Using code to reduce a secondary data source containing all of the values and populate a XML file from which the second drop-down gets its values from, whenever the first drop-down selection changes. I like this method the most, because the secondary data source is only queried once, when the form is opened.
The problem is that, well, the drop-downs are in a repeating table. If there are multiple rows in the repeating table and the selection on the first drop-down changes on ONE of the rows, the second drop-down on ALL of the rows changes.
I have also tried editing the XSL for the view, adding a XSLT variable (as one of the tutorials suggests) and trying to force a filter using XPath. When I re-open the form in design mode, InfoPath correctly informs me that I am trying to cheat the system and that filters are not supported in browser forms.
Please, if anyone knows of a way to achieve what I am trying to achieve, I would be extremely grateful if you can share it.