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 ForumsClientAPIClientAPILoading AnimationLoading Animation
Previous
 
Next
New Post
3/12/2006 10:51 AM
 
How would one go about creating a loading animation for the callback server side processing? Basically, I would like to set the display of a loading animation when the callback is initiated, and then hide it when it is finished. As always thanks for any advice you may have.
 
New Post
3/13/2006 9:33 AM
 

Since the callback is async this is pretty straight forward.  Right after you invoke the callback show some image (animated gif).  Inside the code for the callback handler (callbackComplete) hide the image.  You also have the option to use the statusFunc to handle this.  An example of this is how the populate on demand tree works.  http://webcontrols.dotnetnuke.com/DNNTree.aspx

 


 
New Post
3/13/2006 10:55 AM
 
I will take a look at the tree view for examples, but this is specifically what I was unsure about

Right after you invoke the callback show some image (animated gif).  Inside the code for the callback handler (callbackComplete) hide the image. 

I understand that this is what I need to do, the part I am unclear on is how to execute client side code (showing the image) before the server callback event has ever begun. I suppose one way would be to use the .RegisterClientScriptBlock, but I thought there might be a similir dnnclientapi method for such.

 
New Post
3/13/2006 11:18 AM
 

At some point you are using the GetCallbackEventReference method to obtain the script necessary for the client to perform a callback.  Typically how you handle this is by adding a client side event handler...

 

mycontrol.Attributes.Add("onclick", GetCallbackEventReference(...))

 

One option is to have your code be prefixed by your showing the image

 

mycontrol.Attributes.Add("onclick", "showWaitImage();" & GetCallbackEventReference (...))

 

Another option to send down the callback script in a variable RegisterClientVariable and obtain the script client side via dnn.getVar.  Then simply perform an eval on it... 

 

ServerSide

RegisterClientVariable(Me.Page, "myCallbackScript", GetCallbackEventReference (...), True)

mycontrol.Attributes.Add("onclick", "doMyCallback();")

 

Client Side

function doMyCallback()

{

var sCallback = dnn.getVar('myCallbackScript');

dnn.dom.getById('myworkimageid').style.display='';

eval(sCallback);

}

function callbackSuccess(result, ctx)

{

dnn.dom.getById('myworkimageid').style.display='none';

//do something with results...

}

 

With that said, probably the easiest option is to simply specify a status function when invoking the GetCallbackEventReference.

 

function callbackStatus(result, ctx)

{

if (isNaN(result))

dnn.dom.getById('myworkimageid').style.display='none'; //complete

else

dnn.dom.getById('myworkimageid').style.display='';

}

 

With that said, please note that I am only providing this info from the top of my head, the syntax may have errors, but hopefully you get the idea.


 
New Post
3/13/2006 11:33 AM
 
I think the below code is the part that I was missing. I did not realize you could assign multiple scripts there. So in this example the showWaitImage() function is executed prior to the callback processing?

mycontrol.Attributes.Add("onclick", "showWaitImage();" & GetCallbackEventReference (...))


 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPILoading AnimationLoading Animation


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