Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPICallBack & LoadControl & 404-Control Not foundCallBack & LoadControl & 404-Control Not found
Previous
 
Next
New Post
5/23/2006 11:43 AM
 

The difference between what you are trying to accomplish and what my blog post discusses is your sample is trying to use a callback that is not under your control.  It is encapsulated in the tree.  This does not leave you with many options.  One however, would be to simply move your code that loads the child control (in the container) from the Page_Load event handler to the OnInit.

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

MyBase.OnInit(e)

'Put user code to initialize the page here

Dim objModule As Entities.Modules.PortalModuleBase = _

CType(LoadControl(Me.ModulePath & "/DNNTreeTest.ascx"), Entities.Modules.PortalModuleBase)

'Add the Control to the page

If Not objModule Is Nothing Then

objModule.ModuleConfiguration = Me.ModuleConfiguration

Controls.Add(objModule)

End If

End Sub

This will allow the child control to be loaded when the callback comes in.


 
New Post
5/23/2006 1:22 PM
 

Jon,

This does work for the treeview within the child, thanks! I appreciate your time!!

Unfortunately, Another issue is created.  I have "regular" callbacks on the child, which are successfully delegated from the container, however during the callback the ClientID of controls on the child page only have the control ID in them.  (I.E. txtCompName vs. dnn_ctr414_CHAS_Container__ctl0_txtCompName) I am using the ClientID in javascript once the callback is returned to the client and, of course, dnn.dom.getById() fails.

I have just started to look at a resolution for the new issue.  Any thoughts?

 
New Post
5/23/2006 4:14 PM
 

not knowing how your "regular" callbacks are set up, meaning what event on what element triggers the callback, and what element are you doing a lookup on makes this a little difficult to offer a solution.  If it happens to be the same element then the answer is simple.  Store the object reference to the element in the context.  If they are different, then you probably will need to send down the container's namespace (i.e. dnn_ctr414_CHAS_Container__ctl0_) in a variable and retrieve it on the client (dnn.getVar)...

 


 
New Post
5/23/2006 5:20 PM
 

I gave some more info below. I also had the idea about saving the containers namespace, and it works fine. Thanks!!

More Info:  On a treenode.JSFunction a callback is set, during the callback a database call is done to get values for other on screen elements, the callback sends CllientID/Value pairs to the client, and the client Javascript sets ClientID = Value.  As an exmaple, the treenode element that triggers the callback is a Company, when the user clicks on the Company treenode a panel shows that is populated with all the related company data to be edited.

In the callback: txtCompName.ClientID & ClientAPI.COLUMN_DELIMITER & Company.DESC
In the dnn.dom.getById(strRets[i]).value = strRets[i+1];

 

 
New Post
8/8/2006 11:19 AM
 

Just a follow up.  After some trial and error, I modified the initial approach of loading a child control within this thread to get a best of all worlds approach.  This allows the embedded treeview callbacks and "regular" callbacks to be handled and the ClientID to be properly populated.

Notice the use of a Class level variable, objModule, to hold the control being loaded in the OnInit(). Then in  RaiseClientAPICallbackEvent() the objModule variable is used to raise the proper event in the Child control. All of the following code is in the parent/container control.

Private objModule As Entities.Modules.PortalModuleBase

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

      objModule =
CType(LoadControl(Me.ModulePath & "Controls/Base/" & "MainMenu.ascx"), Entities.Modules.PortalModuleBase) 'Add the Control to the page
      If
Not objModule Is Nothing Then
         objModule.ModuleConfiguration =
Me.ModuleConfiguration
         Controls.Add(objModule)

      End
If

   Catch
ex As Exception
      ProcessModuleLoadException(
Me, ex)
   End
Try
End
Sub


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

   'Raise the callback event in the Child control
   Return
CType(objModule, IClientAPICallbackEventHandler).RaiseClientAPICallbackEvent(eventArgument)
End
Function

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPICallBack & LoadControl & 404-Control Not foundCallBack & LoadControl & 404-Control Not found


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, 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 DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out