Cascading Dropdown list in repeating section - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Cascading Dropdown list in repeating section

Last post 08-30-2011 06:23 AM by bobbyschang. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 10-29-2009 08:08 AM

    Cascading Dropdown list in repeating section

    Hello All 

    My First Question to the Forum

    I am facing a problem with Cascading dropdown lists in a repeating section 

    I have a drop down list (Services) and another dropdown list (Activities - related to Services), they both are in a repeating sections. I can filter Activates drop down list based on services, it works fine.

    But the problem is with repeating section, if I select a service in first section it is updating Activities dropdowns in all sections. What I want is to update only Activity dropdown which is same section as selected Service section.I hope I am making some sense here. If not please check the attached image.Can someone help me out?I am using Infopath Form 2007(Browser based) and the Dropdown Lists are populated from Sharepoint Lists. Any suggestions are much appreciated. 

    Regards

     

     


  • 10-29-2009 08:19 AM In reply to

    Re: Cascading Dropdown list in repeating section

    How are you doing cascading dropdowns when filtering is not supported in browser forms?  Does your filtering actually work in the browser, or have you only tested in preview mode?

    For your dropdowns to be independent, they need to exist within the repeating group in your data schema that is being used for the repeating section binding.

    I've attached a sample to illustrate...

  • 10-29-2009 08:47 AM In reply to

    Re: Cascading Dropdown list in repeating section

    Thanks for quick reply, much appreciated.

    Filtering is done using the code (C#)

    I used the following code to filter out the data(added it under changed event of service drop down)

    FileQueryConnection q = (FileQueryConnection)this.DataConnections["Activity List XML"];

    q.FileLocation = q.FileLocation + "&FilterField1=Service&FilterValue1=" + e.NewValue;

    q.Execute();

    I think it is filtering all activity dropdownlists which uses  "Activity List XML" data connection.

    Instead can I just restrict it to activity dropdown which is in same repeat section as selected Service dropdown?

     

    Cheers

     

  • 10-29-2009 09:09 AM In reply to

    Re: Cascading Dropdown list in repeating section

    I can't help with the code, but at least you know how to separate your dropdowns in the schema.

  • 10-30-2009 10:04 AM In reply to

    Re: Cascading Dropdown list in repeating section

    Thank you.

     Still my problem is not solved any other suggestions guys?

     Cheers

    Lenin

     

  • 10-30-2009 05:07 PM In reply to

    Re: Cascading Dropdown list in repeating section

    Hi -- if you are filtering a data source, and that data source is used for values for a drop down or list or something, and you change the filter.... the available data changes. So everytime you run your code, Activity List XML has the newly filtered values, and every control that uses Activity List XML for its values will only have available the current data in that data source.

    Hilary Stoupa

  • 11-23-2010 01:30 AM In reply to

    Re: Cascading Dropdown list in repeating section

    Hi,

    I'm facing the same problem.. I'm using Repeating table. And need code to filter the drop down. Do you find way to solve this problem?

    Thanks.

  • 11-23-2010 01:59 AM In reply to

    Re: Cascading Dropdown list in repeating section

    What you can do is, write a piece of code on text_changed field event, now you have to count the no of rows in repeating table and their values, then assign those values to temporary parameters, if row.count is greater than 1 then assign the values from temporary parameters to the variables according to rows. Let me know if you find some problem.

    Vishal Srivastava
    Senior Software Engineer
    SDG Software Pvt Ltd
  • 11-30-2010 06:29 PM In reply to

    Re: Cascading Dropdown list in repeating section

    Hi Vishal,

    Thanks for the reply. 

    Do you have example for this? As I'm not from programming background :(

    I tried code, which passing the value to temporary repeating field, but seems can't work because it still can't pass the value to the repeating field.

    Thanks :)

  • 08-30-2011 06:23 AM In reply to

    Re: Cascading Dropdown list in repeating section

    I also ran into the issue with repeating section not playing well with displaying values in a cascading dropdown.

    After doing some digging, I found a couple posts discussing the hidden current() function in InfoPath (I say hidden b/c you won't see this function listed through the InfoPath UI).  This function allows you to pass values from a specific row within a repeating section.  See a post from the InfoPath team here: http://blogs.msdn.com/b/infopath/archive/2004/09/13/228881.aspx

    I found other helpful posts that provides other practical examples: 

    • http://www.wiredbox.net/forum/Thread199039_Infopath_and_using_the_current_function_in_a_repeating_field_problem.aspx
    • http://social.msdn.microsoft.com/Forums/en-US/sharepointinfopath/thread/43253974-990d-4307-bf54-cc615618362a/
    Works like a charm.
    Twitter: @bobbyschang
Page 1 of 1 (10 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.