Products

Solutions

Resources

Partners

Community

About

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 ForumsClientAPIClientAPIHelp! dnnxmlhttp Control Method QuestionHelp! dnnxmlhttp Control Method Question
Previous
 
Next
New Post
3/18/2009 5:37 PM
 

First off - Jon ...thanks so much for the CodeEndeavor templates..I'm loving the potential and the learning that I've been doing as a result of messing with them. However, I'm pretty confused and hope anyone can point me in the right direction. I keep running into a problem with the following error : ' this._delegates' is undefined.

In the page init, I was using jQuery to bind a function to some list items and I thought possibly that my 'this' no longer referred to the base class (function). But, I removed the preceeding jQuery and I am continuing to get the same error. I'm sure there is a way I should be able to refer directly to the ._ctlSuccessDelegate , but I just can't seem to figure out how to make that happen.

Also, as you can see below, I had to register a client variable with the ClientID in order to get the correct namespace. I see in the AjaxPortalModuleBase where the id is set, but I can't access it from here as laid out in the "_onHello" function in the template. I'm thinking this is all due to my "this" not being what I'm assuming it to be??? but, I'm still pretty new to Javascript so I'm just not sure. Any thoughts on how I can refer to the this._delegates without using "this"" ANY HELP is greatly appreciated!!!

Thanks in Advance

 var myID = dnn.getVar("clientID");

dnn.xmlhttp.callControlMethod('Company.Modules.xEDI.ViewxEDI.' + myID,'LoadMyControlById', { clickedMenuID: this.get_clickedMenuID }, this._delegates._ctlSuccessDelegate, this._delegates._ctlFailDelegate);

 

 

 

 


Check out the open source DNN Testimonials project on CodePlex and help build it!
 
New Post
3/18/2009 6:57 PM
 

Ok, well here is what I did. I moved the function calling the controlMethod underneath the Sucess (_.ctlSuccess) and Fail (_.ctlFail) functions and called them directly....

dnn.xmlhttp.callControlMethod('Company.Modules.xEDI.ViewxEDI.' + myID,'LoadMyControlById', { clickedMenuID: this.get_clickedMenuID }, this.._ctlSuccess, this.._ctlFail);

But, the problem I am getting now is that it can't find my control method. I've verified spelling and capitalization, etc, but don't see where the problem is. I did an alert in the fail function to display the payload, ctx and req. Here is what I get:

payload: 400 - Class: ASP.desktopmodules_healthcomp_xedi_viewxedi_ascx does not have the method: LoadMyControlById

ctx: undefined

req:[object Object]

During debugging is shows the readyState as 4, status text OK and 200.

Here's what I have in the codeBehind:

  
<ControlMethod()> _
 
Public Sub LoadMyControlById(ByVal ClickedMenuItemID As Integer)
'get the control path from teh object by id

ClickedMenuID = ClickedMenuItemID 

Dim objMenuItem As EDIMenuInfo = objMenuController.GetMenuItem(ClickedMenuID)
.....blah, blah .....
 
 

Any help at all is GREATLY appreciated. I'll have to be honest with you...I wanted to stay as far away from Javascript as possible, but jQuery and the CodeEndeavor templates have got me excited about it and I never thought I would be. If I can get through this little hurdle...I'll be one happy woman.

Thanks Again for the help in advance!

 

 

 

 

 


Check out the open source DNN Testimonials project on CodePlex and help build it!
 
New Post
3/18/2009 7:54 PM
 

Briana Tarrance wrote

 

payload: 400 - Class: ASP.desktopmodules_healthcomp_xedi_viewxedi_ascx does not have the method: LoadMyControlById

 

Hi Briana,

Double check your "ControlMethodClass" and the "Descriptor.Type" settings in the codebehind. Make sure they match your javascript namespace. If all else fails, start with a fresh project and compile it, install the sample and compare the defaults with your project. I had to do this a couple times before I really go the hang of the templates.

Hopefully this will get you going, let me know if you have any other issues. Also, Firebug for Firefox is highly recommended for debugging javascripts.

