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 ForumsClientAPIClientAPIThink I may have found an error - want to confirmThink I may have found an error - want to confirm
Previous
 
Next
New Post
9/19/2006 10:41 AM
 

okay this goes back to my posts on getting the client variables

After figuring out that this part

ClientAPI.GetCallbackEventReference(Me, "'subscribe'", "successFunc", Me.lbImg.ClientID.ToString, "errorFunc")

requires a reference to the control and not the string name/id of the control it started to work

however I notice that Firefox is now having errors with sending the control info that is referenced  back through the clientcallback  (or something)

here is my code so far (that seems to cause the problem)

ClientAPI.RegisterClientVariable(Me.Page, "ListNumber", "15", False)

ClientAPI.RegisterClientVariable(Me.Page, "LoggedOutRedirect", NavigateURL, False)

Dim MyVariable As System.Web.UI.Control = Me.Page.FindControl(ClientAPI.DNNVARIABLE_CONTROLID)

Me.lbImg.Attributes.Add("onclick", ClientAPI.GetCallbackEventReference(Me, "'subscribe'", "successFunc", Me.lbImg.ClientID.ToString, "errorFunc", MyVariable))

When this runs (the only result sent back is a string and that is used in an alert - nothing else) I get this from the Javascript Console in Firefox

Error: Element.extend is not a function
Source File: http://localhost/dnn_334/js/dnn.js
Line: 909

and my alert never comes up - the RaiseClientAPICallCallbackEvent is never fired

can anybody or Jon confirm this is an error or have I mucked something up?

TIA


Dylan Barber http://www.braindice.com - Dotnetnuke development classes - skins and modules
 
New Post
9/19/2006 11:13 AM
 

Ive always had Firefox not work 100% Is it supposed to be 100% functional?

Concerning your problem, I would love to verify but since Im not too familiar with the client api, can you give me some more detail on how to verify?


DotNetNuke Search Engine
ASP.Net Search Engine
Email me to add your favorite sites to the search List.
 
New Post
9/19/2006 1:47 PM
 

sure - at its simplest create a new module

add

Imports DotNetNuke.UI.Utilities

and implement the call back handler

Implements IClientAPICallbackEventHandler

and make sure you reference dotnetnuke.webutility

in the design add an image (not a server control but a regular image and put runat=server on it)

in the page load add this

If ClientAPI.BrowserSupportsFunctionality(ClientAPI.ClientFunctionality.XMLHTTP) AndAlso ClientAPI.BrowserSupportsFunctionality(ClientAPI.ClientFunctionality.XML) Then

ClientAPI.RegisterClientReference(Me.Page, ClientAPI.ClientNamespaceReferences.dnn)

ClientAPI.RegisterClientReference(Me.Page, ClientAPI.ClientNamespaceReferences.dnn_xml)

ClientAPI.RegisterClientReference(Me.Page, ClientAPI.ClientNamespaceReferences.dnn_xmlhttp)

End If

ClientAPI.RegisterClientVariable(Me.Page, "ListNumber", "15", False)

ClientAPI.RegisterClientVariable(Me.Page, "LoggedOutRedirect", NavigateURL, False)

Dim MyVariable As System.Web.UI.Control = Me.Page.FindControl(ClientAPI.DNNVARIABLE_CONTROLID)

Me.lbImg.Attributes.Add("onclick", ClientAPI.GetCallbackEventReference(Me, "'subscribe'", "successFunc", Me.lbImg.ClientID.ToString, "errorFunc", MyVariable))

(replace me.lbimg with your own control name)

in the html view of the design add

 

<script language="javascript">
<!--
function successFunc(result,ctx)
{
  alert (result);
 }
function errorFunc(result,ctx)
{

 alert ('failure' + result);

}
//-->
   </script>

 

thien back in the code behind

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

RETURN "Somestring"

End Function

after that build the module and set it up in a portal - now you will see it works in IE and if you open the Javascript console in Firefox that you have problems -


 Is that clear as mud??????????


Dylan Barber http://www.braindice.com - Dotnetnuke development classes - skins and modules
 
New Post
9/19/2006 4:24 PM
 
I got a fire i got to put out first....

DotNetNuke Search Engine
ASP.Net Search Engine
Email me to add your favorite sites to the search List.
 
New Post
9/20/2006 11:41 AM
 

Your code work fine for me in both FireFox and IE.  I am assuming you have a cached file in FireFox, which is creating your problem.

Regarding your using the MyVaribale as the clientid ref.  Make sure you use the right overload and you are not passing it in as your statusFunc param.  This will Not work

Me.lbImg.Attributes.Add("onclick", ClientAPI.GetCallbackEventReference(Me, "'subscribe'", "successFunc", Me.lbImg.ClientID.ToString, "errorFunc", ClientAPI.DNNVARIABLE_CONTROLID))

This will

Me.lbImg.Attributes.Add("onclick", ClientAPI.GetCallbackEventReference(Me, "'subscribe'", "successFunc", "'" & Me.lbImg.ClientID.ToString & "'", "errorFunc", "null", ClientAPI.DNNVARIABLE_CONTROLID))

 


 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIThink I may have found an error - want to confirmThink I may have found an error - want to confirm


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