Filter combo content

A

Anders

Hi all,

I really could use some some help now....:-|.

I have a form containing two combo boxes; Products and ProductRegion. I
populate them from two SharePoint Lists called the same.

The Products Region SharePoint list have one column; Region. The Products
SharePoint list have two columns; Product and Region. The Region column is a
lookup column pointing to Region in the ProductRegion list.

I would like both lists to be fully populated initially. When a user selects
a ProductRegion I would like to filter the Products combo to show only the
products in the selected region. I cannot get this to work...

I have started with finding out what values I am comparing. If I create a
rule in the Products combo to fill out a temporary textbox with the
ProductRegion of the selected Product from the data connection, it writes
<region_id>;#<region>. Example: 1;#Europe. The ProductRegion combo writes
only the <region> to the temporary textbox. Example: Europe. I can handle
this by using the function substring-after. substring-after(@Region[Product =
@Product]; "#") gives Europe as result.

Now, if I create a rule in the ProductRegion combo to Set Fields Value with
the condition that the Products field is to be populated with Products from
from the Products data connection filtered to take only the products with the
same region as selected in the ProductRegion combo.
@Product[ProductRegion = substring-after(@Region; ";")]

I have also tried to create a filter on the Products combo to select rows
only with the same ProductRegion as the one selected in the ProductsRegion
combo.
In the Products combo, in the column definition I have created a filter that
the ProductRegion combo should equal to the function substring-after(@Region;
";").
This results in that the Products combo becomes empty what ever I choose.

Clear as mud...clear as my brain right now....

I would really appreciate any help.
Anders
 
S

S.Y.M. Wong-A-Ton

I've created two data connections from XML files with the values from your
lists. By filling the products combo and filtering it on the value selected
in the region combo, the products combo successfully shows the products
corresponding to the selected region. I used the substring-after function
just like you did, and it worked.

So filtering the products combo when populating it should be enough, using a
filter like [ProductRegion = substring-after(@Region, "#")] where
ProductRegion is the region field in your Main data source and
substring-after(@Region, "#") the region for a product in your secondary data
source.

Note that both the expressions you are trying to use contain ";" instead of
","

substring-after(@Region; ";") //<= wrong way of using substring-after

should be

substring-after(@Region, ";") //<= see the comma used after @Region?

for the substring-after function to work.
---
S.Y.M. Wong-A-Ton


Anders said:
Hi all,

I really could use some some help now....:-|.

I have a form containing two combo boxes; Products and ProductRegion. I
populate them from two SharePoint Lists called the same.

The Products Region SharePoint list have one column; Region. The Products
SharePoint list have two columns; Product and Region. The Region column is a
lookup column pointing to Region in the ProductRegion list.

I would like both lists to be fully populated initially. When a user selects
a ProductRegion I would like to filter the Products combo to show only the
products in the selected region. I cannot get this to work...

I have started with finding out what values I am comparing. If I create a
rule in the Products combo to fill out a temporary textbox with the
ProductRegion of the selected Product from the data connection, it writes
<region_id>;#<region>. Example: 1;#Europe. The ProductRegion combo writes
only the <region> to the temporary textbox. Example: Europe. I can handle
this by using the function substring-after. substring-after(@Region[Product =
@Product]; "#") gives Europe as result.

Now, if I create a rule in the ProductRegion combo to Set Fields Value with
the condition that the Products field is to be populated with Products from
from the Products data connection filtered to take only the products with the
same region as selected in the ProductRegion combo.
@Product[ProductRegion = substring-after(@Region; ";")]

I have also tried to create a filter on the Products combo to select rows
only with the same ProductRegion as the one selected in the ProductsRegion
combo.
In the Products combo, in the column definition I have created a filter that
the ProductRegion combo should equal to the function substring-after(@Region;
";").
This results in that the Products combo becomes empty what ever I choose.

Clear as mud...clear as my brain right now....

I would really appreciate any help.
Anders
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top