callback

Waiting for javascript async callback @ http post

Hi guys, I'm implementing a small feature and kind of stuck. I have a button to execute some action, such as <input type="submit" value="My Button" onclick="javascript:DoSomething();" /> When the user clicks the button the function DoSomething is called. function DoSomething() { var geocoder = new GClientGeocoder();...

Jquery fadeOut executes callback over and over again, why is this and how can I prevent this?

My method fades a div box out and has a callback that calls a method... like this: function closeWindow(windowIdPrefix, speed) { $("#" + windowIdPrefix + "_ViewPanel").fadeOut(speed, function() { resetWindow(windowIdPrefix); numWindowsOpen--; } ); } function resetWindow(windowIdPrefix) { ...

Problem with C callback function in C# - how to pass value to a pointer?

Hi, I've a C callback defined as follows: Int16 (CALLBACK *ProcessMessage)(Uint16 ServerId, const char PTR *RequestMsg, Uint32 RequestSize, char PTR **ResponseMsg, Uint32 PTR *ResponseSize, Int16 PTR *AppErrCode); An exemple of using this callback in C: Int16 CALLBACK ProcessMessage(Uint16 ServerId, const char PTR *Request...

Assign jQuery.get() to a variable?

What is the correct way of assigning to a variable the response from jQuery.get() ? var data = jQuery.get("output.csv"); I was reading that jQuery.get() must have a callback function? why is that? and how would i use this callback function to assign the response back to the data variable? Thanks in advance for your help and clarifica...

jQuery slideToggle() callback function

Here is the jQuery slideToggle function: $('.class').click(function() { $(this).parent().next().slideToggle('slow', function() { // how can I access $('.class') that was clicked on // $(this) returns the $(this).parent().next() which is the element // that is currently being toggled/slided }); }); In th...

Equivalent of Django Signals for Rails?

In Rails, the closest I've seen to Django Signals are Observers. The problem with them is that they're restricted to triggering callbacks on hardcoded events related to a model's lifecycle. Django signals can be created anywhere, triggered anywhere and handled anywhere. The model lifecycle callbacks are just regular signals that happen ...

Is there a way to modify the callback function associated with the "talk" button on windows mobile 6.1?

My main aim is to have the windows mobile directly route international phone calls through a calling card. To do this I would need to append the calling card access number and a "pause" before the number being called, if it is an international number. It seems that this could be done at two different layers, but I am not sure how to do i...

JQuery passing parameters to function pointers

Hi all, I'm using the hoverIntent Jquery plugin and I have a question regarding callback functions. In one of my previous questions, it was pointed out that I should use function pointers for the callbacks. My question is this: how do I pass parameters to the function pointers then? function initHoverHandler(type) { var confi...

What is a callback? What is it for and how is it implemented in for example C++.

Hi, I realise this is a newbie question, but as I'm trying to learn C++ I'm stumpling upon this expression "callback" frequently. I've googled it and checked wikipedia, but without finding a good explination. I am familiar with some Java and C#, but how unlikely it sounds, I have never really understood what a callback means. If someon...

Using WCF Callback to update asp.net gridview data

I have a WCF Callback implemented in an asp.net web application using a wsdualhttpbinding that I would like to use to update the rows in a gridview on my page. I put the gridview in an update panel, and the callback is fireing on the client, but the data in the grid never gets updated. I have tried calling the update panel's Update() met...

Callback in C++, template member?

Following code does NOT work, but it expresses well what I wish to do. There is a problem with the template struct container, which I think SHOULD work because it's size is known for any template argument. class callback { public: // constructs a callback to a method in the context of a given object template<class C> callback(...

Callback in C++, template member? (2)

The following callback class is a generic wrapper to "callable things". I really like its API, which has no templates and is very clean, but under the hood there is some dynamic allocation which I was not able to avoid. Is there any way to get rid of the new and delete in the code below while maintaining the semantics and API of the cal...

How to parallelize Windows message loop and hook callback logic and the Ruby threads it creates?

I'm working on a free, simple, hopefully multi-platform hotkey launcher tool, written in Ruby. Right now I'm struggling with some threading issues of the Windows implementation. The rough proof of concept code shown below already works reliably in my day-to-day use: HotkeyProcessor#process_keypress (footnote 1) gets called by the C cod...

How can I add a PropertyChangedCallback to a dependency-property of the base class?

I have a class derived from System.Windows.Controls.UserControl, and I need to add a PropertyChangedCallback to the FrameworkElement.Margin dependency-property. How is this accomplished from my C# code? I can't find any good examples of this in MSDN. ...

skipping after_update callback

I have a model that uses after_update to log changes. There is a case where I would like to make a change to the model without activating this logging mechanism. Is there a way to pass in a parameter to after_update, or skip it all together? I would like a nice solution to this, and am willing to remove after_update if there is a better...

How to save the username who has changed one Django model using a custom track field of AuditTrail

From AuditTrail, I have this model definition: from django.db import models import audit import random def some_callback(instance): return `random.randrange(1, 99)` + 'trackable_val' class Person(models.Model): first_name = models.CharField(max_length=255) last_name = models.CharField(max_length=255) salary = models....

SwfAddress conflict with SwfObject's 'callback' argument

Hi all, For a current project we are using SwfObject 2.2 to embed flash files, and the CRD gurus are using SwfAddress 2.3 to create SEO flash goodness. Turns out that if you have both libraries included on a page, then any attempts at using SwfObject callback in the API (http://code.google.com/p/swfobject/wiki/api) prevents the SwfObje...

re-initialize jquery accordion on callback

I've got the accordion working fine on pageload, however upon user interaction with some elements on the page, I am using ajax to rebuild the HTML of the accordion. Then, I try to re-initialize the accordion again with $('#accordion').accordion({ active: false, autoHeight: false, clearStyle: true, collapsible: true, heade...

jQuery form validation plugin dependency-callback

I am using this jQuery form validation plugin: http://docs.jquery.com/Plugins/Validation/Methods I am trying to use the dependancy callback: http://docs.jquery.com/Plugins/Validation/Methods/required#dependency-callback What I am trying to do is only require "BAR" when "FOO" has a certain value. Here's a basic example: <select name="...

Implementing a callback in XML-RPC or SOAP

I am trying to get an understanding of how I can use SOAP or XML-RPC to create a remote, open API for my product. Problem is, part of my API will require me to be able to get events pushed from my server to the client - I will need to be able to "send a callback" and not only "call a function" as part of my API. Is there a good way to do...