Cascading Drop Down List in Repeating Table

P

Paul Green

I'm going nuts. I've spent the best part of 2 days trying to solve
this problem!

I have an XML file containing skills. Each skill has a category (e.g
development, databases etc).

I have a from with a table. The table has two drop downs; category and
skill.

The category drop down gets it's drop down values from the category
node in the xml file, the skill drop down from the skill node.

User selects category node, then user selects skill node which has
been filtered down to just those skills that apply to that category.

How should the filter in the skills drop down look? I can't seem to
get anything to work at all.

Conceptually it's 'on the current row, go look at the category drop
down value and filter the skills drop down to show the skills
belonging to that category'.

Problem is, InfoPath doesn't want to give up the secret of how to get
the current row.

I'm sure this has been solved but somehow I can't find the solution on
the web.

Cheers,
Paul.
 
I

Info Path

Hi,

You must first create a datasource pointing to your xml data. (Web service,
database, file...)
then you connect your first drop-down list to your repeating field in your
datasource.
Then, you connect your second drop-down list to the same datasource BUT you
add a filter on it, in which you can add a formula like
[datasource]/category=[XDocument]/firstdropdownlist/category and that's
done!

Tell me if it's ok!
 
A

aturner

We've been struggling with this issue in another discussion ("Repeating table
in secondary data source," 1/11/05) and eventually settled on the current()
solution described in the blog you referenced below. However, though it
seems like it should work, when I added 'current()' to my XPath formula, it
stopped working altogether. Is there an obvious problem with my formula?
Please help! Thanks very much.

Both my main form and the secondary data source (FS Prices.xml) have
repeating tables, with each row containing Product and Price fields (the
secondary fields are designated by a '2' in the field name). I want to fill
in the main Price field with a value from FS Prices, filtered by which item
is selected in the Product drop-down. I have a rule set up to accomplish
this, but need assistance in getting it to filter the correct Product
selection in FS Prices.

xdXDocument:GetDOM("FS
Prices")/my:myFields/my:hwItems/my:hwUnitPrice2[../my:hwProduct2 =
current()/my:myFields/my:hwItems/my:hwProduct]
 
A

aturner

Thanks, Greg. I tried it, but the Price field is still not being updated.
All of the fields in my table row are in the group my:hwItems. Is that what
you meant, or is there a better way to identify the table row? (Sorry, but
I'm still new to InfoPath.)
 
Top