EDIT: The reason I say to check those settings, is because you reference the namespace as Company.Modules.xEDI.ViewxEDI and the error I quoted above is  healthcomp_xedi_viewxedi. It's hard to tell if you have a namespace mismatch without the full source posted (or at least a little more).

 
New Post
3/19/2009 11:42 AM
 

Hi Oliver - thanks so much for the response. I'll have to admit the namespace issue has been very confusing for me through these templates.  Here is what I have in the js file:

___________________________________

Type.registerNamespace('Healthcomp'); Healthcomp.ViewxEDI = function() { ---- }
. . .
Healthcomp.ViewxEDI.prototype = {---- }
. . .
var myID = dnn.getVar("clientID");
ns = Object.getTypeName(this) + '.' + myID;
Healthcomp.Modules.xEDI.ViewxEDI.' + myID); //resolves to: Healthcomp.Modules.xEDI.ViewxEDI.dnn_ctr424_ViewxEDI
dnn.xmlhttp.callControlMethod('Healthcomp.Modules.xEDI.ViewxEDI.' + myID, 'LoadMyControlById', { clickedMenuID: this.get_clickedMenuID }, this._ctlSuccess, this._ctlFail);
. . .
Healthcomp.ViewxEDI.registerClass('Healthcomp.ViewxEDI', Sys.Component);

___________________________________

Then here is the code behind:

<ControlMethodClass("Healthcomp.Modules.xEDI.ViewxEDI")>
. . .
Descriptor.Type = "Healthcomp.ViewxEDI"
. . .
 

. . . .

<ControlMethod()> _
Public Sub LoadMyControl()
. . .
 

______________________________________

One of the things that was confusing to me is that the namespace of the module is different that the js function name and then in the AjaxPortalModuleBase it says:

Dim desc As ScriptComponentDescriptor = New ScriptComponentDescriptor("ClientNamespaceHere")
. . .
 

Initially, I thought I should change that value, but the compiled templates use that. Actually, I compiled a template and am just adding to that one until I really figured out how it all worked together. The additional properties that I have created are moving between the js file and the codebehind. (Except for the "id" property that is supposed to be set from the AjaxPortalModuleBase) So, based on what I've provided, do you see where I might be going wrong?   Hmmm....I hope this is enough information. I can post the full code if that can help. Thanks so much Oliver!!!

Briana 


Check out the open source DNN Testimonials project on CodePlex and help build it!
 
New Post
3/19/2009 11:57 AM
 

Briana Tarrance wrote

___________________________________

Then here is the code behind:

<ControlMethodClass("Healthcomp.Modules.xEDI.ViewxEDI")>
. . .
Descriptor.Type = "Healthcomp.ViewxEDI"

______________________________________

Try to change both of those to "Healthcomp.ViewxEDI" and that should hopefully fix the issue. You will also need to update the callback function name..

update: dnn.xmlhttp.callControlMethod('Healthcomp.Modules.xEDI.ViewxEDI.'
to: dnn.xmlhttp.callControlMethod('Healthcomp.ViewxEDI.'

From what I've gathered, these are the client namespaces for your project. They don't have to match the actual asp.net namespace, but they do have to match the javascript you are loading at runtime. Hopefully this Helps....

 

Briana Tarrance wrote

One of the things that was confusing to me is that the namespace of the module is different that the js function name and then in the AjaxPortalModuleBase it says:

Dim desc As ScriptComponentDescriptor = New ScriptComponentDescriptor("ClientNamespaceHere")

Initially, I thought I should change that value, but the compiled templates use that. Actually, I compiled a template and am just adding to that one until I really figured out how it all worked together. The additional properties that I have created are moving between the js file and the codebehind. (Except for the "id" property that is supposed to be set from the AjaxPortalModuleBase) So, based on what I've provided, do you see where I might be going wrong?   Hmmm....I hope this is enough information. I can post the full code if that can help. Thanks so much Oliver!!!

I noticed this as well, but everything just worked and I completely forgot about it. My photogalley module still has that exact same line of code in it's base class and it's still functioning. Hopefully Jon might chime in with an absolute answer, but for now I'd just leave it as it...

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIHelp! dnnxmlhttp Control Method QuestionHelp! dnnxmlhttp Control Method Question


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