Cascading Dropdown Help Needed - InfoPath Dev
in

InfoPath Dev

Cascading Dropdown Help Needed

Last post 10-21-2005 01:07 PM by Greg Collins. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 10-03-2005 09:29 AM

    Cascading Dropdown Help Needed

    Hi:

    I have read and followed the How To on cascading dropdowns and am still having a problem. I have a main data source, SourceA, which is an Access database and a secondary data source, SourceB, which is a SharePoint list. I am creating a form for data entry into my Access database. I want to have cascading dropdowns that are based on my SharePoint list (secondary data source, SourceB) the user can select from to enter data into the database (SourceA). My first dropdown is System. Since I only want unique values, I have the following filter on it: not(.=../preceding::dfs:SourceB/@System). My second dropdown is Belt Type. I have the following filter on it: not(.=../preceding::dfs:SourceB[@System=current()/d:SourceA/d:System]/@Belt_Type)
    When I select the first system in the list, there are three unique belt types available, which is correct. When I choose the second system in the list, there are no belt types available, which is incorrect. The second system uses one of the same belt types that is used by the first system. I know that there is a problem with my filter, but I am unsure what it could be. Any help is greatly appreciated.

    Thanks--

    Hilary
  • 10-03-2005 09:59 AM In reply to

    Re: Cascading Dropdown Help Needed

    The issue is most likely coming from your filter: [@System=current()/d:SourceA/d:System]. Make certain you know what node current() represents... the XPath following that must be in relation to the actual node represented by current().

    Greg Collins [InfoPath MVP]
    InfoPath Dev
  • 10-03-2005 03:47 PM In reply to

    Re: Cascading Dropdown Help Needed

    So, at the risk of sounding extraordinarily naive, how do I know what node current represents? I was thinking it would represent the value displayed in the dropdown System, and since that system is in my main data source, SourceA, that it would refer to SourceA. . . .

    Hilary
  • 10-04-2005 12:02 PM In reply to

    Re: Cascading Dropdown Help Needed

    It usually represents the node to which the control is bound. So if your control is a drop-down list box, and it is bound to NodeA... then NodeA should be current(). There are some exceptions, but I believe this should help.

    Greg Collins [InfoPath MVP]
    InfoPath Dev
  • 10-17-2005 01:12 PM In reply to

    Re: Cascading Dropdown Help Needed

    Okay--I have reviewed the How To Tutorials, and I have had success when I create an XML file for my secondary data source. My main data source is an Access database. When I try to use my SharePoint List for a secondary source, however, my filter will not work, even after I revise it to reflect the different way the list is referenced as compared to the XML--the XML is referenced as /Configurations/Configuration/@system and the SharePoint list is referenced as /dfs:myFields/dfs:dataFields/dfs:Test/@System. Any ideas? Thanks in advance. . . .

    Hilary
  • 10-18-2005 08:51 AM In reply to

    Re: Cascading Dropdown Help Needed

    I got it--the subfilter I needed was [@System = current()/@System]. I have no idea why it works, and only got there through trial and error and sheer luck, but thought I would share it in case it works for someone else.

    Hilary
  • 10-21-2005 01:07 PM In reply to

    Re: Cascading Dropdown Help Needed

    Thanks for sharing that. XPath can be very confusing at times.

    There has been numerous times when I've spent an hour or more trying to get an XPath to work the way I thought it should.

    Sometimes I stumble across that "sheer luck" too. Occasionally it drives me nuts. But ultimately when I take time to fully evaluate the working solution, it makes logical sense.

    Greg Collins [InfoPath MVP]
    InfoPath Dev
Page 1 of 1 (7 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.