Need help with dynamic XPath Query for XmlDataSource In RCDC: Attribute_XXX doesnt seem to work
Hi, Whats the best way of dynamically querying a XMLDataSource to build the content of a drop down? Here is what I am trying to do: I have a drop down for Business Region. Based on the selection of the business region, I would like to have the list in a second drop down changed. The second drop down lists all the sites of a specific business region. To do so, the list of business regions and sites are organized as the following XML. Both the drop downs list the item source based on a XPath Query. Listing the first one is straight forward. However, not quite sure on how to automatically refresh the list of the second one based on the selection of the first. Here is the first drop down: <my:Control my:Name="BusinessRegion" my:TypeName="UocDropDownList" my:Caption="{Binding Source=schema, Path=divisionCode.DisplayName}" my:Description="{Binding Source=schema, Path=divisionCode.Description}" my:RightsLevel="{Binding Source=rights, Path=divisionCode}" my:AutoPostback="true"> <my:Properties> <my:Property my:Name="Required" my:Value="{Binding Source=schema, Path=divisionCode.Required}"/> <my:Property my:Name="ValuePath" my:Value="@Code"/> <my:Property my:Name="CaptionPath" my:Value="@Name"/> <my:Property my:Name="ItemSource" my:Value="{Binding Source=Business_Regions, Path=/Regions/BusinessRegion}"/> <my:Property my:Name="SelectedValue" my:Value="{Binding Source=object, Path=divisionCode, Mode=TwoWay}"/> </my:Properties> </my:Control> Here is the second drop down. <my:Control my:Name="BusinessSite" my:TypeName="UocDropDownList" my:Caption="{Binding Source=schema, Path=locationCode.DisplayName}" my:Description="{Binding Source=schema, Path=locationCode.Description}" my:RightsLevel="{Binding Source=rights, Path=locationCode}"> <my:Properties> <my:Property my:Name="Required" my:Value="{Binding Source=schema, Path=locationCode.Required}"/> <my:Property my:Name="ValuePath" my:Value="@Code"/> <my:Property my:Name="CaptionPath" my:Value="@Name"/> <my:Property my:Name="ItemSource" my:Value="{Binding Source=Business_Regions, Path=/Regions/BusinessRegion[@Code='%Attribute_divisionCode%']/BusinessSite}"/> <my:Property my:Name="SelectedValue" my:Value="{Binding Source=object, Path=locationCode, Mode=TwoWay}"/> </my:Properties> </my:Control> The second drop down works very well if I hard code the query as <my:Property my:Name="ItemSource" my:Value="{Binding Source=Business_Regions, Path=/Regions/BusinessRegion[@Code='FL']/BusinessSite}"/> Need some help in figuring out how to build a dynamic query. XMLDataSource: <my:XmlDataSource my:Name="Business_Regions"> <Regions> <BusinessRegion Code="" Name=""/> <BusinessRegion Code="CE" Name="Central"> <BusinessSite Code="CEN" Name="CEN"/> <BusinessSite Code="ABC" Name="Central-ABC"/> <BusinessSite Code="PQR" Name="Central-PQR"/> </BusinessRegion> <BusinessRegion Code="FL" Name="Florida"> <BusinessSite Code="XYZ" Name="Florida-XYZ"/> <BusinessSite Code="ALPHA" Name="Florida-Alpha"/> </BusinessRegion> </Regions> </my:XmlDataSource> Thanks & Regards, Jameel Syed Principal Consultant, fimGuru - Your window into simplified identities jameel.syed@fimguru.com - http://www.fimguru.com
December 31st, 2010 5:31pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics