Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jeppe Andreasen 10 posts 30 karma points
    Sep 12, 2012 @ 12:56
    Jeppe Andreasen
    0

    Custom section messes up on secondary loads

    I don't know if this is a problem with my tree loader, but when I switch back and fourth between my custom section and the content section, each time the text of the individual tree nodes is appended with the combined text of my treenodes. So I have to refresh the browser to get the right text again. Here is my treeloader:

    public class DeploymentLoader : BaseTree
        {
            public DeploymentLoader(string application) : base(application)
            {
               
            }

            protected override void CreateRootNode(ref XmlTreeNode rootNode)
            {
                rootNode.Icon = FolderIcon;
                rootNode.OpenIcon = FolderIconOpen;
                rootNode.NodeType = "init" + TreeAlias;
                rootNode.NodeID = "init";
            }

           
            public override void Render(ref XmlTree Tree)
            {
                var createDeploymentPackage = XmlTreeNode.Create(this);
                createDeploymentPackage.Text = "Create Deployment Package";
                createDeploymentPackage.Icon = "docPic.gif";
                createDeploymentPackage.Action = "javascript:openCreateDeploymentPackage()";
                // Add the node to the tree
                Tree.Add(createDeploymentPackage);

                var installDeploymentPackage = XmlTreeNode.Create(this);
                installDeploymentPackage.Text = "Install Deployment Package";
                installDeploymentPackage.Icon = "docPic.gif";
                installDeploymentPackage.Action = "javascript:openInstallDeploymentPackage()";
                // Add the node to the tree
                Tree.Add(installDeploymentPackage);
            }

            public override void RenderJS(ref StringBuilder Javascript)
            {
                Javascript.Append(@"
                    function openCreateDeploymentPackage() {
                        parent.right.document.location.href = '/handlers/BuildPackage.aspx';
                    }
                ");

                Javascript.Append(@"
                    function openInstallDeploymentPackage() {
                        parent.right.document.location.href = '/handlers/InstallPackage.aspx';
                    }
                ");
            }
        }

Please Sign in or register to post replies

Write your reply to:

Draft