Hello,
I'd like to have two Threads. Let's call them :
Thread A
Thread B
Thread A fires an event and thread B listen to this event.
When the Thread B Event Listener is executed, it's executed with the Thread A's thread ID, so i guess it is executed within the Thread A.
What I'd like to do is be able to fire event to Thread B sayin...
I need to get all input elements within a div and then attach event handlers, so that whenever values change it updates a hidden field. Children elements within the div might already contain event handlers, if so the attach should chain it.
Any help is much appreciated.
...
I have a main class in a program that launches another class that handles all the GUI stuff.
In the GUI, i have a button that i need to attach an ActionListener to.
The only problem is, the code to be executed needs to reside within the main class.
How can i get the ActionPerformed() method to execute in the main class when a button is...
I am posting to the server using jquery ajax using $.post. After server returns the response, I process the response in the callback function. In this callback function, how can I know which element was clicked on. Please check the following. In the function handleServerResponse, I would like to know the DOM element that raised this eve...
I have an ASP.Net web user control which represents a single entry in a list. To allow users to reorder the items, each item has buttons to move the item up or down the list. Clicking on one of these raises an event to the parent page, which then shuffles the items in the placeholder control.
Code fragments from the list entry:
Public ...
I am trying to create two different sets of settings for datepicker(http://keith-wood.name/datepick.html) when the user picks different radiobuttons in a group.
Here's my code:
$("input[name='shipping_time_english']").change(function(){
datepicker();
});
function datepicker() {
...
Hello.
>>> import threading
>>> event = threading.Event()
>>> event.set()
>>> print event.wait(1)
None
>>> event.clear()
>>> print event.wait(1)
None
So it basically returns None both when condition was True and False. How can I distinguish the case of timeouting from the one with no waiting at all? Meanwile, the docs say
This met...
what is the difference between
<asp:DropDownList ID="Combo" OnSelectedIndexChanged="Change" AutoPostBack="True" runat="server"/>
and
<asp:DropDownList ID="Combo" SelectedIndexChanged="Change" AutoPostBack="True" runat="server"/>
?
And is the attribute AutoPostBack="True" always required?
Iam asking because it seems my OnSelected...
I have a collection of custom objects called DataItems which contain URIs of images that I want to load and put in a collection for my Silverlight application to use.
As I process each DataItem, I get its SourceUri (e.g. "http://..../picture001.png") and start it loading:
void LoadNext()
{
WebClient webClientImgDownloader = new Web...
I've been trying to write a simple Static-class State Machine for my application to notify other controls and code when the system state changes. And I think I almost have it, but I'm running into a small issue that I'm not sure how to work around.
Here's the code:
// An enum denoting the 3 States
public enum Status { Error = -1, Work...
Hey Everyone,
I am trying to get the code of an event using the event.which jQuery function. It is working great in FF, but in IE8 I am only getting "undefined". Is there some reason this would not work in IE8? I am using jQuery version 1.3.2 and the code is bellow (simplified).
function handleInput(event) {
//Get the character code...
Is there a way to hookup a button click to a method programmatically? It would be like imitating the CTRL+CLICK in Interface Builder.
...
I am using the jQuery datepicker on a text input field and I don't want to let the user change any of the text in the text input box with the keyboard.
Here's my code:
$('#rush_needed_by_english').keydown(function() {
//code to not allow any changes to be made to input field
});
How do I not allow keyboard typing in a text input fi...
I'm using the .load() function to load a section of html that has some jQuery functionality that is bound to a certain class. =/
thoughts?
...
Possible Duplicate:
Is there a way in javascript to detect if the unload event is caused via a refresh, the back button, or closing the browser?
Hi all
I have the below set of code
$(window).unload( function() {
test();
});
the test() will call when i close the window and also if i refresh the window ..... How can ide...
Consider this code:
PS> $timer = New-Object Timers.Timer
PS> $timer.Interval = 1000
PS> $i = 1;
PS> Register-ObjectEvent $timer Elapsed -Action { write-host 'i: ' $i }.GetNewClosure()
PS> $timer.Enabled = 1
i: 1
i: 1
i: 1
...
# wait a couple of seconds and change $i
PS> $i = 2
i: 2
i: 2
i: 2
I assumed that when I create new clo...
hi all
whether there are any event from which I handle the drop event of UITableViewCell.
Basically I want to do some task when I drop some thing on a cell of UITableView. So i want to know that whether any event is exist for this purpose?
...
I'm creating a system that takes readings from a hardware device that sends data via a serial port. Every time a "packet" comes in off the serial port, I update and redraw some GUI components to reflect the updated information. Since serial port events stem from a separate thread, I have to call Invoke(Invalidate) on several components t...
The fundamental question is how do I create a unit test that needs to call a method, wait for an event to happen on the tested class and then call another method (the one that we actually want to test)?
Here's the scenario if you have time to read further:
I'm developing an application that has to control a piece of hardware. In order ...
Hi,
I am trying ot raise a MouseLeftButtonDownEvent by bubbling it up the Visual tree
with the following code.
MouseButtonEventArgs args = new MouseButtonEventArgs(Mouse.PrimaryDevice,0, MouseButton.Left);
args.RoutedEvent = UIElement.MouseLeftButtonDownEvent;
args.Source = this;
RaiseE...