Search Results

Search found 19541 results on 782 pages for 'event handling'.

Page 75/782 | < Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >

  • Handling update errors in multiple records in the TClientDataset's ReconcileError method

    - by Fabio Gomes
    I'm trying to use the ReconcileError event to allow the user to correct the data after an update error which occurred in a specific record among others. Example: I have a dataset with one field and 3 records, this field have a unique constraint on the database, then I change one value to conflict when it reaches the database, then I call ApplyUpdates on the Dataset. This will generate an error (violation of unique constraint) in the provider and abort the applyupdates process, returning raAbort in the Action var of the ReconcileError method. In the ReconcileError method I tryied to use: Action := HandleReconcileError(aDataSet, UpdateKind, E); ** EDIT ** After debugging and dumping the DataSet records which were returned from the server, I noticed that there are 2 records in this Dataset, the first is the Old record and the second have all the changes I made to the first record. I'm a bit confused, will I always get this DataSet with 2 records? I thought that it should have only one record with the Old/New values. Thanks.

    Read the article

  • wxPython: Sending a signal to several widgets

    - by cool-RR
    I am not even sure how to ask this question. I want something that is like the wxPython event system, but a bit different. I'll try to explain. When there is a certain change in my program (a "tree change", never mind what that is,) I want to send a signal to all the widgets in my program, notifying them that a "tree change" has occurred, and they should change their display in response. How do I do this? It sounds a little bit like wxPython events, but not really, since events don't spread to all widgets, as far as I know. What would be a good way to do this?

    Read the article

  • How do I store keys pressed

    - by Glycerine
    I would like to store keys pressed when I listen out for the keyDown on the stage. I can add the listener fine, but I'm not getting the character I want out of the event to store it into a string. This is what I have so far: private var _addToString:String = ""; public function Hotwire() { this.addEventListener(KeyboardEvent.KEY_DOWN, keydownEventHandler); } private function keydownEventHandler(ev:KeyboardEvent):void { trace("Key pressed: " + ev.charCode ); addToString(ev.charCode); } private function addToString(value:uint):String { trace(_addToString); return _addToString += String.fromCharCode(value); } Every key I press its returns '0'. How do I convert the chatCode to a real alphanumeric character I can read later? Thanks in advance

    Read the article

  • Detecting the type of iPhone interrupt

    - by Prashant
    I can detect that the iPhone went to sleep and came back from sleep, by using the applicationWillResignActive and applicationDidBecomeActive. But how do I find out what kind of interrupt it was. I am making an audio player application, and need to keep the audio playing when the iPhone goes to sleep (which I know how to do). But I need to interrupt the audio when a message, alarm or low battery interrupt occurs. Also I need to resume the audio when the event is over. So how do I differentiate between these different interrupts.

    Read the article

  • C++/MFC: Handling multiple CListCtrl's headers HDN_ITEMCLICK events

    - by raph.amiard
    I'm coding an MFC application in which i have a dialog box with multiple CListCtrls in report view. I want one of them to be sortable. So i handled the HDM_ITEMCLICK event, and everything works just fine .. Except that if i click on the headers of another CListCtrl, it does sort the OTHER CListCtrl, which does look kind of dumb. This is apparently due to the fact that headers have an ID of 0, which make the entry in the message map look like this : ON_NOTIFY(HDN_ITEMCLICK, 0, &Ccreationprogramme::OnHdnItemclickList5) But since all the headers have an id of zero, apparently every header of my dialog sends the message. Is there an easy way around this problem ?

    Read the article

  • Jquery: Handling Checkbox Click Event with JQuery

    - by wcolbert
    I can't figure out what is going on here. I have some nested lists of checkboxes that I would like to check when the parent is checked. More importantly, I can't even get the alert to show up. It's as if the click event is not firing. Any ideas? $(document).ready(function() { $("#part_mapper_list input[type=checkbox]").click(function(){ alert("clicked"); if ($(this).attr("checked") == "checked"){ $(this + " input").attr("checked") = "checked"; } else { $(this + " input").attr("checked") = ""; } }); }

    Read the article

  • How to roll back changes in gridview in case of incorrect input

    - by Mustafa A. Jabbar
    Hi, I have a DataGridView that is bound to a list of object. It has some columns that the user can edit. There are certain inputs that are not allowed for a row as a whole. How can I roll back if the user enters invalid inputs in some cell. I tried using the RowValidating event handler but it was not called after cell value has been changed. Even when I implemet CellValueChanged, I still cannot roll back the changes. Any idea how to accomplish this

    Read the article

  • Selecting items from events, as evenly spaced as possible

    - by Matt Warren
    If I have an event that happens 15 times a second (numbered 1 - 15), but I only want to process it 3 times I can choose [1], [6] and [11],. It's important that the events I process are as evenly spaced as possible and take into account wrap-around, i.e. the events are continuous 13, 14, 15, 1, 2, 3 etc. If I want 4 items the best I can do is [1], [5], [9] & [13]. Is there a general algorithm that will calculate which events I need to process given the total number of events (total) and the number to process (processAmount).

    Read the article

  • In GWT, how to known from a SelectionEvent in a Tree if the Shift button is pressed

    - by Vinze
    Hi, I try in GWT to create a Tree with multiple selection for the nodes and ran into a problem similar to this question http://stackoverflow.com/questions/1411752/shift-key-in-gwt. When a selectionEvent is raised from the Tree, I would like to know if the Shift key is pressed or not. SelectionHandler<TreeItem> getSelectionHandler() { return new SelectionHandler<TreeItem>(){ @Override public void onSelection(SelectionEvent<TreeItem> event) { // is shift key pressed ? } }; } The solution in the question above cannot apply in this case as the SelectionHandler class does not inherit from DOMEvent and then does not have a getNativeEvent() function. I tried a dirty solution by adding keyDownEventHandler and keyUpEventHandler to the Tree with a boolean flag but the handlers are only called when the focus is on the tree so this doesn't work. Is there a simple solution (or just a solution even if it's not simple) ? Thanks.

    Read the article

  • .net Attributes that handle exceptions - usage on a property accessor

    - by Mr AH
    Hi, well I know from my asp.net mvc experience that you can have attributes that handle exceptions (HandleErrorAttribute). As far as I can tell the Controller class has some OnException event which may be integral to this behaviour. However, I want to do something similar in my own code: dream example: public String MyProperty { [ExceptionBehaviour(typeof(FormatException), MyExEnum.ClearValue)] set { _thing.prop = Convert.ToThing(value); } } .... The code above obviously makes very little sense, but is close to the kind of thing I wish to do. I want the attribute on the property set accessor to catch some type of exception and then deal with this in some custom way (or even just swallow it). Any ideas guys?

    Read the article

  • How can I make a Jeditable (jQuery) span activate editing on more than one event?

    - by JonathanHayward
    For the jQuery extension Jeditable, one of the parameters that can be specified is which DOM event will turn a div/span/... into a text input/textarea/... I would like to have more than one event serve as a trigger; that is, I would like either a click event or a contextmenu event to turn a span into an in-place edit area. Is there a graceful way to do this without forking Jeditable? --edit-- An example of code specifying the event is below. The parameter is optional, defaulting to a regular click. $(".edit_rightclick").editable("/ajax/save", { cancel: "Cancel", submit: "OK", tooltip: "Right click to edit.", event: "contextmenu", }); Calling twice, once for the regular click event with the event unspecified, and one for the contextmenu event (right-click if there are no switched mouse buttons or anything like that) does not seem to produce the intended effect of an element becoming editable in place on a click from either mouse button.

    Read the article

  • Does SQL Server 2005 error message numbers back to the asp.net application?

    - by Duke
    I'd like to get the message number and severity level information from SQL Server upon execution of an erroneous query. For example, when a user attempts to delete a row being referenced by another record, and the cascade relationship is "no action", I'd like the application to be able to check for error message 547 ("The DELETE statement conflicted with the REFERENCE constraint...") and return a user friendly and localized message to the user. When running such a query directly on SQL Server, the following message is printed: Msg 547, Level 16, State 0, Line 1 <Error message...> In an Asp.Net app is this information available in an event handler parameter or elsewhere? Also, I don't suppose anyone knows where I can find a definitive reference of SQL Server message numbers?

    Read the article

  • ASP.Net Treeview - Client side event handling (jQuery??)

    - by The Great Gonzo
    I have a Treeview (bog standard ASP.Net Treeview) that is bound to an Xml source which allows the user to navigate to various parts of our system. Nothing special.... However, I wanted to generate a breadcrumb for use in the main content area on the client side when the user clicks a node in the Treeview control. I know there are mechanisms available for breadcrumb generation (such as site maps) but for various reasons I need to do it when a node is clicked. So far hooking up a click event using the document ready function available as part of jQuery is easy. However, having spent sometime looking I can not see how I navigate back up the tree nodes to get to each parent nodes text value to build the breadcrumb. I have been playing with .parent(), .parents() and .closest() available via jQuery but don't seem to be getting anywhere. Has anyone done anything like this or can anyone provide a better method? Thanks in advance....

    Read the article

  • How can I retrieve the value of a PASTE (copy-pasta) event in a GWT TextBox?

    - by dominicbri7
    Hello fellow SO members, I want to prevent the user from copy-pasting values in my TextBox IF AND ONLY IF the values do not respect a certain condition. For instance, I created a DigitsOnlyTextBox which will be used for phone numbers. I already made it so only Character.isDigit characters can be typed into the box, and the user cannot copy-paste values into it, using : this.sinkEvents(Event.ONPASTE); and public void onBrowserEvent(Event event) { super.onBrowserEvent(event); // Permet d'empêcher le copier-coller, donc d'entrer des caractères non-numériques if (event.getTypeInt() == Event.ONPASTE) { event.stopPropagation(); event.preventDefault(); } } But I'd like to verify if the copy-pasted String is "digits only" and if so, let the event happen (therefore the text added). tl;dr : see title Thank you for your time. Sincerely.

    Read the article

  • Magento: Why do controller action predispatch events not fire if the controller is rewritten?

    - by mattalexx
    Why do controller action predispatch events not fire if the controller is rewritten? Here is a snippet of store/app/code/core/Mage/Core/Controller/Varien/Action.php: abstract class Mage_Core_Controller_Varien_Action { // [...] public function preDispatch() { // [...] if ($this->_rewrite()) { return; // [What is the purpose if this?] } // [...] // [This is where my event needs to be firing, but this code never gets // executed because the controller is rewritten] Mage::dispatchEvent( 'controller_action_predispatch_'.$this->getFullActionName(), array('controller_action'=>$this) ); } // [...] } I don't know where to start fixing this problem. Anyone out there ever dealt with this before?

    Read the article

  • Can i access outer class objects in inner class

    - by Shantanu Gupta
    I have three classes like this. class A { public class innerB { //Do something } public class innerC { //trying to access objB here directly or indirectly over here. //I dont have to create an object of innerB, but to access the object created by A //i.e. innerB objInnerB = objB; //not like this innerB objInnerB= new innerB(); } public innerB objB{get;set;} } I want to access the object of class B in Class C that is created by class A. Is it possible somehow to make changes on object of Class A in Class C. Can i get Class A's object by creating event or anyhow.

    Read the article

  • Delphi: How to call a method when i click a control?

    - by Ian Boyd
    i have a method: procedure Frob(Sender: TObject); that i want to call when i click a menu item. The method comes to me though an interface: animal: IAnimal; IAnimal = interface procedure Frob(Sender: TObject); end; The question revolves around what to assign to the OnClick event handler of a menu item (i.e. control): var animal: IAnimal; ... begin ... menuItem := TMenuItem.Create(FileMenu) menuItem.Caption := 'Click me!'; menuItem.OnClick := <-------- what to do ... end; The obvious choice, my first attempt, and the wrong answer is: menuItem.OnClick := animal.Frob; So how can i call a method when user clicks a control? See also Why doesn't it work?

    Read the article

  • GetWindowLongPtr fails if called when handling WM_CREATE

    - by Semen Semenych
    Calling the GetWindowLongPtr function for a dialog box with the DWL_USER parameter fails when done from the WM_CREATE handler. It gives no error (checked that, the return value is always zero), which, according to the MSDN documentation, occurs only if SetWindowLongPtr has not been called previously. However, I call it after registering the window class, and properly call the SetWindowPos after that. Finally, calling GetWindowLongPtr in any other event handler, that is, later than WM_CREATE, works fine. Is there something I'm missing in the initialization sequence, or maybe the messages are sent in some not so obvious order?

    Read the article

  • java Swing Listeners: components listening at each others.

    - by Pierre
    Hi all, I want to code two JList (categories and items). When I click one category it should select all the items for that category and when I click on one item it should select its categories. So both JList will have a ListSelectionListener listening at each other and changing the selection. Should I fear about some a of "loop" ? Is there a way to tell that an Event has been consumed ? how do people manage that kind of situation ? Thanks

    Read the article

  • Grails remoteLink handling error codes

    - by soybie
    I'm on grails 1.3.6 and I see the following behavior. <g:javascript library="prototype" /> ... <g:remoteLink action="punch" id="${personInstance.id}" update="damage_${personInstance.id}" on401="alert('foo!');"> generates: <a on401="alert('foo!');" onclick="new Ajax.Updater('damage_5','/blah/person/punch/5',{asynchronous:true,evalScripts:true});return false;" href="/blah/person/punch/5"></a> "on401" isn't a supported event attribute for an anchor tag, so is this a bug in grails?

    Read the article

  • When and why does an EventHandler require objects to be final?

    - by Michiel Borkent
    I have the following code from a GWT Project that is part of the onModuleLoad() method (similar to Java's main method, if you don't know GWT): final TextBox t1 = new TextBox(); final Label lt1 = new Label(); t1.addKeyUpHandler(new KeyUpHandler() { @Override public void onKeyUp(KeyUpEvent event) { // TODO Auto-generated method stub if (!(t1.getText().matches("\\w{2}-\\w{2}-\\w{2}"))) lt1.setText("Invalid."); else lt1.setText("OK."); } }); Why do the two local variables have to be final here?

    Read the article

  • 'Advanced' Console Application

    - by keynesiancross
    Hi all, I'm not sure if this question has been answered elsewhere and I can't seem to find anything through google that isn't a "Hello World" example... I'm coding in C# .NET 4.0. I'm trying to develop a console application that will open, display text, and then wait for the user to input commands, where the commands will run particular business logic. For example: If the user opens the application and types "help", I want to display a number of statements etc etc. I'm not sure how to code the 'event handler' for user input though. Hopefully this makes sense. Any help would be much appreciated! Cheers.

    Read the article

  • Problem with Firefox, javascript, and Canvas

    - by Rob
    I'm having a Firefox-specific issue with a script I wrote to create 3d layouts. The correct behavior is that the script pulls the background-color from an element and then uses that color to draw on the canvas. When a user mouses over a link and the background-color changes to the :hover rule, the color being drawn changes on the canvas changes as well. When the user mouses out, the color should revert back to non-hover color. This works as expected in Webkit browsers and Opera, but Firefox chokes on it if mouseout is triggered and no mouseover event follows it. This is easier to see than for me to describe, and it's too much code to post here, so here is a link: http://www.robnixondesigns.com/strangematter/

    Read the article

  • Nagios core Event Handler not working

    - by sivashanmugam
    Nagios Event Handler is not triggering when the service is taking more time to response or down. My configuration in below nagios.cfg enable_event_handlers=1 localhost.cfg define service { use generic-service host_name Server service_description test-server servicegroups test-service check_command check-service is_volatile 0 check_period 24x7 max_check_attempts 4 normal_check_interval 2 retry_check_interval 2 contact_groups testcontacts notification_period 24x7 notification_options w,u,c,r notifications_enabled 1 event_handler_enabled 1 event_handler recheck-service } command.cfg define command{ command_name recheck-service command_line /usr/local/nagios/libexec/alert.sh $SERVICESTATE$ $SERVICESTATETYPE$ $SERVICEATTEMPT$ } alert.sh file !/bin/sh set -x case "$1" in OK) # The service just came back up, so don't do anything... ;; WARNING) # We don't really care about warning states, since the service is probably still running... ;; UNKNOWN) # We don't know what might be causing an unknown error, so don't do anything... ;; CRITICAL) Aha! The HTTP service appears to have a problem - perhaps we should restart the server... Is this a "soft" or a "hard" state? case "$2" in We're in a "soft" state, meaning that Nagios is in the middle of retrying the check before it turns into a "hard" state and contacts get notified... SOFT) # What check attempt are we on? We don't want to restart the web server on the first check, because it may just be a fluke! case "$3" in Wait until the check has been tried 3 times before restarting the web server. If the check fails on the 4th time (after we restart the web server), the state type will turn to "hard" and contacts will be notified of the problem. Hopefully this will restart the web server successfully, so the 4th check will result in a "soft" recovery. If that happens no one gets notified because we fixed the problem! 3) echo -n "Going To Ping the Virtual Machine (3rd soft critical state)..." # Call the init script to restart the HTTPD server myresult=`/usr/local/nagios/libexec/check_http xyz.com -t 100 | grep 'time'| awk '{print $10}'` echo "Your Service Is taking the following time Delay" "$myresult Seconds" |mail -s "WARNING : Service Taken More Time To Response" [email protected] ;; esac ;; # The HTTP service somehow managed to turn into a hard error without getting fixed. # It should have been restarted by the code above, but for some reason it didn't. # Let's give it one last try, shall we? # Note: Contacts have already been notified of a problem with the service at this

    Read the article

  • What is the probable failure - no BSOD, no event log, monitors sleeping, force reboot required

    - by Tyler
    Every 3 to 15 days, my PC freezes. This typically happens when the computer is idle, I'm coming home from work, back from vacation, etc. It's never happened while using my computer. The monitors are in power save mode The Caps Lock light on the (wireless) keyboard doesn't work Ctrl-alt-del has no effect, mouse (wireless) has no effect The hardware reset button and single press of power putton have no effect Computer does not appear on the network No BSOD, no memory dump Event logs have no errors or indications of problems near the time of crash. Only messages after reboot indicating that there was a reboot without a clean shutdown. Windows is set to never put the computer to sleep (just the display) Here are the vital stats of the build: OS Windows 8 Pro 64-bit CPU Intel i5-2400 Mobo Intel BOXDP67DE Micro ATX GPU MSI N460GTX Cyclone768D5/OC RAM CORSAIR XMS3 8GB (2 x 4GB) CMX8GX3M2A1333C9 PSU SeaSonic X Series X650 Gold System Drive Samsung 840 Pro 256 GB SSD Data Drive 2 x Western Digital WD20EARS 2TB in hardware RAID 1 Optical Lite-On DVD burner IHAS424-98 And here is the story of how the problem developed and what I've done to diagnose: January 2011, system built with Windows 7 64-bit, runs great. March 2011, Intel replaced the mobo because of the bad sata controllers. October 2012, upgrade to Windows 8 (problems start shortly after). January 2013, system freezes and causes network to fail for the whole house. Unplug the network cable and other devices and PCs can use the internet. Plug it back in, internet goes away for everyone. Reboot and everything is fine. March 2013, install Intel Gigabit CT PCI-E NIC, disable mobo nic in bios. Network strangeness goes away. Freezes are less frequent. Memtest shows no problems (20 passes). Early June 2013, replace Antec PSU with SeaSonic PSU. Mid June 2013, replace OCZ Vertex 2 SSD with Samsung SSD. Late June 2013, get frustrated and hope the community has some good ideas (I'm running out of budget to replace parts). My next plan of attack is setting "Turn off display" to Never and using a screen saver to see how that reacts on the next freeze. It makes me sad to waste power for up to 15 days though. Has anyone out there seen a problem like this? Any ideas on what kind of malfunction would act this way? Ideas of other diagnostic steps to take?

    Read the article

< Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >