Monday, March 26, 2012

CascasCadingDropdown problem

I have a ccd with 3 dropdowns in it, with 2 of the dropdowns(ddlLocatie and ddlPersoon) beingdependant on the first one (ddlAfdeling). I set the selectedvaluepropertydynamically when the page loads. I usecddAfdLoc.TargetProperties(0).SelectedValue = <variable> to dothis. The ddl's are getting their values from a database.

The issue i have is the following: ddlLocatie doesn't want topopulate while ddlPersoon populates just fine when the pageloads. When i select another value manually from ddlAfdeling,everything populates without problems. If i don't set it dynamicallyand simply select manually after the page has loaded everything worksfine, both ddlLocatie and ddlPersoon get enabled and populated. Is what i'm trying to do not supported maybe?

<%@dotnet.itags.org. Page Language="VB" EnableEventValidation="false" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<%@dotnet.itags.org. Register Assembly="AtlasControlToolkit" Namespace="AtlasControlToolkit" TagPrefix="atlasToolkit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<atlas:ScriptManager ID="ScriptManager1" runat="server" />
<div>
<p>
Afdeling:<br />
<asp:DropDownList ID="ddlAfdeling" runat="server" Width="205px">
</asp:DropDownList>
</p>
<p>
Locatie: <br />
<asp:DropDownList ID="ddlLocatie" runat="server" Width="205px">
</asp:DropDownList>
</p>
<p>Gebruiker:<br /><asp:DropDownList ID="ddlPersoon" runat="server" Width="205px">
</asp:DropDownList>
</p>
<atlasToolkit:CascadingDropDown ID="cddAfdLoc" runat="server">
<atlasToolkit:CascadingDropDownProperties TargetControlID="ddlAfdeling" Category="afdeling" PromptText="kies" ServicePath="wsTD.asmx" ServiceMethod="GetAfd" />
<atlasToolkit:CascadingDropDownProperties TargetControlID="ddlLocatie" Category="locatie" PromptText="kies" ServicePath="wsTD.asmx" ServiceMethod="GetLocatie" ParentControlID="ddlAfdeling" />
<atlasToolkit:CascadingDropDownProperties TargetControlID="ddlPersoon" Category="persoon" PromptText="kies" ServicePath="wsTD.asmx" ServiceMethod="GetPers" ParentControlID="ddlAfdeling" />
</atlasToolkit:CascadingDropDown>
</div>
</form
</body>
</html>

Yes, I think this will be supported withwork item 1704.
Great, thx a lot :)
Note that I checked a fix for this in on Friday. It should be available in CodePlex changes 3611 and later. If you want to give it a try, I'd love to know if that change doesn't work for you!

Hello David,

Sorry for the late reply, i've only now been able to get back to this.

I've been looking through the CascadingDropDown.js file and was only able to locate

_parentElement.childDropDown = this

on line 57, not on line 61 like it said in the post.

also, i could not locate this piece of code to change

if (e.childDropDown && !gettingList) {
e.childDropDown._onParentChange();
}
Is this in a different js file or am i using a different version from him? I've got the July CTP installed.

Sounds like you have a different version, perhaps. I believe my code changes can be applied to the code that ships with the 60731 release of the Toolkit. Alternatively, any of the recent development releases should already have the changes in them.

Where could i check the version number?

I'll download the latest dev release as well.


The version number should be on the default page of the SampleWebSite. You can get recent development releaseshere.

No comments:

Post a Comment