Search Results

Search found 10381 results on 416 pages for 'delegate and events'.

Page 102/416 | < Previous Page | 98 99 100 101 102 103 104 105 106 107 108 109  | Next Page >

  • Javascript onclick event is not working in internet explorer 8.

    - by Mallika Iyer
    Hi, I have the following line of code that works fine in Firefox, Chrome and Safari, but not in internet explorer 8. <a href="javascript:void(0);" onclick="showHide('reading','type_r','r');">Show me the example</a> The function simply shows and hides a div on clicking the hyperlink. Is there anything I'm missing here? This is the showHide function: function showHide(elementId,parentId,qtype) { if (document.getElementById && !document.all) { var elementParent = document.getElementById(parentId); var element = document.getElementById(elementId); var upArrowId = 'up-arrow-'+qtype; var downArrowId = 'down-arrow-'+qtype; if(element.style.visibility == 'hidden'){ elementParent.style.height = 'auto'; element.style.visibility = 'visible'; document.getElementById(upArrowId).style.visibility = 'visible'; document.getElementById(downArrowId).style.visibility = 'hidden'; } else if(element.style.visibility == 'visible'){ element.style.visibility = 'hidden'; elementParent.style.height = '50px'; document.getElementById(upArrowId).style.visibility = 'hidden'; document.getElementById(downArrowId).style.visibility = 'visible'; } } } Thanks.

    Read the article

  • performing a javascript event without triggering that event handler

    - by bento
    In my latest code, I have an event handler for a focus on a textarea. When the user clicks on the textarea, that event-handler is triggered which sets some other DOM states based on the selected textarea. However, elsewhere in my program I want to programmatically set the focus of the textarea without triggering that event handler. I know Backbone, for instance, has a way to silently perform an action. My only pseudo-solution is to temporarily set a variable: var silence = true; And then, in my event handler, only perform the logic if silence is false. The handler is still triggered, but the logic doesn't run. Does anyone else know of better strategies for this?

    Read the article

  • Better way to kill a Form after the FormClosing event is overridden to hide rather than close?

    - by Paul Sasik
    I have a simple Windows Form that hosts property controls at runtime. To keep the window and its contents alive rather than killing it by handling the FormClosing event, cancel the event and simply hide the form. That's fine but at close of the application I need to actually close the window. I implemented the below but it feels kludgey. Is there a simpler, more clever way to handle this situation? (The form's controller calls KillForm explicitly after it receives a closing event from the main window.) Friend Class HostForm Private _hideInsteadOfClosing As Boolean = True Private Sub HostForm_FormClosing(ByVal sender As Object, ByVal e As FormClosingEventArgs) _ Handles Me.FormClosing If _hideInsteadOfClosing Then Me.Hide() e.Cancel = True End If End Sub Public Sub KillForm() _hideInsteadOfClosing = False Me.Close() End Sub End Class

    Read the article

  • How to call an event when the user "finally" selects an item in a list?

    - by herzmeister der welten
    When a user clicks once on an item in a Grid or a ListBox, that item is usually selected, hence most UI frameworks have a onSelected event or the like for that. However, how can we generally call the next step when a user "finally" selects an item by e.g. double clicking an entry? You know when some popup might appear in the context of the selected item and the user can do further stuff. Strangely enough, I think I have never seen a word for that in any UI framework. onPicked, onAccepted, onChosen, onFinallySelected, onResult? All kinda awkward or too special. Any other ideas?

    Read the article

  • Problem with onMouseOut event with select box options (IE)

    - by nik
    Hello All, The problem I am facing with below code is that whenever I try to select any option from the select box, the mouseout event executed (in IE, Mozilla doing gr8) and option disappear. How can one get over this bug. <select name="ed" id="ed" dir="ltr" style="width:200px;overflow:hidden;" onMouseOver="this.style.width='auto'" onMouseOut="this.style.width='200px';"> <option value="1" selected="selected">click here</option> <option value="1">Samuel Jackson</option> <option value="2">David Nalog</option> <option value="3">This one is a real real big name</option> </select>

    Read the article

  • URLLoader.load() issue when using the same URLRequest

    - by Rudy
    Hello, I have an issue with my eventListeners with the URLLoader, but this issue happens in IE, not in FF. public function getUploadURL():void { var request:URLRequest = new URLRequest(); request.url = getPath(); request.method = URLRequestMethod.GET; _loader = new URLLoader(); _loader.dataFormat = URLLoaderDataFormat.TEXT; _loader.addEventListener(Event.COMPLETE, getBaseURL); _loader.load(request); } private function getBaseURL(event:Event):void { _loader.removeEventListener(Event.COMPLETE, getBaseURL); } The issue is that my getBaseURL gets executed automatically after I have executed the code at least once, but that is the case only in IE. What happens is I call my getUploadURL, I make sure the server sends an event that will result in an Event.COMPLETE, so the getBaseURL gets executed, and the listener is removed. If I call the getUploadURL method and put the wrong path, I do not get an Event.COMPLETE but some other event, and getBaseURL should not be executed. That is the correct behavior in FireFox. In IE, it looks like the load() method does not actually call the server, it jumps directly to the getBaseURL() for the Event.COMPLETE. I checked the willTrigger() and hasEventListener() on _loader before assigning the new URLLoader, and it turns out the event has been well removed. I hope I make sense, I simplified my code. To sum up quickly: in FireFox it works well, but in IE, the first call will work but the second call won't really call the .load() method; it seems it uses the previously stored result from the first call. I hope someone can please help me, Thank you, Rudy

    Read the article

  • a script translatable to JavaScript with callback-hell automatic avoider :-)

    - by m1uan
    I looking for "translator" for JavaScript like already is CoffeScript, which will be work for example with forEach (inspired by Groovy) myArray.forEach() -> val, idx { // do something with value and idx } translate to JavaScript myArray.forEach(function(val, idx){ // do something with value and idx }); or something more usefull... function event(cb){ foo()-> err, data1; bar(data1)-> err, data2; cb(data2); } the method are encapsulated function event(cb){ foo(function(err,data1){ bar(data1, function(err, data2) { cb(data2); }); }); } I want ask if similar "compiler" to JavaScript like this even better already doesn't exists? What would be super cool... my code in nodejs looks mostly like this :-) function dealer(cb){ async.parallel([ function(pcb){ async.watterfall([function(wcb){ first(function(a){ wcb(a); }); }, function(a, wcb){ thirt(a, function(c){ wcb(c); }); fourth(a, function(d){ // dealing with “a” as well and nobody care my result }); }], function(err, array_with_ac){ pcb(array_with_ac); }); }, function(pcb){ second(function(b){ pcb(b);}); }], function(err, data){ cb(data[0][0]+data[1]+data[0][1]); // dealing with “a” “b” and “c” not with “d” }); } but, look how beautiful and readable the code could be: function dealer(cb){ first() -> a; second() -> b; third(a) -> c; // dealing with “a” fourth(a) -> d; // dealing with “a” as well and nobody care about my result cb(a+b+c); // dealing with “a” “b” and “c” not with “d” } yes this is ideal case when the translator auto-decide, method need to be run as parallel and method need be call after finish another method. I can imagine it's works Please, do you know about something similar? Thank you for any advice;-)

    Read the article

  • Child window focus lost in c#

    - by jestges
    Hi I've two aspx pages ie. page1 and page2. In my Page1 I've a button and in that button click event I try to open page2 (some thing like window.open(page2)) it is working fine. Again I've another button in Page2. When I click Page2 button page1 getting focused. How to prevent this? Any idea?

    Read the article

  • Trouble determining onclick's target

    - by pwseo
    I've tried and tried... and I can't seem to make this work in IE (tested version 6) Can anybody help me? IE complains about an error but refuses to tell which error it is... var a = document.getElementsByTagName("a"); for (i = 0; i < a.length; i++) { if (a[i].getAttribute("class") == "info-link") { a[i].onclick = function(e) { e = e || window.event; var target = e.srcElement || e.target; var info = target.parentNode.getElementsByTagName("div")[0]; if (info.style.display == "none" || info.style.display == "") { info.style.display = "block"; } else { info.style.display = "none"; } return false; } } } <div class="auxdata"> <a href="#" class="info-link">Esta questão possuí dados anexos. Clique para ver.</a> <div style="display: none;" class="info-inner"> <!-- variable stuff here --> </div> </div>

    Read the article

  • Select list value undefined in $(document).ready

    - by C. Ross
    I have the following code, which I want to load values on a selection change, and also do the selection load initially (since FF 'saves' the last value of the drop down under certain circumstances). The select part of the function works correctly, but for some reason when calling load2 directly the value of $('#select1').value is undefined, even though when I check the DOM in Firebug right after load select1.value has a value. How can I run the load2 function when select1.value is ready? $(document).ready(function() { //Setup change hook $('#select1').change(function(event) { //Remove the old options right away $('#select2').find('option').remove(); //Load the new options load2(this.value); }); //Do load for current value load2($('#select1').value); });

    Read the article

  • pfc_Validation event coding example

    - by Brani
    Could you give me an example of the way I should code into the pfc_Validation event? This is an event that I have never used. For example here is something I have coded in the ue_itemchanged event. if dwo.name = 'theme' then This.Setitem(row,"theme",wf_clean_up_text(data)) end if if dwo.name = 'Comments' then This.Setitem(row,"Comments",wf_clean_up_text(data)) end if Which is the proper way of coding those validations in the pfc_Validation event , so that they are performed only on save-time?

    Read the article

  • VS/C#: Can I be notified of every event that gets handled while debugging?

    - by Daniel I-S
    I am currently troubleshooting a large and unwieldy GUI-based tool in Visual Studio, and was wondering whether there is any way to get some kind of notification (either by writing to the console or through a third-party tool) whenever any handled event occurs. This would make it a lot easier to track down what precisely is going on while I am interacting with this beast. Is there an 'on any event being handled' event I can handle, or some kind of add-in for VS which would make this possible?

    Read the article

  • Javascript to fire event when a key pressed on the Ajax Toolkit Combo box.

    - by Paul Chapman
    I have the following drop down list which is using the Ajax Toolkit to provide a combo box <cc1:ComboBox ID="txtDrug" runat="server" style="font-size:8pt; width:267px;" Font-Size="8pt" DropDownStyle="DropDownList" AutoCompleteMode="SuggestAppend" AutoPostBack="True" ontextchanged="txtDrug_TextChanged" /> Now I need to load this up with approx 7,000 records which takes a considerable time, and effects the response times when the page is posted back and forth. The code which loads these records is as follows; dtDrugs = wsHelper.spGetAllDrugs(); txtDrug.DataValueField = "pkDrugsID"; txtDrug.DataTextField = "drugName"; txtDrug.DataSource = dtDrugs; txtDrug.DataBind(); However if I could get an event to fire when a letter is typed instead of having to load 7000 records it is reduced to less than 50 in most instances. I think this can be done in Javascript. So the question is how can I get an event to fire such that when the form starts there is nothing in the drop down, but as soon as a key is pressed it searches for those records starting with that letter. The .Net side of things I'm sure about - it is the Javascript I'm not. Thanks in advance

    Read the article

  • In MAYA 2009, is it possible to capture the cube rotate event?

    - by Rahul2047
    I need to call a function ( Maya-Python ) based on cube rotationX. For that I have to capture the event, programmatically. I tried using while loop but It stucks in the loop, Nothing can be done in that time. I tried theading (python), still same. Can it be done this or other way? If yes, How? Maya 2009 in Windows XP Some failed code references: import maya.cmds as cmds while (count < 90): lock = cmds.getAttr('pCube1.rotateX',lock=False) print lock count = count + 1 Here Python wise: #!/usr/bin/python import thread import time # Define a function for the thread def cubeRotateX( threadName, delay): count = 0 while count < 5: time.sleep(delay) count += 1 try: thread.start_new_thread( cubeRotateX, ("Thread-1", 2, ) ) except: print "Error: unable to start thread" while 1: pass

    Read the article

  • How to add a click event to a textbox created in code

    - by jvcoach23
    I'm using silverlight 3 and i'd like to create a handler and event wired up to a mouse click in a text box that was created in code behind. Can someone point me in the right direction. I need to make it so that some things fire off when that textbox is clicked into. if you have an example in vb.net that would be even better. thanks shannon

    Read the article

  • Characters count only start counting on the 2nd character??

    - by Hwang
    I have a function that calculates how many characters remaining the user can type, but I don't know why it only starts counting from the 2nd characters. Means at the end I will able to type an extra character from the maximum amount I set. wInput.maxChars=30 wInput.addEventListener(KeyboardEvent.KEY_DOWN, calculate); private function calculate(event:Event=null):void { NameRC=wInput.maxChars-wInput.length; remainingA.text=NameRC; }

    Read the article

  • Will SerialPort DataRecieved Event Trigger Repeatedly..

    - by Gunner
    Suppose I read data from SerialPort whenever there is 100 or bytes available or else nothing is done. That means, the remaining data will still be available in the SerialPort Buffer. This reading is done inside the event handler of DataReceived. Now If a situation arises, when there there is, say 50 bytes in the SerilaPort Buffer and no more data comes. From what I understand, the DataReceived Event will be triggered when ever there is certain amount of bytes available for reading from the Buffer. Now, in the given scenario, If i never read those 50 bytes, will the Event get activated continuously due to the presence of these unread bytes?

    Read the article

  • Morphing content based on window part focus

    - by Adrian A.
    What I'm trying to achieve is basically have a code that will morph ( move around the page ) based on the part of the window which is currently viewed. Scenario : - actual page height : 2000px - actual screen height( pc, laptop whatever ) : 800px - 1 image of 600px - 3 div's or virtual boxes ( just to prove what I want to do ) Workflow When you open the page, you'd see the first part of the page with the image loaded in the first div. What I want and need to achieve is when scrolling the page, and the focus would be on the second div ( or the image simply gets out of focus - you can't see it no more ), the image would move ( disappear from the first box ) and appear in the second one, which is currently visible. The idea might seem pretty easy but I'm not Javascript savvy. Ideally, the answer should include a way to load a Javascript instead of that image.

    Read the article

  • MouseWheel Event Fire

    - by Rahat
    I have a problem on calling my private method on MouseWheel event. In fact my mouse wheel event gets fired properly when i only increment a variable or display something in Title bar etc. But when i want to call a private method, that method gets called only one time which is not the requirement i want to call that method depending on the speed of scroll i.e. when scroll is done one time slowly call the private method one time but when the scroll is done in high speed call the private method more than one time depending on the scroll speed. For further explanation i am placing the sample code which displays the value of i in Title bar and add it in the Listbox control properly depending on the scroll speed but when i want to call the private method more than one time depending upon the scroll speed, that method gets called only one time. public partial class Form1 : Form { ListBox listBox1 = new ListBox(); int i = 0; public Form1() { InitializeComponent(); // Settnig ListBox control properties this.listBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.listBox1.FormattingEnabled = true; this.listBox1.Location = new System.Drawing.Point(13, 13); this.listBox1.Name = "listBox1"; this.listBox1.Size = new System.Drawing.Size(259, 264); this.listBox1.TabIndex = 0; // Attaching Mouse Wheel Event this.listBox1.MouseWheel += new MouseEventHandler(Form1_MouseWheel); // Adding Control this.Controls.Add(this.listBox1); } void Form1_MouseWheel(object sender, MouseEventArgs e) { i++; this.Text = i.ToString(); this.listBox1.Items.Add(i.ToString()); // Uncomment the following line to call the private method // this method gets called only one time irrelevant of the // mouse wheel scroll speed. // this.LaunchThisEvent(); } private void Form1_Load(object sender, EventArgs e) { this.listBox1.Select(); } private void LaunchThisEvent() { // Display message each time // this method gets called. MessageBox.Show(i.ToString()); } } How to call the private method more than one time depending upon the speed of the mouse wheel scroll?

    Read the article

  • Event not triggering

    - by the Hampster
    I have no idea where to start on this one. I have a that does not appear until a button is clicked. This function call works: onclick="highlight('mod_sup_div', true);" function highlight(aDiv,show) { if (show) { Effect.Appear('Overlay',{duration: 0.5, to: .80}); Effect.Appear(aDiv,{duration: 0.5}) } else { Effect.Fade('Overlay',{duration: 0.5, to: .80}); Effect.Fade(aDiv,{duration: 0.5}) } } In the <div> I have a button to close the window. <p class="closer"><span onclick="highlight('mod_sup_div',false)">X</span></p> This does not work. The function is not even called, as I made a alert() the first line of the function at it does nothing. What is odd, is that onclick="Effect.Fade(aDiv,{duration: 0.5})" does work. Other simple javascript functions in the onclick="" work, except for the function call. Any help as to why this is happening would be very appreciated. Thanks, Dave

    Read the article

  • Patterns / Solutions to complicated Feature Management

    - by yclian
    Hi all, My company develops CDN / Web-Hosting solution. We have a middleware that's served as a business logic layer and exposes web service for the front-end. I would like to seek for a clean solution to feature management - there're uncertainties and ugly workarounds/solutions in the software that the dev would say "when it happens or is broken, we will fix it". For example, here're the following features that a web publisher can have: Sites limit Bandwidth limit SSL feature + SSL configuration per site If we downgrade a web publisher, when he's having 10 sites, down to 5 sites, we can choose not to suspend the rest of the 5 sites, or we shall prompt for suspension before the downgrade. For the case of bandwidth limit, the downgrade is easy, when the bandwidth check happens, if the publisher has it exceeded, then we will suspend his account. For the case of SSL feature. Every SSL configuration is tied to a site, what shall happen to these configuration object when the SSL feature is downgraded from enabled to disabled? So as you can see, there're many different situations and there are different ways of handling it. I can make a system that examines the impacts and prompts the user to make changes before the downgrade/upgrade. Or a system that ignores the impacts and just upgrade/downgrade. Bad. Or a system designed in a way that the client code need to be aware of the complex feature matrix (or I can expose a helper to the client code to check if a feature is not DEFUNCT) There can be many ways that I am still thinking but puzzled. I am wondering, how would you tackle this issue and is there any recommended patterns or books or software that you think I can refer to? Appreciate your help.

    Read the article

< Previous Page | 98 99 100 101 102 103 104 105 106 107 108 109  | Next Page >