Search Results

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

Page 67/782 | < Previous Page | 63 64 65 66 67 68 69 70 71 72 73 74  | Next Page >

  • Intercept click event on a button, ask for confirmation, then proceed

    - by Blankman
    Based on a variable SomeCondition, I need to intercept a click event on a button, and ask for confirmation, if they say ok, proceed, otherwise ignore click. So something like: if(SomeCondition) { // disable click on button var isOk = window.confirm("Are you sure?"); if(isOk) { $("#button1").click(); } } Note: button1 has already been wired up with a click event via javascript from an external .js file that I can't change. I don't know what the click event was bound too, so I have to disable the click if SomeCondition is true, then ask for confirmation, then continue with the click.

    Read the article

  • Handling download abort in PHP

    - by Aron Rotteveel
    Is it somehow possible to handle a download abort in PHP? In this specific case I am not speaking of a connection abort, but handling the event that triggers when the 'cancel' button in the browser download dialog button is clicked. Since this dialog already interprets the headers of the file that is to be download but does not actually start the download, it only seems logical there should be some way to catch this. Small (pseudo) code example to clear things up: // set some headers header('...'); // Question: what happens between the part where the headers are sent // and the actual data is being outputted to the client? IE: this is the part // where the download dialog should show up // Logical question that follows is: is there a way to detect a 'cancel'? $filename = '/some/file.txt'; $handle = fopen($filename, 'rb'); // output data to client while (!feof($handle)) { echo fread($handle, 8096); } fclose($handle);

    Read the article

  • jQuery and the mouseover event

    - by Kingston
    I need to know how to fix this problem. I have a mouseleave event on my list. jQuery(".list").live("mouseleave", function(event) { alert("Boom"); }); But at the same time I have a tooltip displayed over it. This tooltip doesn't belong to this list, it is in other div. Now, when i move mouse over that div, i get an alert - i left the list. Please, tell me how i can do that when i move mouse in this tooltip, there will be no action. I've tried this sentence, but it doesn't work: if($(event.target).hasClass('name')) alert("D");

    Read the article

  • dojo TimeTextBox don't listen to on blur event

    - by kawtousse
    Hi everyone, I want to add an on blur event to a dojo timetextbox but the event never been runned so the declaration of the timetextbox is like this: <label>End</label><input id="endp" name="endp" onBlur="calculateTimeSpent2(startp,endp,output);" /> the javascript function is like this: function calculateTimeSpent2(startp,endp,outputp) { var tmp0=document.getElementById('startp').value.split(':'); var tmp1=document.getElementById('endp').value.split(':'); if (tmp0[0]!='' && tmp1[0]!='') { var val1= findtime(tmp0[0],tmp0[1],tmp1[0],tmp1[1]); var tmp=val1.split(':'); if (tmp[0].indexOf('-')==-1) document.getElementById('outputp').value=val1; else { alert ("Start Time must be lower than End Time "); document.getElementById('endp').focus(); } } } I don't understand why dojo didn't execute the event correctly while loosing the focus. I tried to put the type=text but it does'nt work. Thanks for help.

    Read the article

  • Errors not being redirected to an Http handler if redirectMode="ResponseRewrite"

    - by Luk
    I see similar questions, but it looks like there were due to an unrelated issue. in 3.5, I have a custom error handler that logs errors and redirects users. My web.config is set up as such: <httpHandlers> <add path="error.ashx" type="MySite.Tools.WebErrorLogger, MySite.Tools" verb="*"/> </httpHandlers> <customErrors mode="On" defaultRedirect="error.ashx" redirectMode="ResponseRewrite"> </customErrors> When redirectMode is set to "ResponseRedirect", everything works fine (but Server.GetLastError() being null but that seems to be intended) However, when using ResponseRewrite, my handler is not called and I see ASP.Net default error pages. Any idea on how I could do this? (I unfortunately can't use either an aspx page or do my error handling in global.asax due to other constraints)

    Read the article

  • Detecting support for a given JavaScript event?

    - by Will
    I'm interested in using the JavaScript hashchange event to monitor changes in the URL's fragment identifier. I'm aware of Really Simple History and the jQuery plugins for this. However, I've reached the conclusion that in my particular project it's not really worth the added overhead of another JS file. What I would like to do instead is take the "progressive enhancement" route. That is, I want to test whether the hashchange event is supported by the visitor's browser, and write my code to use it if it's available, as an enhancement rather than a core feature. IE 8, Firefox 3.6, and Chrome 4.1.249 support it, and that accounts for about 20% of my site's traffic. So, uh ... is there some way to test whether a browser supports a particular event? Thanks.

    Read the article

  • Click event of a button which is subview of an image view in xcode

    - by Christina
    in my app i have an image view and above that i added an button.And also in button click event i am calling a method.But i am unable to click on the button .whenever i try to click the button then the row of the table vie win which my image view is present is selected .Is there any method from which i can get the click event of the button which is placed on the image view.I do not want to use UIbuttons for setting the images in place of image view .Also if i am adding button as a subview of the table view then the click event is working but when i change the subview to image view then i get unsatisfactory result.Please help. Thanks, Christy

    Read the article

  • Is the "message" of an exception culturally independent?

    - by Ray Hayes
    In an application I'm developing, I have the need to handle a socket-timeout differently from a general socket exception. The problem is that many different issues result in a SocketException and I need to know what the cause was. There is no inner exception reported, so the only information I have to work with is the message: "A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond" This question has a general and specific part: is it acceptable to write conditional logic based upon the textual representation of an exception? Is there a way to avoid needing exception handling? Example code below... try { IPEndPoint endPoint = null; client.Client.ReceiveTimeout = 1000; bytes = client.Receive(ref endPoint); } catch( SocketException se ) { if ( se.Message.Contains("did not properly respond after a period of time") ) { // Handle timeout differently.. } }

    Read the article

  • unable to set href inside click event of Jquery

    - by akshatrautela
    Hi I am trying to set href using Jquery inside click event of RadioButtonList but that doesnt work If I take the same code to document.ready event it works fine but not in click event. Please advice. $(document).ready(function() { url = "Results.aspx?latitude=" +latitude + "&Longitude=" + longitude; $("a[href='http://www.google.com/']").attr("href", url); // this works.. } $('.rbl input').click(function() { id = $(this).parent().children("input").val(); url = "Results.aspx?latitude=" + latitude + "&Longitude=" + longitude + "&ServiceCenterProductTypeId=" + id; //alert(url); $("a[href='http://www.google.com/']").attr("href", url); //this doesnt work.... }); });

    Read the article

  • why does calling methods on a div fire the live click event

    - by oo
    i have this jquery code: $(this).parent('.copyFoodInstance').attr("myset", "0"); $(this).parent('.copyFoodInstance').html("<img BORDER=0 src='../../images/copy1.png' />"); it seems that when i call this code, this event fires: $(document).ready(function() { $('div.copyFoodInstance').live('click', function() { does anyone know why this event fires from the lines above? is there anyway to stop if from firing? All i am doing is updating an attribute on the div and updating the html. this shouldn't fire a click event?

    Read the article

  • MVC way of handling data input

    - by korki
    I have a data input module where I add the information of my product and its sub information like: product basic info product price info product price details price info and price details are related to product and are lists In my web forms approach I would store my main product object on the view state and I would populate it's pricing info and details while doing ajax postbacks. This way I can create a compact module that is very user friendly in terms of defining a lot of data from one place without the need to enter these data from seperate modules. And when I am done I would do one product.save() and that would persist all the data to the respective tables on db. Now I am building similar app on .net mvc framework and pondering on what would be the good way of handling this on mvc. I don't resonate towards storing all this on client side till I click save. And saving to the db after each action makes me remember the days I was coding on asp. Will appreciate your inputs on ways to approach this on mvc framework

    Read the article

  • Event in Global.asax file that fires only for once

    - by fiberOptics
    In MVC Global.asax file, we can see the Application_Start where this event fires only for once. But the session is not yet active/available here. So my question is, is there any event in Global.asax file that fired only for once and session is available also? The reason I ask this is because, I use ExpandoObject e.g.: public static dynamic Data { get { #region FAILSAFE if (HttpContext.Current.Session[datakey] == null) { HttpContext.Current.Session[datakey] = new ExpandoObject(); } #endregion return (ExpandoObject)HttpContext.Current.Session[datakey]; } } I want to initialize all of my ExpandoObject at once with the value of null: MyExpando.Data.UserInformation = null; MyExpando.Data.FolderInformation = null; That's why I'm looking for an event that only fired once.

    Read the article

  • Java vs C# - AddActionListener vs event subscription

    - by S.O.
    Very simple question from one somewhat new to Java: when adding an event handler (or whatever it is called in Java) to a Control, MUST it be an object? I mean, in C# I can do control.event += System.eventHandler(methodThatHandlesEvent) Sure, that's because we have delegate types in C#, but I was wondering if I can choose which method would be called when an event is raised in Java? I mean, in Java I can have something like control.AddActionListener(objectWhichClassImplementsActionListener) And then I have the stupid actionPerformed method in this class, which is the only method that is called. I know, there are more kinds of listeners, but I can't have a "ActionListenerHandler" class in which I implement several actionPerformed methods that can be assigned to different controls?

    Read the article

  • Create empty C# event handlers automatically

    - by TomA
    It is not possible to fire an event in C# that has no handlers attached to it. So before each call it is necessary to check if the event is null. if ( MyEvent != null ) { MyEvent( param1, param2 ); } I would like to keep my code as clean as possible and get rid of those null checks. I don't think it will affect performance very much, at least not in my case. MyEvent( param1, param2 ); Right now I solve this by adding an empty inline handler to each event manually. This is error prone, since I need to remember to do that etc. void Initialize() { MyEvent += new MyEvent( (p1,p2) => { } ); } Is there a way to generate empty handlers for all events of a given class automatically using reflection and some CLR magic?

    Read the article

  • SWIG: Throwing exceptions from Python to C++

    - by wheaties
    We've got an interface we've defined in C++ (abstract class, all functions pure virtual) which will be extended in Python. To overcome the cross-language polymorphism issues we're planning on using SWIG directors. I've read how to catch exceptions thrown from C++ code in our Python code here, here, here, and even on SO. It's fairly straight forward and I'm not expecting issues with handling our library's own exceptions. What I'd like to know and can't seem to find in the documentation is how to have our Python implementation of the extended C++ interface throw those C++ exceptions in a way that makes them visible to the C++ code. We could make small functions within the *.i files such that each function throws our exceptions: void throw_myException(){ throw MyException; } but I'm wondering how it will interact with the Python code. Anyone have any experience with throwing C++ exceptions from Python code?

    Read the article

  • Activiti Engine: Task Event - User is null

    - by sockeqwe
    I have a problem, which should be simple to solve, but i can't find the method to call to solve this problem: My problem is, that every Task Event (org.activiti.engine.task.Event) returnes null by calling Event.getUserId(); If I take a look into the database I see that the database table ACT_HI_COMMENT has null as value for the column USER_ID_ for every row. I generate these TaskEvents programmatically by calling (for example) processEngine.getTaskService().addComment(task.getId(), null, commentMessage); processEngine.getTaskService().addUserIdentityLink(task.getId(), user.getId(), IDENTITY_LINK_OBSERVER); I guess there is a simple method that I must call to solve this problem, something like processEngine.setCurrentUser(authenticatedUser.getId()); Any suggestions?

    Read the article

  • Unicode string handling using Windows API

    - by DeadMG
    I always assumed that Unicode string handling was some dark art. However, I've seen that the Windows API has functions for comparing Unicode strings, for example. Does that mean that it's actually feasible to write a Unicode string class that can perform simple actions like sorting, equality comparison, and extraction from a file? Or are there hidden gotchas in the use of these functions that makes it actually a really bad idea? I'm just looking at libraries like ICU and they seem incredibly over-complicated compared to what a Unicode string class backed by the Windows API could actually look like, which would resemble the Standard string classes quite closely.

    Read the article

  • C# - Check which event changed / accessed a Property

    - by binil
    I have a class with property say private string fieldSelectedItem; public string FieldSelectedItem { get { return fieldSelectedItem; } set { fieldSelectedItem = value; } } it is accessed from many place. I came across a situation that the a property in class is accessed by some event. and also some event is changing the value. i tried debugging. is it possible to check which event/function has changed/accessed the property. is there any method to do so.

    Read the article

  • Sharepoint 2010 Calendar Event Receiver

    - by user521682
    I have been tasked with creating a calendar in a root site that get's updated from child site calendar events. I am able to access the Calendar List from the parent site in the child site's to add an event. However, I'm having trouble finding a way to create a uniqueIdentifier for the event so that when the child calendar's event is updated or deleted, the parent site calendar get's updated as well. The ListItem ID field appears to be only unique among the site. I did find a UniqueItemId field, but apparantly it's read-only in the SP LIstitem object. Can someone please give me some guidance here? Many thanks!

    Read the article

  • How to handle this "session failed to write file" error in PHP?

    - by alex
    I am using the Kohana 3 framework, and am using the native session driver. For some reason, occasionally the sessions fail to write to their file. Warning: session_start() [function.session-start]: open(/tmp/sess_*****, O_RDWR) failed: Permission denied (13) in /home/site/public_html/system/classes/kohana/session/native.php on line 27 I am pretty sure Kohana has its own in built error handler, but it is not triggered with this error (i.e. it shows up like a normal PHP error, not the Kohana error). Anyone that has ever used Kohana will notice this seems to have bypassed Kohana's error handling (perhaps set with set_error_handler()). Is there anyway to stop this error from appearing without switching from the native session (i.e. file based) driver? Should I just give good practice the boot and append an @ error suppressor to session_start() in the core code of Kohana? Should I relax the error_reporting()? Thanks

    Read the article

  • Event click on youtube API

    - by Youss
    I'm working with Youtube API and Jquery. With a certain script I can get Youtube Feeds as an image, take a look at the example: JsFiddle I'm trying to do a Jquery click event which will have to invoke another script called 'embedly' like this: $("a").click(function(event) { event.preventDefault(); $(this).embedly({ chars: 220, nostyle: true, key:':41f042ec20b04dda84448dc4a46d357d' }); }); It doesn't seem to work. When I do this from my desktop the click does not invoke the embedly part and also goes to the url regardless of the prevent default.

    Read the article

  • Catch all javascript errors and send them to server

    - by ssaboum
    Hi everyone, i wandered if anyone had experience in handling javascript errors globally and send them from the client browser to a server. I think my point is quite clear, i want to know every exceptions, errors, compilation errors, ... that happens on the client side and send them to the server to report them. I'm mainly using mootools and head.js (for the js side) and django for the server side (not that it matters...). Thank you for your help. Regards.

    Read the article

  • Parent - child event jquery

    - by Tom Rider
    I have have a 2 div element. One is child and one is parent like : <div id="p"> <div id="c"> </div> </div> The parent div has 2 event attached click and dblclick and child div has 1 event attached click. Now my problem is when i clicked on the child div the parent div click event also executed. I tried e.stopPropagation(); but still same behavior. Help me ?

    Read the article

  • Clear All Event subscriptions (Clone linked)

    - by mattias
    I just implemented Clone from ICloneable and realized that the event subscriptions from my source instance also followed. Is there a good way to clear all those? Currently I am using a couple of these loops for every event I have to clear everything. foreach (var eventhandler in OnIdChanged.GetInvocationList()) { OnIdChanged -= (ItemEventHandler) eventhandler; } foreach (var eventhandler in OnNameChanged.GetInvocationList()) { ... This works fine but clutters the code a bit. Mostly worried to get event dangling.

    Read the article

  • Callback exception/error handling for ASP TreeView OnTreeNodePopulate?

    - by MHutchinson
    We're using an asp:TreeView configured with lazy loading. The callback method assigned for OnTreeNodePopulate throws an exception if the user has been logged out since the page was loaded. What we want to do is to direct the user to the login page. First attempt was to catch the exception on the server and try Response.Redirect(...), but that doesn't work because you can't redirect within a callback. I've tried various other approaches, including using ClientScript.RegisterStartupScript(...) but that doesn't seem to work for OnTreeNodePopulate. If there was some way we could hook into the callback event handling on the client side then it would be easy, but the TreeView doesn't seem to offer anything here. Suggestions?

    Read the article

< Previous Page | 63 64 65 66 67 68 69 70 71 72 73 74  | Next Page >