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

RadInputmanager dispose when RadWindow should open

8 Answers 91 Views
Input
This is a migrated thread and some comments may be shown as answers.
Lars
Top achievements
Rank 1
Lars asked on 10 Jun 2013, 03:33 PM
Hi Telerik Team,

kind of difficult to describe, but i hope you can give me a hint...

i have a hierarchical grid, which is always in editmode.
Many dynamically generated textboxes in this grid are validated by the RadInputManager.

On a button of the page, we open a radwindow.
If the grid is opened to a deep level, we get an error when we try to open the radwindow.

TargetControls ....
protected void RadGridHierarchy_ItemCreated(object sender, GridItemEventArgs e)
        {
...
                TextBox tbVolumeTarget = ((TextBox)item["VolumeTarget"].Controls[0]);
                NumericSetting.TargetControls.Add(new TargetInput(tbVolumeTarget.UniqueID, true));
...

RadWindow:
ButtonClick ...
 
RadAjaxManager.GetCurrent(Page).ResponseScripts.Add(@"OpenProfitabilitySimulation();");           
 
JavaScript:
 
  function OpenProfitabilitySimulation() {
                var a = setTimeout('doOpenProfitabilitySimulation()', 500);
            }
 
            //Open RadWindow for profitability simulation
            function doOpenProfitabilitySimulation() {
                var oWnd = $find("<%=RadWindow_Create_Contract_ProfitabilitySimulation.ClientID %>");
                oWnd.show();
            }


With a small grid it works fine.
But when the grid gets bigger, it seems, that there is not enough time to dispose everything, before opening the window.

Following line throws the error in runtime. (NullException) 

"eval.code":
$find('ContentPlaceHolderDefault_ContentPlaceHolderMain_ctl00_CreateContractWorkflow_3_ucCreateContract_ucContractHierarchy_RadInputManager1_NumericBehavior').dispose();


Possible soulutons, which are not a good option:
- it is possible to raise the Timeout, before opening the Radwindow, (but to what? The time is depends on the client. And the Grid size)
- make a complete postback and afterwards open the radwindow, That also works fine. (but clicking two buttons is not a solution)

Do you have any other ideas?
How can i wait with the window opening, until the controls have been correctly disposed?

Is it a problem of the RadInputManager?

Thanks in advance

KR

Lars

8 Answers, 1 is accepted

Sort by
0
Lars
Top achievements
Rank 1
answered on 11 Jun 2013, 11:53 PM
By the way, i am using the newest Version of the Telerik Controls. (2013.1 417 (Apr 17, 2013)

Do i need to open a support Ticket, or do you have an Event for me? :-/
0
Vasil
Telerik team
answered on 12 Jun 2013, 03:05 PM
Hi Lars,

I am not sure what is the problem. Indeed the dispose will fail if the control is not longer in the page when the dispose method executes. But the dispose happens during the createCallback when using Ajax. So this will happen before the old HTML was removed by the new one in the updated area. And this will not be affected by request time, and it will not be affected by how many are the nested items in the grid.

Do you use some additional scripts in your page that are calling dispose?

Is it possible for you to insulate the problem in sample page and send it to us for testing and debugging here?

Regards,
Vasil
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Lars
Top achievements
Rank 1
answered on 13 Jun 2013, 12:30 PM
Hi,

it is not so easy, to make an example.

On the Page are two dynamically generated Usercontrols.
This UC are unloaded on the Ajax-Postback.

The Button is on the parent side of the Grid and the Grid is inside the Updated area.

It definitely makes a difference, when i raise the timeout of the JS Method.
That is the strange thing about this issue.

Could the dynamically generated UC cause such problems?
We have the problem since we are using the RadInputManager, because of performance issues. Without the Manager it works fine, but really slow^^

Any other ideas?

KR
Lars


0
Vasil
Telerik team
answered on 17 Jun 2013, 08:53 AM
Hello Lars,

The dynamically created User Control is unlikely to cause such issue. Without a running example that we can test, we are not able to provide you further assistance.

Regards,
Vasil
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Bob
Top achievements
Rank 1
answered on 07 Aug 2013, 02:04 PM
Vasil, did you find any resolution to your issue?  It may give me some ideas to figuring out my problem.

I am hitting this .dispose() javascript error for a RadInputManager.TextBoxSetting inside a RadWindow which is on a dynamic user control. 

0x800a138f - Microsoft JScript runtime error: Unable to get value of the property 'dispose': object is null or undefined

$find('ctl00_cphContent_CourseControl_CourseRegistrationWindow_C_InputManager_SpecialNeedsTextBoxSetting').dispose();


0
Vasil
Telerik team
answered on 12 Aug 2013, 08:42 AM
Hi Bob,

We were unable to replicate the same issue locally here. Could you share with us the code that you have problems with?
If you write us the whole CallStack when this error happens, it will be easier to tell you why it is happening. The exception itself without the CallStack does not give us much details to find out why it is happening.

Regards,
Vasil
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Lars
Top achievements
Rank 1
answered on 12 Aug 2013, 10:54 AM
Hi,

i solved the problem by disabling Ajax for the calling Button.

Maybe this could help you!?
<script type="text/javascript">
            function conditionalPostback(sender, eventArgs) {
                eventArgs.set_enableAjax(false);
            }
 </script>
 
 
<telerik:RadAjaxPanel id="RadAjaxPanel3" runat="server" clientevents-onrequeststart="conditionalPostback">
                <telerik:RadButton ID="btnProfitabilitySimulation" runat="server" Skin="Telerik" Text="Simulate" Width="90px" OnClick="btnProfitabilitySimulation_Click" Enabled="true">
                </telerik:RadButton>
</telerik:RadAjaxPanel>
0
Bob
Top achievements
Rank 1
answered on 12 Aug 2013, 01:21 PM
Thanks for replies.  I ended up just not using RadInputManager and doing some custom manual validation as I am up against a deadline.
Tags
Input
Asked by
Lars
Top achievements
Rank 1
Answers by
Lars
Top achievements
Rank 1
Vasil
Telerik team
Bob
Top achievements
Rank 1
Share this question
or