regular filter is not working - InfoPath Dev
in

InfoPath Dev

regular filter is not working

Last post 05-09-2008 04:13 PM by Greg Collins. 22 replies.
Page 2 of 2 (23 items) < Previous 1 2
Sort Posts: Previous Next
  • 05-07-2008 12:39 AM In reply to

    • PJagger
    • Top 500 Contributor
      Male
    • Joined on 11-20-2007
    • Australia
    • Posts 40

    Re: regular filter is not working

    Thanks Greg,

    Can you provide a link to a step-by-step process on how to edit the manifest (including how to access it)?

    Regards - Phil

  • 05-07-2008 04:28 AM In reply to

    Re: regular filter is not working

    Hi, I am also having problem with filters.

    I have created two secondary data connections named as "StateDataCnctn" and "City". I want to change the cities according to the state selected in first dropdown.I want to do it programtically. So what i have done is:

    1) Created secondary datasources: 1)State and 2)City

    2) Placed two drop down controls one for each State and City at the form.

    3) DropDown1 and DropDown2 properties are: Get values from External Data Source "StateDataCnctn" and "CityDataCnctn" respectively.  Moreover, DropDown2 has a filter saying "State =state"

    3) Opened the VSTA and on "FormEvents_Loading"  I call

                     XPathNavigator navGetStateDataCnctn = this.DataSources["StateDataCnctn"].CreateNavigator();

                    DataConnection cnctnStateDataCnctn = this.DataConnections["StateDataCnctn"];

                    cnctnStateDataCnctn.Execute();

    4) On changed event of first control State: public void State_Changed(object sender, XmlEventArgs e)

                   XPathNavigator navGetCityDataCnctn = this.DataSources["CityDataCnctn"].CreateNavigator();                DataConnection cnctnCityDataCnctn = this.DataConnections["CityDataCnctn"];

                    cnctnStateDataCnctn.Execute();

    5) When running the code; DropDown1 is getting values properly. But DropDown2 is not getting values.

    6) If we delete the filter from the DropDown2; it gets full list of cities. But does not change as per the State selected from first Dropdown.

    Can somebody please help.

     Thanks,

    Ved

  • 05-07-2008 04:18 PM In reply to

    Re: regular filter is not working

  • 05-07-2008 04:30 PM In reply to

    Re: regular filter is not working

    Ved, your code doesn't really do much. You could set both connections to query on load, rather than on change, and you'd get the same effect without the additional wait time after each change. This is because you are not doing anything in your connection to filter your results. And since you mentioned you have more than one pair of these drop-downs in the view, that's probably the better choice--as filtering the data connection would affect all drop-downs, and not just the one you are currently working on.

    So, with both data connections queried for results, the focus goes to the filter you placed on DropDown2.

    Let's get a few facts straight here first:

    1. You have 2 data connections, which I will call "dcState" and "dcCity"
    2. You have 2 nodes in your data sourse, which I will call "nState" and "nCity"
    3. You have 2 drop-down controls in your view, which I will call "ddState" (bound to node "nState") and "ddCity" (bound to node "nCity").
    4. You want to filter the "ddCity" based on the selected value in "ddState" -- which value is stored in node "nState"

    In order to do this, data connection "dcCity" needs to have a State node present in it.

    Then, the fitler you add to control "ddCity" needs to specify that the "dcCity/State" is equal the value stored in node "nState".

    This is basically stating that you only want to see cities that have an associated state equal to the one selected in the state drop-down.

  • 05-08-2008 05:26 AM In reply to

    Re: regular filter is not working

    Thanks for the reply Greg!

    Actually I had done the same thing, you have mentioned. But did not connect the dcCity to Primary data source State. Now after connecting it, it works perfectly.

     Thanks a lot.

  • 05-08-2008 04:28 PM In reply to

    Re: regular filter is not working

    Awesome! Glad its working for you now! Keep up the good work!

  • 05-08-2008 04:53 PM In reply to

    • PJagger
    • Top 500 Contributor
      Male
    • Joined on 11-20-2007
    • Australia
    • Posts 40

    Re: regular filter is not working

    Hi Greg

    I took the plunge and edited the manifest.xsf file and my filtering works perfectly!  Thank you so much!

    Regards - Phil

  • 05-09-2008 04:13 PM In reply to

    Re: regular filter is not working

    That's great to hear! So glad you got it working!

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