This is a migrated thread and some comments may be shown as answers.

[Solved] RadAjaxManager, RadComboBox, FieldSet, Dynamic hiding and showing.

3 Answers 228 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 03 Apr 2008, 08:52 AM
RadAjaxManager, RadComboBox, FieldSet, Dynamic hiding and showing.

I have a RadCombpBox inside a fieldset <li>.  Below that <li> I have a  PlaceHolder with visibility set to false with an <li> isnide it.  When my RadCombo box uses ajax to call OnSelectedIndexChange I want to set the visibility of the PlaceHolder to true.  When this runs I get an client Unknown runtime error.

As a test if I rap the entire fieldset in a placeholder and set visible to false.  Then use another cobo box outside the fieldset using ajax to post back and make the outer placeholder visible.  Then i go and use the innner combo in the <li> to make the inner placholder in the <li> visible, this works ok.

PS I also cannot get the client api working this way.

Please help.

Thanks


<

telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxSettingCreating="RadAjaxManager1_AjaxSettingCreating" DefaultLoadingPanelID="RadAjaxLoadingPanel1">

<AjaxSettings>

<telerik:AjaxSetting AjaxControlID="rcbNOI">

<UpdatedControls>

<telerik:AjaxUpdatedControl ControlID="PHTest"/>

</UpdatedControls>

</telerik:AjaxSetting>

<telerik:AjaxSetting AjaxControlID="rcbShow">

<UpdatedControls>

<telerik:AjaxUpdatedControl ControlID="ShowMe"/>

</UpdatedControls>

</telerik:AjaxSetting>

</AjaxSettings>

</telerik:RadAjaxManager>

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<div id="questionset">

 

<asp:PlaceHolder ID="ShowMe" runat="server" Visible="true">

<fieldset>

<ol>

<li>

<div><telerik:RadComboBox Width="265px" ID="rcbNOI" runat="server" RadComboBoxImagePosition="Right"

AutoPostBack="true" OnSelectedIndexChanged="rcbNOI_SelectedIndexChanged" EnableEmbeddedSkins="False"

Skin="B2C">

<Items>

<telerik:RadComboBoxItem runat="server" Text="No" Value="No" />

<telerik:RadComboBoxItem runat="server" Text="Yes" Value="Yes" />

</Items>

<CollapseAnimation Duration="200" Type="OutQuint" />

<ExpandAnimation Type="OutQuart" />

</telerik:RadComboBox>

</div>

</li>

<asp:PlaceHolder runat="server" ID="PHTest" Visible="false">

<li >

<telerik:RadTextBox EnableEmbeddedSkins="False" Skin="B2C" ID="radNOI" runat="server">

</telerik:RadTextBox>

</li>

</asp:PlaceHolder>

<li>a</li>

</ol>

</fieldset>

</asp:PlaceHolder>

<telerik:RadComboBox Width="265px" ID="rcbShow" runat="server" RadComboBoxImagePosition="Right"

AutoPostBack="true" OnSelectedIndexChanged="rcbShow_SelectedIndexChanged" EnableEmbeddedSkins="False"

Skin="B2C">

<Items>

<telerik:RadComboBoxItem runat="server" Text="No" Value="No" />

<telerik:RadComboBoxItem runat="server" Text="Yes" Value="Yes" />

</Items>

<CollapseAnimation Duration="200" Type="OutQuint" />

<ExpandAnimation Type="OutQuart" />

</telerik:RadComboBox>

</

div>

</

asp:Content>

3 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 07 Apr 2008, 09:43 AM
Hello Mark,

I tried to reproduce the initial problem - when the fieldset is on the page, not in a PlaceHolder - and everything worked as expected - no error. However, the RadAjaxManager1_AjaxSettingCreating event handler was empty and in rcbNOI_SelectedIndexChanged I had the following code:

        if (e.Text == "Yes"
        { 
            this.PHTest.Visible = true
        } 
        else 
        { 
            this.PHTest.Visible = false
        } 

Could you post the code in RadAjaxManager1_AjaxSettingCreating or better - the whole server-side code which operates with the mentioned controls? I assume that the problem might be there.

Best wishes,
Simon
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Mark
Top achievements
Rank 1
answered on 07 Apr 2008, 10:22 AM
Thanks Simon,

I have stripped the page down to highlight the problem.  All the code is show below.  All I really want to do is hide/ show the placeholder in the <li> based upon the dropdown change but i get an "Unknown runtime error" in IE. Thanks for your help.

<

asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxSettingCreating="RadAjaxManager1_AjaxSettingCreating"

DefaultLoadingPanelID="RadAjaxLoadingPanel1">

<AjaxSettings>

<telerik:AjaxSetting AjaxControlID="rcbNOI">

<UpdatedControls>

<telerik:AjaxUpdatedControl ControlID="PHTest" />

</UpdatedControls>

</telerik:AjaxSetting>

</AjaxSettings>

</telerik:RadAjaxManager>

<div id="questionset">

<asp:PlaceHolder ID="ShowMe" runat="server" Visible="true">

<fieldset>

<ol>

<li>

<div>

<telerik:RadComboBox Width="265px" ID="rcbNOI" runat="server" RadComboBoxImagePosition="Right"

AutoPostBack="true" OnSelectedIndexChanged="rcbNOI_SelectedIndexChanged" EnableEmbeddedSkins="False"

Skin="B2C">

<Items>

<telerik:RadComboBoxItem runat="server" Text="No" Value="No" />

<telerik:RadComboBoxItem runat="server" Text="Yes" Value="Yes" />

</Items>

<CollapseAnimation Duration="200" Type="OutQuint" />

<ExpandAnimation Type="OutQuart" />

</telerik:RadComboBox>

</div>

</li>

<asp:PlaceHolder runat="server" ID="PHTest" Visible="false">

<li>

<telerik:RadTextBox EnableEmbeddedSkins="False" Skin="B2C" ID="radNOI" runat="server">

</telerik:RadTextBox>

</li>

</asp:PlaceHolder>

<li>a</li>

</ol>

</fieldset>

</asp:PlaceHolder>

</div>

</

asp:Content>


protected void Page_Load(object sender, EventArgs e)

{

}

protected void rcbNOI_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)

{

PHTest.Visible = (rcbNOI.SelectedValue ==

"Yes");

}

protected void RadAjaxManager1_AjaxSettingCreating(object sender, AjaxSettingCreatingEventArgs e)

{

e.UpdatePanel.RenderMode =

UpdatePanelRenderMode.Inline;

}

0
Accepted
Simon
Telerik team
answered on 09 Apr 2008, 02:07 PM
Hello Mark,

I finally managed to pinpoint the problem, something that I previously missed. You could not update only the <li> element because it is not a self-contained element.

Please try modifying the ordered list declaration like this:

<ol id="orderedList" runat="server"

Then configure the RadAjaxManager in the following way:

            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="rcbNOI"
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="orderedList" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 

After the modifications above, everything should work as expected.

Please let me know how it goes on your side.

Kind regards,
Simon
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
ComboBox
Asked by
Mark
Top achievements
Rank 1
Answers by
Simon
Telerik team
Mark
Top achievements
Rank 1
Share this question
or