Repeating Cascading Lists of Cascading Lists, v1.0 - InfoPath Dev
in

InfoPath Dev

Repeating Cascading Lists of Cascading Lists, v1.0

Last post 07-07-2009 03:32 PM by tvanbui. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 03-17-2005 10:32 PM

    Repeating Cascading Lists of Cascading Lists, v1.0

    In the example Repeating Cascading Lists of Cascading Lists v1.0, especially in the part where duplicate entries in dropdown are filtered, how is it that the following filter commands can be issued:

    not(. = preceding::Vehicle/@year)

    since i can't find a way to insert "preceding" category for a field..

    thanks!
  • 03-29-2005 03:38 PM In reply to

    Re: Repeating Cascading Lists of Cascading Lists, v1.0

    If I understand correctly what you are asking, what you need to do is manually type in the "preceding" part. There is no option for this in the InfoPath UI.

    Greg Collins [InfoPath MVP]
    InfoPathDev
  • 07-07-2009 03:32 PM In reply to

    Re: Repeating Cascading Lists of Cascading Lists, v1.0

    Hello Greg,

    Can you please help to get my cascading dropdown list to work properly in a repeating table?  My lists seem to work fine until I add another row to the table and the first row gets kinda squirrelly.  The following is a snippet of the code.  What would I have to do to get the addittional rows to work properly.  I'm think that i'll have to check for the last node in the repeating group and then do something.  I don't know what to do really.  Can you help?  Thanks.

    private void PopulateCascadingDropDown(string selectedMainValue,

    string dataConnectionName, string dataSourceName, string

    repeatingNode, string ForeignKey, string

    CascadingDropDownDataSourceField)

    {

    //-- Set the Value of the Cascading Dropdown in the Main

    //-- Data Source to empty --

    //-- This is needed, the previous selected node will stay

    //-- in the list --

    XPathNavigator xnMain = this.MainDataSource.CreateNavigator();

    xnMain.SelectSingleNode(CascadingDropDownDataSourceField,

    this.NamespaceManager).SetValue(string.Empty);

    //-- Execute the DataConnection --

    DataConnection dcSecond = this.DataConnections[dataConnectionName];

     

    dcSecond.Execute();

     

    //-- Get a Navigator to the Secondary DataSource, just created by

    //-- previous line of code --

    XPathNavigator xnFD = this.DataSources[dataSourceName].CreateNavigator();

    //-- Create xPathString: Select all nodes where the foreignkey is

    //-- different from the selected Value --

    string xPathString = repeatingNode + "[@" + ForeignKey + "!='" +

    selectedMainValue + "']";

    //-- Get the nodes, corresponding the xPathString --

    XPathNodeIterator items = xnFD.Select(xPathString,

    this.NamespaceManager);

    while (items.Count != 0)

    {

    xnFD.SelectSingleNode(xPathString,

    this.NamespaceManager).DeleteSelf();items = xnFD.Select(xPathString, this.NamespaceManager);

     

    }

    }

    public void CTRL30_5_Clicked(object sender, ClickedEventArgs e)

    {

    const string f1 = "/my:myFields/my:group1/my:group2"; //repeating group name

    XPathNavigator root = e.Source; //assign to root navigator

    XPathNodeIterator rows = root.Select(f1, NamespaceManager); //use select to iterate

    string id = rows.Current.SelectSingleNode("/my:myFields/my:field1", NamespaceManager).Value; //this returns value of the current row

    //XPathNavigator root = MainDataSource.CreateNavigator();

    string dataConnectionName = "testDetail";

    string dataSourceName = "testDetail";

    string ForeignKey = "masterid";

    string CascadingDropDownDataSourceField = "/my:myFields/my:group1/my:group2/my:field2";

    //string selectedMainValue = root.SelectSingleNode("/my:myFields/my:field1", NamespaceManager).Value;

    string selectedMainValue = id;string repeatingNode = "/dfs:myFields/dfs:dataFields/d:testDetail";

    PopulateCascadingDropDown(selectedMainValue, dataConnectionName,

    dataSourceName, repeatingNode, ForeignKey, CascadingDropDownDataSourceField);

    }

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.