callback

How do I add a callback function to .submit() in Javascript?

I am submitting a page onclick of a form element and need a function to run after the submit refreshes the page. I'm trying to add an animated scroll back to the clicked element that caused the submission. I've got the scroll part covered but I can seem to figure out how to cause the function I wrote for the scroll to run after the page ...

Is it possible to design an ASP.NET website that doesn't PostBack enough?

I'm bulding an ASP.NET website just to test my skills, and I'm using lots of callbacks that doesn't require a page refresh, and the URL doesn't change. In this example, assume I'm bulding a web-based Outlook with a treeview, a grid, and a detail pane. Is there a standard (published or assumed) that says I should postback, or even updat...

callback function passing reference in jar at runtime of another class defined in another project

to pass a class ref of Demo class conatined in project B and another project suppose-A containing a callback function and parameter as passing object ref of Demo class in A.jar i want to import project A.jar in B.jar but A.jar gives compile time error as callback func def in A project contains Demo ref which is not defined in A project ...

Twisted: deferred that fires repeatedly?

Deferreds are a great way to do asynchronous processing in Twisted. However, they, like the name implies, are for deferred computations, which only run and terminate once, firing the callbacks once. What if I have a repeated computation, like a button being clicked? Is there any Deferred-like object that can fire repeatedly, calling all ...

Nested ajax calls not working in IE7

Hi all, I have nested ajax calls that are not working in ie7. They work fine in Firefox. The service file in the second $.post is not being entered at all. In other words, if the first line of my service file is print 'hello'; I never see it...even if I add a console.log in the $.post for the response. I have seen this issue in other pla...

Object-Oriented Callbacks for C++?

Hi! Is there some library that allows me to easily and conveniently create Object-Oriented callbacks in c++? the language Eiffel for example has the concept of "agents" which more or less work like this: class Foo{ public: Bar* bar; Foo(){ bar = new Bar(); bar->publisher.extend(agent say(?,"Hi from Foo!", ?));...

newbie approach: what is a javascript callback function ?

Is just a function that executes after one other function that calls it, finishes? Please I know (almost) nothing about programming, and I find it quite hard to find a proper newbie answer or explanation about what does this means. Can I request a try from stackoverflow gurus? :) K. Regards, MEM ...

Variable visibility in callbacks functions.

I did this function for get results of a query directly in an useful datastructure. The problem is the follow: in the first console.log() call , inside the callback function, the stored_data var contains the exact results, in the second console.log() call the stored_data variable looks like not initialized. Suggestions?? Below the code: ...

Passing more than one argument to a callback function (using PHP 5.2)

I'm writing a content management system. The page admin enters content for a page and, when he enters a number surrounded by special characters, it's replaced by a database entry on the viewer's screen when parsed. To accomplish this in the parsing, I'm using preg_replace_callback(). However, I can't pass my database connection variab...

python Ctype : problem with callback in making python custom library

The whole scenario is like this: there is a function setmessagelistener(a_structure,function_pointer) in my c library. i am writing a python library which is a wrapper on above mentioned c library using Ctypes. so what i did is something like this: def setlistener(a_structure,function_pointer) listenerDeclaration = CFUNCTYPE(c_void...

Can a PHP callback accept its parameter(s) by reference?

I've tested the following and it works on both PHP 5.2 and 5.3, however, it's not documented anywhere as far as I can see so I'm evaluating its use. I have a function in a class called isValid, this checks a hash to see if the given value is in the set of allowed values. There are some values that are valid, but deprecated; I'd like my ...

PyArg_ParseTuple and a callback function pointer

I have code like the following: PyObject *callback; PyObject *paths; // Process and convert arguments if (!PyArg_ParseTuple(args, "OO:schedule", &paths, &callback)) return NULL; What exactly happens inside PyArg_ParseTuple? My guess is that callback gets the function pointer I passed to args (also PyObject...

How to test callbacks with NUnit

Is there any special support when you come to test callbacks with NUnit? Or some kind of of "best practice" which is better than my solution below? I just started writing some tests and methods, so I have still full control - however I think it might be annoying if there are better ways to test callbacks thoroughly, especially if comple...

before_destroy is not firing from update_attributes

I have a student that has many courses. In the student#update action and form, I accept a list of course_ids. When that list changes, I'd like to call a certain function. The code I have does get called if the update_attributes creates a course_student, but does not get called if the update_attributes destroys a course_student. Can I get...

Loading javascript asynchronously - How to do callbacks?

I am building a javascript widget that should load asynchronously. Problem is that there can be more than 1 of these widgets on the page and that the widget should be initialized by sending it an option array via {}. What is the best way to accomplish this? I heard that simply setting onload or onreadystatechange does not work in all b...

Is there a better method than setting a variable to this?

In my javascript objects i found myself writing this: this_object = this; It seems it's the only way to pass member variables to external functions... google.maps.event.addListener(this.marker, 'click', function() { this.info_window.setContent('Chicago marker'); this.info_window.open(this.map,this.marker); }); That doesn't ...

How do I continually monitor for new TCP clients?

I have a TCP server that continually monitors for new incoming clients asynchronously and adds them to a client list: public class TcpServer { public List<TcpClient> ClientsList = new List<TcpClient>(); protected TcpListener Server = new TcpListener(IPAddress.Any, 3000); private _isMonitoring = false; public TcpServer()...

Required field Validation implementation Client Callback asp.net

I have a grid which have required field validation. This grid is repopulated when user clicks on Add in pop up and saves, it repoulates the grid of the parent page using Client Callback mechanism. At this point it does bind required field validation at all. There is post which discuss about the behaviour but it does not specify about Req...

CFNetwork packet read callback not being called (iPhone)

Running on the iPhone simulator, I am listening on a port for packets, but my callback never gets called (and the packets are being sent for sure, checked with wireshark). Simplified code follows: #define IN_PORT (51112) static void ReadCallback (CFSocketRef theSocket, CFSocketCallBackType theType, CFDataRef theAddress, const void *da...

Using Mockito, how do I intercept a callback object on a void method?

I'm using mockito to test a legacy JAAS/LDAP login module. The javax.security.auth.callback.CallbackHandler interface defines the function: void handle(javax.security.auth.callback.Callback[] callbacks) I'm expecting callbacks to contain a NameCallback, which is the object that needs to be manipulated to pass the test. Is there a wa...