findNodeByValue causes the '-2146823277' javascript exception

8 posts, 0 answers
  1. Camilo
    Camilo avatar
    8 posts
    Member since:
    Apr 2007

    Posted 30 Dec 2010 Link to this post

    Regards,
    I have a problem with two RadTreeview, the scenario is:
    1) In a WebUserControl, I have a radtreeview.
    2) From the WebUserControl, I calling a aspx page is loaded in a RadWindow
    3) This page contains another radtreeview
    4) Before closing the child window, it runs a function that in turn calls a function of the parent window (as is in the examples of telerik).
    5) The function of the parent window receives as argument the Treview RootNode of the child window with all the nodes that were created in the window.
    6) The function of the parent window is to be inserted into specific nodes (in the parent window treeview)newly created nodes in the child window.
    7) Therefore, from the function of the parent window, I need to use the method 'findNodeByValue' in order to know which node to insert the nodes created from the window.
    8) The first time you invoke the function works fine (ie, the window opens, new nodes are created and inserted into the treview of the parent window and then closes the window).
    9) But if I try to rerun the procedure immediately (open the window, create and insert nodes in the treeview of the parent window), it throws a javascript to use the method 'findNodeByValue'. The exception code is: '-2146823277' and the error message is: 'Can not execute code from a script Freed. "

    It is noteworthy that in shaping the RadWindow is the property 'ReloadOnShow' to True because I require it to recharge the aspx of the window every time you open.

    The truth did not find much relevant information about the javascript error and I found not applicable to the scenario that I mentioned.

    Also, to clarify that by default, is not doing a recursive search on any node since it is assumed that the child page is refreshed every time you open (and actually does).

    The next is the code of javascript function to receive the nodes and insert the nodes in the parent window treeview:

    var ArbolPresupuestoConfigurator_ReceiveData = function (nodesConfig) {
        /*
        nodesConfig is a object passed to the function  and the following is the structure of the object
            var nodesConfig = {
            nodes: null,
            level: '',
            idFlota: 0
            }
        where 'nodes' is the object that contains the root node (with child nodes) from the child window.*/


            if (nodesConfig != null) {
                switch (nodesConfig.level) {
                    case 'Flota':
                        var nodoFlota = nodesConfig.nodes.get_nodes().getNode(0)
                        if (nodoFlota != null) {
                            var esFlotaPersonalizada = nodoFlota.get_attributes().getAttribute('EsPersonalizada');
                            if (esFlotaPersonalizada == 'True') {
                                var nombreFlota = nodoFlota.get_text();
                            } else {
                                var idFlota = nodoFlota.get_value();
                                //The exception is fired here from the second time the function is called.
                                //treeArbolPresupuesto is the parent window treeview
                                var _currentNodoFlota = treeArbolPresupuesto.findNodeByValue(idFlota)
                                if (_currentNodoFlota != null) {                                
                                    if (nodoFlota.get_nodes().get_count() > 0) {
                                        treeArbolPresupuesto.trackChanges();                                    
                                        var nuevaActividad = nodoFlota.get_nodes().getNode(0);                                    
                                        _currentNodoFlota.get_nodes().getNode(0).get_nodes().add(nuevaActividad);
                                        treeArbolPresupuesto.commitChanges();
                                    }
                                }
                            }
                        }
                        break;
                    case 'Actividad':
                        break;
                    case 'Area':
                        break;
                    case 'Sistema':
                        break;
                    case 'SubSistema':
                        break;
                    case 'Material':
                        break;
                }
            }
    }
    and the code caller function from child window is:

    var wizardToolbar_HandleButtonClick = function (sender, eventArgs) {
        var button = eventArgs.get_item();
        var commandName = button.get_commandName();

        switch (commandName) {
            case 'SaveAll':
                //RootNode is the root node of the treeview in child window
                var rootNode = treeConfig.findNodeByValue('-100');
                nodesConfig.nodes = rootNode;
                GetRadWindow().BrowserWindow.ArbolPresupuestoConfigurator_ReceiveData(nodesConfig);
                GetRadWindow().close();
                break;
            case 'Cancel':
                //TODO: Pendiente implementar.
                GetRadWindow().close();
                break;
            case 'Undo':
                window.location.reload();
                break;
            case 'Help':
                //TODO: Pendiente implementar.
                break;
        }
    }
    Actually I am very upset with this problem since I have not found a solution and I promptly deliver development.

    I appreciate any help you can provide.

    Regards,

    Camilo Bernal
  2. Nikolay Tsenkov
    Admin
    Nikolay Tsenkov avatar
    734 posts

    Posted 05 Jan 2011 Link to this post

    Hi Prometeus,

    Could you, please, post something I can run and debug for you?
    Thanks!


    Regards,
    Nikolay Tsenkov
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  3. Camilo
    Camilo avatar
    8 posts
    Member since:
    Apr 2007

    Posted 05 Jan 2011 Link to this post

    e problem that the part of the code that me this failing has access to data (and does it depend from the access to data). can I send Him the code just as this and do you revise this way it?
  4. Nikolay Tsenkov
    Admin
    Nikolay Tsenkov avatar
    734 posts

    Posted 10 Jan 2011 Link to this post

    Hi Prometeus,

    "e problem that the part of the code that me this failing has access to data (and does it depend from the access to data). can I send Him the code just as this and do you revise this way it?"
     - I am sorry, but I was not able to understand what exactly do you mean by the previous two sentences. Could you, please, try to clarify that for me? Thanks!


    Regards,
    Nikolay Tsenkov
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  5. Camilo
    Camilo avatar
    8 posts
    Member since:
    Apr 2007

    Posted 11 Jan 2011 Link to this post

    Yes, Nikolay. Thank you. It is that my English is not very good and a translator use for those post previous. Unfortunately when copying and to stick it lost part of the message.  
    What meant is you that in the one post previous yours told me that it went up the code that this failing, and I answered you that unfortunately the code that this failing depends on the pattern of data that I have and of the logic of the business and he/she asked you that if anyway you wanted that he/she sent you the code so that you can help me to solve the problem.  
     
    I am attentive to your answer,  
     
    Cordially,

    Camilo Bernal
  6. Nikolay Tsenkov
    Admin
    Nikolay Tsenkov avatar
    734 posts

    Posted 14 Jan 2011 Link to this post

    Hi Prometeus,

    Could you, please, try moving all meta tags before your script tags in the documentHead.
    Please, look into this post for further explanation about the problem: http://blurbly.net/cannot-execute-code-from-a-freed-script-in-ie6_34.htm


    Regards,
    Nikolay Tsenkov
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  7. Camilo
    Camilo avatar
    8 posts
    Member since:
    Apr 2007

    Posted 14 Jan 2011 Link to this post

    Hello, initially I thought that it was however the problem that you comment, I already revise minutely the code generated by asp.net and all the metatags they are before any script label. That will be able to be?
  8. Nikolay Tsenkov
    Admin
    Nikolay Tsenkov avatar
    734 posts

    Posted 19 Jan 2011 Link to this post

    Hi Angel,

    If, indeed, all of the meta tags are in place, I can not think of any other cause for the problems.
    Please, open a support ticket and send us a runnable sample, so we can debug the problem for you.


    Regards,
    Nikolay Tsenkov
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top