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

RADAjaxManager Not Updating Controls

4 Answers 306 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Ben
Top achievements
Rank 1
Ben asked on 29 Dec 2014, 07:33 PM
I have been trying to fix this for nearly a week now, and I am completely at a loss as to why this is not working. I am at my wits end and I need help.

I am creating a "Composite Control". Inside the CreateChildControls() method I have the following code...
'***************************************
' Clear The Controls Collection
'***************************************
Me.Controls.Clear()
 
'***************************************
' Create Container Panel(s)
'***************************************
Me._panelContainer = New Panel
With Me._panelContainer
    .ID = "panelMainContainer"
End With
 
'***************************************
' Create Message PlaceHolder
'***************************************
Me._phPlaceHolder = New PlaceHolder
With Me._phPlaceHolder
    .ID = "phPlaceHolder"
End With
 
'***************************************
' Add Controls Directly To Container
'***************************************
With Me._panelContainer.Controls
    '***************************************
    ' Add Message Placeholder
    '***************************************
    .Add(Me._phPlaceHolder)
 
    '***************************************
    ' Create AJAX Controls
    '***************************************
    If (Me.UseAjax) Then
        '***************************************
        ' Define RADAJAXLoadingPanel
        '***************************************
        Me._panelRADAjaxLoading = New RadAjaxLoadingPanel
        With Me._panelRADAjaxLoading
            .ID = "panelRADAjaxLoading"
            .Skin = "Default"
            .EnableSkinTransparency = True
            .BackgroundPosition = AjaxLoadingPanelBackgroundPosition.Center
        End With
 
        '***************************************
        ' Add Loading Panel
        '***************************************
        .Add(Me._panelRADAjaxLoading)
    End If
 
    '***************************************
    ' Add Control Design To Panel
    '***************************************
    .Add(Me.CreateControlDesign())
End With
 
'***************************************
' Add Main Panel Container To Base Control
'***************************************
Me.Controls.Add(Me._panelContainer)
 
'***************************************
' Call Base Class Method
'***************************************
MyBase.CreateChildControls()

The CreateControlDesign() method has the following code...
Private Function CreateControlDesign() As Control
    '***************************************
    ' Initialize Variables
    '***************************************
    Dim objTable_Main As CodeLibrary.HTMLTableBuilder
 
    '***************************************
    ' Default Values
    '***************************************
    Me._cboRoleGroups = New DropDownList
    Me._chkRoles = New CheckBoxList
    Me._cmdClearSelection = New LinkButton
    Me._lblTotalSelectedRoles = New Label
 
    '***************************************
    ' Initialize Controls
    '***************************************
    With Me._cboRoleGroups
        .ID = "cboRoleGroups"
        .AutoPostBack = True
    End With
    With Me._chkRoles
        .ID = "chkRoles"
        .AutoPostBack = True
    End With
    With Me._cmdClearSelection
        .ID = "cmdClearSelectedRoles"
        .Text = "Clear Selected Roles"
    End With
    With Me._lblTotalSelectedRoles
        .ID = "lblTotalSelectedRoles"
        .Text = "{0} Roles Selected"
    End With
 
    '***************************************
    ' Main Container Table
    '***************************************
    objTable_Main = New CodeLibrary.HTMLTableBuilder
    With objTable_Main
        '***************************************
        ' Set Table Properties
        '***************************************
        .Table.ID = "tblMain"
        If (Me.UseDNNFormItemClass) Then .Table.CssClass = "dnnFormItems"
 
        '***************************************
        ' Row: 01 (Role Group Selector)
        '***************************************
        .NewRow()
        With .CurrentRow
            '***************************************
            ' Cell 01: cboRoleGroups
            '***************************************
            objTable_Main.NewCell()
            With objTable_Main.CurrentCell
                '***************************************
                ' Set Cell Properties
                '***************************************
                If (Me.UseDNNFormItemClass) Then .CssClass = "dnnFormItem"
                .Width = New Unit(0, UnitType.Pixel)
 
                '***************************************
                ' Add Control(s) To Cell
                '***************************************
                .Controls.Add(Me._cboRoleGroups)
            End With
            objTable_Main.CommitCell()
 
            '***************************************
            ' Cell 02: Spacer
            '***************************************
            objTable_Main.NewCell()
            With objTable_Main.CurrentCell
                .Width = New Unit(10, UnitType.Pixel)
            End With
            objTable_Main.CommitCell()
 
            '***************************************
            ' Cell 03: lblTotalSelectedRoles
            '***************************************
            objTable_Main.NewCell()
            With objTable_Main.CurrentCell
                '***************************************
                ' Set Cell Properties
                '***************************************
                .Width = New Unit(100, UnitType.Percentage)
 
                '***************************************
                ' Add Control(s) To Cell
                '***************************************
                .Controls.Add(Me._lblTotalSelectedRoles)
            End With
            objTable_Main.CommitCell()
        End With
        .CommitRow()
 
        '***************************************
        ' Row: 02 (Clear Selection Button)
        '***************************************
        .NewRow()
        With .CurrentRow
            '***************************************
            ' Cell 01: Data Entry Control
            '***************************************
            objTable_Main.NewCell()
            With objTable_Main.CurrentCell
                '***************************************
                ' Set Cell Properties
                '***************************************
                If (Me.UseDNNFormItemClass) Then .CssClass = "dnnFormItem"
                .ColumnSpan = 3
 
                '***************************************
                ' Add Control(s) To Cell
                '***************************************
                .Controls.Add(Me._cmdClearSelection)
            End With
            objTable_Main.CommitCell()
        End With
        .CommitRow()
 
        '***************************************
        ' Row: 03 (Role Selector)
        '***************************************
        .NewRow()
        With .CurrentRow
            '***************************************
            ' Cell 01: Data Entry Control
            '***************************************
            objTable_Main.NewCell()
            With objTable_Main.CurrentCell
                '***************************************
                ' Set Cell Properties
                '***************************************
                If (Me.UseDNNFormItemClass) Then .CssClass = "dnnFormItem DCCRemoveLabelContraints"
                .ColumnSpan = 3
 
                '***************************************
                ' Add Control(s) To Cell
                '***************************************
                .Controls.Add(Me._chkRoles)
            End With
            objTable_Main.CommitCell()
        End With
        .CommitRow()
    End With
 
    '***************************************
    ' Return Final Value
    '***************************************
    Return objTable_Main.Table
