lost-focus

How to work while Selenium tests are working

被刻印的时光 ゝ 提交于 2019-12-02 07:27:06
When I write automated tests and run them (on my PC) I can not work until the tests are finished, because for example if I am coding the focus will jump out of visual studio to go to the web application under test viewed in web browser. Is there a way to prevent Selenium driver from stealing focus? Not only you can't prevent the WebdDiver from taking the focus, you shouldn't do it. The WebdDiver needs the focus on the browser in order to successfully interact with it. If you take the focus the WebdDiver won't be able to perform actions like FindElement() , Click() or any other operation and

How to re-focus to a text field when focus is lost on a HTML form?

▼魔方 西西 提交于 2019-12-01 03:58:37
问题 There is only one text field on a HTML form. Users input some text, press Enter, submit the form, and the form is reloaded. The main use is barcode reading. I use the following code to set the focus to the text field: <script language="javascript"> <!-- document.getElementById("#{id}").focus() //--> </script> It works most of the time (if nobody touches the screen/mouse/keyboard). However, when the user click somewhere outside the field within the browser window (the white empty space), the

How do you solve this LostFocus/LostKeyboardFocus issue?

喜欢而已 提交于 2019-11-30 09:00:51
Ok, I have a control that has an IsEditing property which for argument's sake has a default template that is normally a text block, but when IsEditing is true, it swaps in a textbox for in-place editing. Now when the control loses focus, if it's still editing, it's supposed to drop out of editing mode and swap back in the TextBlock template. Pretty straight forward, right? Think of the behavior of renaming a file in Windows Explorer or on your desktop (which is the same thing I know...) That's the behavior we want. The issue is you can't use the LostFocus event because when you switch to

ASP.NET TextBox LostFocus event

妖精的绣舞 提交于 2019-11-30 05:24:09
问题 I need to trigger code on the server side to be called when a TextBox loses focus. I know there is the onblur client side event, and that there is no LostFocus event, so how can I cause a postback to occur when my TextBox loses focus? Update: I have found a blog which seems to give a pretty decent solution to this. It involves adding a custom event to a TextBox subclass, and registering a client script which calls the server-side event in the onblur JavaScript client event. The following is

Winforms combobox loses autocomplete value on lostfocus

六眼飞鱼酱① 提交于 2019-11-29 14:34:28
I am having issues with the Winforms combo box losing the value found during an autocompletion when the user tabs to the next control. Here is a code sample (as an Nunit Test that will pop up a form): [Test] [STAThread] public void Testing_AsDropDownList() { var comboBox = new ComboBox(); comboBox.DropDownStyle = ComboBoxStyle.DropDownList; comboBox.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; comboBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; comboBox.Items.Add(new ComboPair("aaa", "ItemAAA")); comboBox.Items.Add(new ComboPair("bbb1",

How do you solve this LostFocus/LostKeyboardFocus issue?

a 夏天 提交于 2019-11-29 12:47:46
问题 Ok, I have a control that has an IsEditing property which for argument's sake has a default template that is normally a text block, but when IsEditing is true, it swaps in a textbox for in-place editing. Now when the control loses focus, if it's still editing, it's supposed to drop out of editing mode and swap back in the TextBlock template. Pretty straight forward, right? Think of the behavior of renaming a file in Windows Explorer or on your desktop (which is the same thing I know...) That

Having TextChanged Event Fire Immediately as Text is Typed into TextBox

泪湿孤枕 提交于 2019-11-28 12:00:20
On a wpf TextBox that has an TextChanged event, it seems to only fires when focus is taken away from the textbox; but not as individual characters are typed in. Is there an event similar to TextChanged that fires immediately when a character is typed into the textbox, rather than when focus changes? You can bind the Text property and make use of the UpdateSourceTrigger . UpdateSourceTrigger=PropertyChanged By setting it to PropertyChanged , you will get a notification each and every time the text changes. TextChanged does fire as soon as the text is changed. (If you have a binding on Text that

Is it possible to write onFocus/lostFocus handler for a DIV using JS or jQuery?

那年仲夏 提交于 2019-11-28 11:22:56
I have a div and when the user clicks the div a function should be called. And when the user clicks something else (anything other than this div) another function should be called. So basically i need to have onFocus() and lostFocus() function calls associated with this DIV. Is it available in JavaScript or even in jQuery? Thanks. Here i created a Working demo of what you want http://jsfiddle.net/kPbfL/1/ You need to add tabindex attribute to div : Markup: <div id="mydiv" tabindex="-1"></div> Javascript $("#mydiv").focusin(function() { $("#mydiv").css("background","red"); }); $("#mydiv")

Having TextChanged Event Fire Immediately as Text is Typed into TextBox

淺唱寂寞╮ 提交于 2019-11-27 06:39:59
问题 On a wpf TextBox that has an TextChanged event, it seems to only fires when focus is taken away from the textbox; but not as individual characters are typed in. Is there an event similar to TextChanged that fires immediately when a character is typed into the textbox, rather than when focus changes? 回答1: You can bind the Text property and make use of the UpdateSourceTrigger. UpdateSourceTrigger=PropertyChanged By setting it to PropertyChanged , you will get a notification each and every time

Is it possible to write onFocus/lostFocus handler for a DIV using JS or jQuery?

痞子三分冷 提交于 2019-11-27 03:30:46
问题 I have a div and when the user clicks the div a function should be called. And when the user clicks something else (anything other than this div) another function should be called. So basically i need to have onFocus() and lostFocus() function calls associated with this DIV. Is it available in JavaScript or even in jQuery? Thanks. 回答1: Here i created a Working demo of what you want http://jsfiddle.net/kPbfL/1/ You need to add tabindex attribute to div : Markup: <div id="mydiv" tabindex="-1"><