What's the best way to get a value of a TextArea after a key is typed, including this character?
If I do it in the even listener, textarea.getText() returns the value without the eventual new char.
Basically I see two ways:
postponing processing with something like invokeLater(). I would prefer a solution without threads.
figuring ou...
In my code, two comboboxes are added to actionListener( this );
In another part of my code, I call a combobox function that sets an index to a certain value. This in turn calls actionPerfoemed again and so getSource == comboBox is true. Every time I call a set function it calls actionPerformed again, creating a stack of function calls t...
I just implemented Adam Shaw's popular calendar called 'fullcalendar' (http://arshaw.com/fullcalendar/) using CodeIgniter. But I require addition and other operations on events from my database. I was able to find one CakePHP plugin with the same purpose from here, http://bakery.cakephp.org/articles/view/events-plugin.
Since I'm not in...
I want to link a physical file with a row in a table. My intention is to use database habilities to delete the files that are referenced in the table. For example:
$o = Doctrine::getTable('Document')->find(12);
$o->delete();
This code delete the row in the table, i want to delete an hipotetical file referenced in $o->file_locatio...
Some operating systems generate keyPressed events more quickly than my application can handle them. My first thought was to not perform the action if the calls are too close together, with something like this:
public void actionPerformed(ActionEvent e) {
long now = System.currentTimeMillis();
if(now - lastCall < 150) {
S...
I'm trying to understand when it is appropriate to use events. It seems to me that an event can be thought of as an SQL trigger.
Then, is it correct to use an event triggered by one domain object to modify another, or will it imply lack of a well thought out design if we use events to modify other object's states?
Or should there be a me...
I would like to do something when a scroll event has occurred on a smartgwt window. I'm assuming that an event will be fired when at least one of the following has happened: scroll within window with mouse scroll wheel, scroll by dragging scroll bar, or scroll using scroll arrows.
I've added a handler to a smartgwt window and also to th...
For the record: I found a similar question here but I have to elaborate a bit more on on the subject.
My concrete scenario is this:
In Silverlight 4, The myFrameworkElement.FindName("otherElementName") method seems to work fine now, but I encountered a problem. It still returns null when the element is not yet added to the visual tree ...
I am trying to create a Cocoa wrapper around a Flash application. I've got it loading up in a WebView, and I can control it by sending key events using the CGEvent API, like so:
[myWindow makeFirstResponder:myFlashWidget];
CGEventRef e1 = CGEventCreateKeyboardEvent(NULL, (CGKeyCode)keyCode, true);
CGEventPost(kCGSessionEventTap, e1);
CF...
Hello everyone.
What would be the best way to send a message to the click event to find out from where it was called?.
$("#mybutton").click(function(ev){
if (called from funcion One or Two){
//my code
}
});
funOne = function(){
$("#mybutton").click();
};
funTwo = function(){
$("#mybutton").click();
};
EDIT:
o...
Surprised this question has not been asked yet here, but here goes:
Serialization in VB.NET is a bit of a pain. If you use the standard Serializable() attribute, and attempt to serialize a class that has events which are attached to handlers, it will attempt to serialize the handlers as well.
Coming from a C# background I am not used t...
I find myself doing this sort of thing quite often:-
EventHandler eh = null; //can't assign lambda directly since it uses eh
eh = (s, args) =>
{
//small snippet of code here
((SomeType)s).SomeEvent -= eh;
}
variableOfSomeType.SomeEvent += eh;
Basically I only want to attach an event handler to listen for one shot from...
The code works fine on my dev machine (localhost), but after I moved it to the dev server, my drop down lists SelectedIndexChanged routine is not triggered.
What gives? I am lost...any input is appreciated.
using asp.net 3.5 c#
protected void Page_Load(object sender, EventArgs e)
{
ddlDepartments.SelectedIndexChang...
Being relatively new to C#, I've been researching custom events recently, and while I think I now understand the basic pieces required to setup a custom event, I'm having trouble determining where each piece belongs. Specifically, here's what I'm trying to do.
I have a tree control that represents the layout of an internal data structu...
I have read where an event is triggered on another thread from the one that created the controls on a Windows Form.
Therefore, the event handler can't directly update the controls (like changing a button's color).
I read the explainations about Invoke or BeginInvoke being needed.
My question: Why can't an event handler just be passed ...
I want to use a timer in a windows mobile app. Of course, this is not the problem.
The problem: the timer needs to be called even during standby and sleep mode.
Simply switching off the sleep mode is not really an option, since the app needs to comply to windows marketplace for mobiles requirements, and regarding to requirement 5.2 a m...
Hello
I have an error that occurs in a specific event handler that I setup using jQuery and the code just breaks without any errors being displayed. When I used to code similar things in YUI I would setup YAHOO.util.Event.throwErrors = true; in my dev. version and that was telling YUI's event handler to throw errors. I can't find anythi...
I'm working on a Qt application and I have a problem with getting mouse events where I want them.
Here's a high-level view of what I have (there are other things going on at each level that dictate the need for the views and scenes):
+----------------
| App Window -- QMainWindow
| +--------------
| | View -- QGraphics...
For example, I have a base event publishing method:
protected virtual OnSomeEvent(EventArgs e)
{
var handler = SomeEvent;
if (handler != null)
{
handler(this, e);
// handler(this, new EventArgs());// EDIT: Yes it should be
// handler(this,...
Whenever a mousedown or mouseup handler is attached to an element the dblclick cannot be attached (won't work if attached), though this seems fair enough is there any way to reinstate a dblclick functionality without rewriting it from scratch (sigh...)
Or am I missing something about events propagation?
...