End Function


In the CompositeControl's Page_Load() event, I have the following code...
'***************************************
' Register Controls w/ RADAJAXManager
'***************************************
If (Me.UseAjax) Then
    Dim objRADAjaxManager As RadAjaxManager = Me.RADAjaxManager
    If ((objRADAjaxManager IsNot Nothing) AndAlso (Me.Visible)) Then
        With objRADAjaxManager.AjaxSettings
            '***************************************
            ' Set AJAX Update Triggers
            '***************************************
            .AddAjaxSetting(Me._cboRoleGroups, Me._panelContainer, Me._panelRADAjaxLoading)
            .AddAjaxSetting(Me._cmdClearSelection, Me._panelContainer, Me._panelRADAjaxLoading)
            .AddAjaxSetting(Me._chkRoles, Me._panelContainer, Me._panelRADAjaxLoading)
            .AddAjaxSetting(Me._chkRoles, Me._chkRoles)
            .AddAjaxSetting(Me._chkRoles, Me._lblTotalSelectedRoles)
        End With
    End If
End If

When I use the control, everything renders fine on the initial load. When I update the value of any of the internal controls, I see the RADAJAXLoadingPanel appear for a second with the spinning circle as I expect to see. Then the loading panel vanishes and none of the internal control values update based on the code I have. I stepped through the code and the CheckBoxList is getting new values, and so is the label...but the changes are not being displayed.

Any ideas? Please help! This has been driving me nuts and is causing a significant delay in my development schedule.

-Ben

4 Answers, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 01 Jan 2015, 12:20 PM
Hello Ben,

From the provided code snippets and information it would be difficult to determine what could cause the issue on your end, but since the RadAjaxLoadingPanel is displaying correctly, this means that the AJAX is enabled correctly. If there was a major issue with the AJAX settings, a full postback should be observed.

Can you please ensure that your initiators and updated controls are correctly set?

If you need any further assistance with this, please open a regular support ticket, along with a sample, runnable project that replicates the same behavior, so we can test it locally and isolate the root of the problem.


Best Regards,
Konstantin Dikov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Gary Goodwin
Top achievements
Rank 1
answered on 08 Jan 2015, 04:15 PM
I am having the same problem with one difference.

I have visual studio connected to my IIS website. When I run visual studio it works fine. When I run directly from IIS
the radloadingpanel shows quickly however the grid does not update. I have absolutely no idea how to fix this I have tried everything.

Gary

Very Frustrated - app is working in dev not prod

909-631-1017 please call
0
Konstantin Dikov
Telerik team
answered on 08 Jan 2015, 04:33 PM
Hi Gary,

Can you please inspect your browser's console and see if there are any errors on the page, once you initiate a postback? If the loading panel is displaying as expected and the issue is with the update of the grid only, I could only speculate that there is some error that is preventing the update. 

If you continue to experience issues with this, please open a regular support ticket and elaborate on your exact scenario. Additionally, if you can prepare a sample, runnable projec replicating the issue on your end, thus will allow us to test it locally and see if we can observe the same issue.


Best Regards,
Konstantin Dikov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Ben
Top achievements
Rank 1
answered on 08 Jan 2015, 04:38 PM
Update:

I figured out what my issue was. Since this was AJAX based...there was a "behind the scenes error" that was occurring, but even debugging the code did not reveal any errors. It took a while, but I found it... I was loading some CSS Styles using Server-Side code to override DNN's CSS in only certain situations. Apparently the method being used to load the CSS code using server-side code differs is you are processing during a Full-Postback or a Partial-Postback. Once I fixed how I was loading this injected code, the AJAX update worked perfectly fine.

-Ben
Tags
Ajax
Asked by
Ben
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Gary Goodwin
Top achievements
Rank 1
Ben
Top achievements
Rank 1
Share this question
or