- This topic is empty.
- AuthorPosts
-
- 07/24/2012 at 7:05 am #5232
AnonymousParticipantHi Jason,
Using a qMultiSelector you can filter the data from a selector based on previous selection.
I have 2 lists, Countries(CountryID, CountryName) and Languages (LanguageID, LanguageName, CountryID).
I use a qMultiSelector with 2 selectors, first selector to display the Countries and the second selector to display the languages spoken in the country I select.
On the languages selector you need to use the properties Parent Field Name (set to CountryID) and Filter Field Name (set to CountryID).
Create these 2 lists in your env, add some data and use the following configuration in the qMultiSelector Configuration property.
One important thing I want to mention is that you need to set the property Refresh Page When Selection Change to true (checked) so the data is being refreshed while you change selections.
I'd suggest you to read the docuemntation related to qMultiSelector and if you still have questions please let me know.
<Configuration>
<PersistentSelector Title="1st" SiteUrl="." ListName="Countries" SessionName="SessionCountry" DisplayFieldName="CountryID" EmptySelectionItemName="-Select One-" EmptyDropDownItemName="<Empty>" DisplayFields="<Fields> <Field Name="CountryID" /> </Fields>" RefreshWhenSelectionChanged="true" />
<PersistentSelector SiteUrl="." ListName="Languages" Title="2nd" SessionName="SessionLanguage" DisplayFieldName="LanguageID" EmptySelectionItemName="-Select One-" EmptyDropDownItemName="<Empty>" DisplayFields="<Fields> <Field Name="CountryID" /> <Field Name="LanguageID" /> </Fields>" ParentFilterFieldName="CountryID" FilterFieldName="CountryID" />
</Configuration>
- 07/24/2012 at 9:19 am #5807
AnonymousParticipant,
Thanks for the reply. I've been reviewing the docs for both the qmultiselector and the qselector since as I understand qmulti is built off of the regular qselector and I've been using the "refresh when change" option.
As it relates to your example. I assume that within the languages list each language item can have multiple country IDs associated it to it, is that correct? That seems to be where I have problems. As long as my relationship is 1-to-1 I have no issue with selector one fitering selector two, but as soon as I create a 1-to-many relationship in the second list (languages) the filter doesn't seem to work. Does that make sense?
Thanks again.
- 07/24/2012 at 10:13 am #5808
AnonymousParticipantHi Jason,
My Countries list looks like this
CA Canada
US United States
and the list Languages looks like this
EN-CA English Canada CA
FR-CA French Canada CA
EN-US English United States US
ESP-US Spanish Unites States US
When I select US on the first selector the second would display
EN-US English United States US
ESP-US Spanish Unites States US
when I select CA then I see
EN-CA English Canada CA
FR-CA French Canada CA
This is one to many relation and it works. Just create those lists, add the values then use the my configuration from the previous post.
- 07/24/2012 at 10:55 am #4217
AnonymousParticipantHey there, new to the community … hoping some of you can help me with a qMulti-selector implementation that I can’t seem to figure out. Here’s my problem …
I have a list of items which I want to filter by category and then location. I have created three lists starting with the master item list which uses lookup fields from the category list and location list. The category and location fields are both multi-select meaning an item can be assigned to multiple categories and/or locations.
I’m attemping to use qMulti-selector to create the filters for category and location. So I configured the first selector to simply pull all the categories from the category list. The second selector for location is where the problem occurs as I want to list only the locations affiliated with that category. I’ve attempted to create that category/location relationship by adding the selected locations to the category list items and vice versa (categories to locations) by using a lookup field from the other list (again with multi-select values) but have been unable to correctly filter the secondary location selector.
As far as I can tell the problem seems to be that one you have a “multi-select” attribute the data inserted in the fields ends up like “location 1; location 2; location 3;” (or cat 1; cat 2; cat 3) so when you attempt to use the parent/child filter the data doesn’t match as its comparing location 1 to “location 1; location 2” etc.
So as a workaround I attempted to simply show all locations (no parent reference) and use the CAML filter to compare a session param using “contains” in order to filter out non-relevant locations, but no luck.
Here’s a short example of what I’m attempting to do …
Example 1Example 2Example 3CategoryLocationCategoryLocationCategoryLocationCat AN. AmericaCat BAsiaCat CEuropeAsiaEuropeS. AmericaEuropeN. AmericaS. America
Hopefully this makes some sense. I feel like I’ve waded over my head and overcomplicated the idea. Hoping one of you can help straighten me out
Thanks in advance.
- 07/24/2012 at 10:55 am #5809
AnonymousParticipantThanks I'll give it a try, but I think I see the difference between your example and how I've configured my lists. My version of list configuration (using you country/language example) would be like this:
Country List:
CA Canada
US United States
MX Mexico
Language List:
English US; CA
French CA;
Spanish US; MX;
In my language list configuration the country code field is a lookup item with the option for selecting multiple values so the data that gets put in the field isn't just a single country code but rather a delimited list of values.
Quite possible that I need to rethink my list configuration.
-
- AuthorPosts
You must be logged in to reply to this topic.