Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

Affordable ASP.NET Hosting Service
  Ads  
 


  Sponsors  

Meet Our Sponsors

MaximumASP
SourceGear - Tools for Developers
.: CounterSoft :.
telerik
ExactTarget email software solutions
Merak Mail Server
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  ClientAPI Compo...  DNNTree
Previous Previous
 
Next Next
New Post 2/3/2006 5:49 AM
User is offline cent_usr
88 posts
10th Ranked


DNNTree 
I have a problem as I try to run the DNNTree from an .ASPX page within DotNetNuke. Everything seems to go fine, I look in the generated HTML and it's all there. However, I get a Javascript error on this line

       }

       for (var i=0; i<oNode.childNodeCount(); i++) //recursively call child rendering
             
this.renderNode(oNode.childNodes(i), oChildCont);
}

Ther error is 'null' is null or not an object . Seems some scripts are missing as it seems some initialization has not been performed. Since I'm doing this from a ASPX page unherited from UI.Page I'm using

Protected Overrides Sub OnInit(ByVal e As System.EventArgs)
      MyBase.OnInit(e)
      DotNetNuke.UI.Utilities.ClientAPI.HandleClientAPICallbackEvent(
Me.Page)
End Sub

The .aspx page loads the DNNTree as a userControl but it seems like the HTML is ok, the tree is generated, just not rendered through the javascript due to the break above.

Any light's on the above would be welcomed.

Cheers,
/Rob

 
New Post 2/3/2006 8:45 AM
User is offline Jon Henning
1622 posts
www.codeendeavors.com
5th Ranked










Re: DNNTree 
Hard to say without seeing the whole code.  Let me suggest downloading the sampleapp I have written showcasing all the controls outside of dotnetnuke.  A live example of these controls can be found here.  Hopefully by comparing your code to mine you can find the solution.
 
New Post 2/9/2006 12:55 AM
User is offline cent_usr
88 posts
10th Ranked


Re: DNNTree 
Modified By cent_usr  on 2/9/2006 9:20:52 AM)

I'm trying to get callback to work with the DNNTree. I don't know why this is not working.
I have tried to make my own clientside function and it works. like

DNNTree.JSFunction = "Test(this.node.id)" 

I get the node.id as expected, however as I use

.JSFunction = ClientAPI.GetCallbackEventReference(Me.Parent.Parent, "this.node.id", "successFunc", "this.node", "errorFunc")

If does not.

Any ideas?
Thanks,
/Rob

 
New Post 2/9/2006 3:12 PM
User is offline Jon Henning
1622 posts
www.codeendeavors.com
5th Ranked










Re: DNNTree 

You problem is in the assumption that this contains the node that was clicked.  Instead this contains a reference to the treeview control itself.  To get a reference to the selected node you would use this.selTreeNode.

What I am confused about is the statement that your first example worked... I don't see how it could.  Here is a complete example (separate from DNN).

ASPX


<%@ Page Language="vb" AutoEventWireup="false" Codebehind="DNNTreeCallback.aspx.vb" Inherits="DotNetNuke.WebControls.Test.DNNTreeCallback"%>

<%@ Register TagPrefix="DNN" Namespace="DotNetNuke.UI.WebControls" Assembly="DotNetNuke.WebControls" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML>

     <HEAD>

<script language=javascript>

<!--

     function callbackSuccess(result, ctx)

     {

          alert(result);

          alert(ctx.key);    //NodeID

     }

     function callbackError(result, ctx)

     {

          alert(result);

     }   

//-->

</script>

 

     </HEAD>

     <body MS_POSITIONING="GridLayout">

          <form id="form1" method="post" runat="server">

              <DNN:DNNTree id="MyDNNTree" runat="server" TreeScriptPath="js/"></DNN:DNNTree>

          </form>

     </body>

</HTML>

 


CodeBehind


Imports DotNetNuke.UI.WebControls

Public Class DNNTreeCallback

     Inherits System.Web.UI.Page : Implements DotNetNuke.UI.Utilities.IClientAPICallbackEventHandler

 

#Region " Web form Designer Generated Code "

 

     'This call is required by the Web form Designer.

     <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

 

     End Sub

     Protected WithEvents MyDNNTree As DotNetNuke.UI.WebControls.DnnTree

 

     'NOTE: The following placeholder declaration is required by the Web form Designer.

     'Do not delete or move it.

     Private designerPlaceholderDeclaration As System.Object

 

     Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init

          'CODEGEN: This method call is required by the Web form Designer

          'Do not modify it using the code editor.

          InitializeComponent()

     End Sub

 

#End Region

 

     Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

          'Put user code to initialize the page here

 

          Dim oNode As TreeNode = New TreeNode("ROOT")

          Me.MyDNNTree.TreeNodes.Add(oNode)

          Dim oNode2 As TreeNode = New TreeNode("DoCallBack")

          oNode2.Key = "MyKey"

          oNode2.ID = "MyID"

          oNode2.JSFunction = DotNetNuke.UI.Utilities.ClientAPI.GetCallbackEventReference(Me, "this.selTreeNode.id", "callbackSuccess", "this.selTreeNode", "callbackError")

          oNode.TreeNodes.Add(oNode2)

 

     End Sub

 

     Protected Overrides Sub OnInit(ByVal e As System.EventArgs)

          MyBase.OnInit(e)

          DotNetNuke.UI.Utilities.ClientAPI.HandleClientAPICallbackEvent(Me)

     End Sub

 

     Public Function RaiseClientAPICallbackEvent(ByVal eventArgument As String) As String Implements UI.Utilities.IClientAPICallbackEventHandler.RaiseClientAPICallbackEvent

          Return eventArgument & " " & Now.ToString

     End Function

End Class

 

 

 


 
New Post 2/9/2006 3:40 PM
User is offline cent_usr
88 posts
10th Ranked


Re: DNNTree 

Thanks again Jon, I knew I figured that selTreeNode out previously, but obviously that did not stick in my head long enough. It now delivers the key value I'm after and the RaiseClientAPICallbackevent is called. All systems green.

It seems like using the JSFunction cancels out the.ClickAction = eClickAction.Expand I guess I have to do this manually in the SuccessFunc.

Thanks Jon!

 
Previous Previous
 
Next Next
  Forum  DotNetNuke® Pro...  ClientAPI Compo...  DNNTree
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


UK - DotNetNuke providers
UK providers of DNN module development and skin package design. Oxford Information Labs provides cost-effective solutions for businesses and organisations specialising in Skin design and bespoke module development.
www.oxil.co.uk
TronixSoft
Hosting for local businesses that want more from their websites.
www.TronixSoft.com
The Forerunner Network
The Forerunner Network consists of a group of Dynamic Website & Interactive Membership Portal hosting services that are managed by Forerunner Communications. Our services span a wide range of markets and enable individuals, organizations and businesses to build and manage dynamic, interactive portals and websites.
The Forerunner Network

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP