RadInputmanager dispose when RadWindow should open

9 posts, 0 answers
  1. Lars
    Lars avatar
    18 posts
    Member since:
    Mar 2009

    Posted 10 Jun 2013 Link to this post

    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
  2. Lars
    Lars avatar
    18 posts
    Member since:
    Mar 2009

    Posted 11 Jun 2013 Link to this post

    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? :-/
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 12 Jun 2013 Link to this post

    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.
  5. Lars
    Lars avatar
    18 posts
    Member since:
    Mar 2009

    Posted 13 Jun 2013 Link to this post

    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


  6. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 17 Jun 2013 Link to this post

    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.
  7. Bob
    Bob avatar
    123 posts
    Member since:
    Sep 2012

    Posted 07 Aug 2013 Link to this post

    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();


  8. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 12 Aug 2013 Link to this post

    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.
  9. Lars
    Lars avatar
    18 posts
    Member since:
    Mar 2009

    Posted 12 Aug 2013 Link to this post

    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>
  10. Bob
    Bob avatar
    123 posts
    Member since:
    Sep 2012

    Posted 12 Aug 2013 Link to this post

    Thanks for replies.  I ended up just not using RadInputManager and doing some custom manual validation as I am up against a deadline.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017