Cascading multiple Selection boxes - InfoPath Dev
in

InfoPath Dev

Cascading multiple Selection boxes

Last post 03-02-2012 12:51 AM by rajkumar.bathula. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 05-21-2010 08:28 AM

    Cascading multiple Selection boxes

    Hi.

    I have cascating multiple selection boxes based on a secondary data source

      <RegionGroups>
        <RegionGroup Region="Global" Group="Global"></RegionGroup>
        <RegionGroup Region="North America" Group="Americas"></RegionGroup>
        <RegionGroup Region="South America" Group="Americas"></RegionGroup>
        <RegionGroup Region="China" Group="China"></RegionGroup>
        <RegionGroup Region="South Asia" Group="EMESA"></RegionGroup>
        <RegionGroup Region="Rest of Asia" Group="?"></RegionGroup>
        <RegionGroup Region="EMEA" Group="EMESA"></RegionGroup>
      </RegionGroups>

    The first selection box is on Region Group - When the user selects say Americas - the 2nd multiple selection box pops up with North America and South America

    If the user has selected Americas and EMESA in the first box and North America  and South Asia in the second, then changes the Region Group to China rather than America- North America stays selected.

    I can delete all of the values in the 2nd selection box - but don't know how just to delete North America.

    My main data source

    Group1
         Region (repeating field)
         RegionGroup (repeating field)

  • 05-26-2010 05:15 AM In reply to

    Re: Cascading multiple Selection boxes

    Hi Catharine,

    I'm a little confused by the <RegionGroups> and their use in dropdowns; are you saying that, even after a user selects Group=Americas, the Region dropdown shows China as an option?

    I envision a different data source for the dropdowns, something like this (it can be simplified or expanded according to your needs):

    Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}

    <RegionGroups>
        <Entry>
            <Group name=’Americas’>
                 <Regions>
                     <Region name=’North America’>
                          <Country>USA</Country>
                          <Country>Canada</Country>
                      </Region>
                      <Region name=’South America’>
                           <Country>Brazil</Country>
                           <Country>Argentina</Country>
                      </Region>
                 </Regions>
            </Group>

            <Group name=’EMESA’>
                <Regions>
                    <Region name=’South Asia’>
                          <Country>India</Country>
                          <Country>Sri Lanka</Country>
                    </Region>
                </Regions>
            </Group>
        </Entry>
        <Entry>


    This accommodates three dropdowns: Group, Region and Country. This would FORCE a user to change the first dropdown, if they want a different value in the second dropdown.
    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 05-26-2010 05:26 AM In reply to

    Re: Cascading multiple Selection boxes

    I'm having a bit of trouble parsing this sentence:

    If the user has selected Americas and EMESA in the first box and North America  and South Asia in the second, then changes the Region Group to China rather than America- North America stays selected.

    Could you describe the problem with a bit more detail?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 05-27-2010 11:45 PM In reply to

    Re: Cascading multiple Selection boxes

    Hi,

    Sorry it is difficult to describe - I have attached some screen shots.

    In the first shot, the Regional groups have been selected.  The items in Regions are dependent on the values selected.  In the second shot, Americas has been deselected so North America and South America are no longer valid values.  In the cascaded list South America has been removed (had not been selected), but Noth America is still there.  I was expecting it to be highlighted as an invalid value – or the whole selection box to be highlighted as having invalid values.  I don’t know how to achieve that.

    Catharine


  • 05-28-2010 01:34 AM In reply to

    Re: Cascading multiple Selection boxes

    I see, that makes sense.  This is happening because the filtering of the available values in a multi-select box doesn't actually change the values in the field it's bound to.  And since my:Region already has the value North America, it continues to be shown even after the filtering changes.

    The solution to this is to set the default value of my:Region to this formula:

    substring(., 1, string-length(.) * boolean(xdXDocument:GetDOM("Lookups")/Lookups/RegionGroups/RegionGroup[@Region = current()][@Group = xdXDocument:get-DOM()/my:myFields/my:SKUIntroductionGroup/my:RegionalGroup]))

    This will blank out any my:Region nodes that don't apply to the current RegionalGroup selection, and cause them to not be shown in the multi-select list box.

    This can cause blank nodes to accumulate in your XML, so if you would like to avoid this, you can add a rule to my:Region, to have qRules delete any blank my:Region nodes.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 02-02-2011 11:46 AM In reply to

    Re: Cascading multiple Selection boxes

    Hi Jimmy,

    What if I have external data source? I can't set default value if I'm using external data source. Thanks.

  • 02-02-2011 07:58 PM In reply to

    Re: Cascading multiple Selection boxes

    Yes, this is a limitation of secondary data sources.  Are you unable to add a field to the main data source to hold this value, which you can then copy to the external data source as needed?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 03-02-2012 12:50 AM In reply to

    Re: Cascading multiple Selection boxes

    Hi Jimmy

    I am also having same issue of old values persistance. please help me out. In my case, i am using two external data sources that are created using sharepoint lists. i didnt understand what "this value" from your commetns means? and also i dont know how to copy that to external data source.

    please explain.

     

    thanks

    raj

    Thank you
    Raj
  • 03-02-2012 12:51 AM In reply to

    Re: Cascading multiple Selection boxes

    Hi Catharine

    have you got any solution for this issue?

    I am very much in need of the solution. Please share if you get any.

    thanks

    raj

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