Search Results

Search found 4289 results on 172 pages for 'focus stealing'.

Page 146/172 | < Previous Page | 142 143 144 145 146 147 148 149 150 151 152 153  | Next Page >

  • StoreFilterField input doesn't react

    - by user1289877
    I'm trying to build grid with build in column filtering (using sencha gxt), here is my code: public Grid<Stock> createGrid() { // Columns definition ColumnConfig<Stock, String> nameCol = new ColumnConfig<Stock, String>(props.name(), 100, "Company"); // Column model definition and creation List<ColumnConfig<Stock, ?>> cl = new ArrayList<ColumnConfig<Stock, ?>>(); cl.add(nameCol); ColumnModel<Stock> cm = new ColumnModel<Stock>(cl); // Data populating ListStore<Stock> store = new ListStore<Stock>(props.key()); store.addAll(TestData.getStocks()); // Grid creation with data final Grid<Stock> grid = new Grid<Stock>(store, cm); grid.getView().setAutoExpandColumn(nameCol); grid.setBorders(false); grid.getView().setStripeRows(true); grid.getView().setColumnLines(true); // Filters definition StoreFilterField<Stock> filter = new StoreFilterField<Stock>() { @Override protected boolean doSelect(Store<Stock> store, Stock parent, Stock item, String filter) { // Window.alert(String.valueOf("a")); String name = item.getName(); name = name.toLowerCase(); if (name.startsWith(filter.toLowerCase())) { return true; } return false; } }; filter.bind(store); cm.addHeaderGroup(0, 0, new HeaderGroupConfig(filter, 1, 1)); filter.focus(); return grid; } My problem is: after I run this code, I cannot write anything to filter input, I'm using test data and classes (Stock.java and StockProperties.java) from this example: http://sencha.com/examples-dev/#ExamplePlace:filtergrid I try to put allert in doSelect method to check if this function was called, but it wasn't. Any idea will be welcome. Thanks.

    Read the article

  • What do you call the highlight as you hover over an OPTION in a SELECT, and how can I "un"highlight

    - by devils-avacado
    I'm working on dropdowns in IE6 (SELECT with OPTIONs as children). I'm experiencing the problem where, in IE6, dropdown menus are truncated to the width of the SELECT element. I used this jquery to fix it: var css_expanded = { 'width' : 'auto', 'position' : 'absolute', 'left' : '564px', 'top' : '393px' } var css_off = { 'width' : '190px', 'position' : 'relative', 'left' : '0', 'top' : '0' } if($.browser.msie) { $('#dropdown') .bind('mouseover', function() { $(this).css(css_expanded); }) .bind('click', function() { $(this).toggleClass('clicked'); }) .bind('mouseout', function() { if (!$(this).hasClass('clicked')) { $(this).css(css_off); } }) .bind('change blur focusout', function() { $(this).removeClass('clicked') .css(css_off) }); }; It works fine in IE7+8, but in IE6, if the user clicks on a SELECT and does not click any OPTION but instead clicks somewhere else on the page, outside the SELECT (blur), the SELECT still has a "highlight", the same as if they were hovering over an OPTION with my mouse (in my case, a blue color), and the width is not restored until the user clicks outside the SELECT a second time. In other browsers, blur causes every OPTION to not be highlighted. Using JS, how can I de-highlight an option after the dropdown has lost focus.

    Read the article

  • jQuery validate plugin radio with optional text

    - by timborden
    I'm trying to figure out how to validate a form element with a mix of radio inputs and a text input: <label>Question?</label> <input type="radio" class="mandatory" name="questions[1][]" value="1" />answer 1<br/> <input type="radio" class="mandatory" name="questions[1][]" value="2" />answer 2<br/> <input class="ignore" type="radio" id="questions[1][]" />Other (please specify)<br/> <input class="optional mandatory" type="text" name="questions[1][]" value="" /> I've figured out how to get the form to behave as expected (select and unselect) with the following code: $("input.optional").focus(function () { var this_name = $(this).attr("name"); $("input:radio").filter(function() {return $(this).attr('name') == this_name; }).attr('checked', false); $("input").filter(function() {return $(this).attr('id') == this_name; }).attr('checked', true); }); $(':radio').click(function () { var this_name = $(this).attr("name"); $("input").filter(function() {return $(this).attr('id') == this_name; }).attr('checked', false); $("input.optional").filter(function() {return $(this).attr('name') == this_name; }).val(''); }); I was hoping I could use the class "mandatory" to validate the mix of radio and text inputs: $("form .manditory").each(function () { $(this).rules("add", {required: true}); }); But it's not working as expected. With the radio (id="questions[1][]") selected, and the text input containing content, the form element is still flagged as invalid. Suggestions...maybe a better approach? Thanks in advance. UPDATE Sorry, I should have clarified that I'm using the validate plugin: $("form").validate({ ... });

    Read the article

  • Ensuring quality of your software and code

    - by Filip Ekberg
    When I usually write code I follow some guidelines to ensure that my code has a certain standard and I as any other developer try to ensure that my code and software is of quality. Try to focus on the programming and not the understanding of the domain or any other pre-programming steps. These are the following steps I live by: Writing unit tests Make it fail ( no code ) Make it Work ( working code ) Analysing abstraction Extracting methods Exteract interfaces Refactoring In addition to the above which is a part of refactoring, I also try to refactor the code with good tools such as ReSharper, CodeRush or others. The question; What is the next step? Commenting the code is trivial and shouldn't even have to be mentioned, but updated comments and xml-comments where it's needed / everywhere is something that I try to have. But all the above helps he ensure that other developers might understand my code, that the code has some sort of quality and follows naming standards. It does however not ensure any product quality. I am looking for tools for post-development quality ensurance, such as profilers and how one would use these tools to increase product quality.

    Read the article

  • Hibernate Exception Fixed By Alt+Tab

    - by Lee Theobald
    Hi all, I've got a very curious problem in Hibernate that I would like some opinions on. In my code if I do the following: Go to page A Click a link on page A to be taken to page B Click on data item on page B Exception thrown I get an error telling me: failed to lazily initialize a collection of role: XYZ, no session or session was closed Fair enough. But when I do the same thing but add an alt+tab in the middle, everything is fine. E.g. Go to page A Click a link on page A to be taken to page B Hit ALt+Tab to switch to another application Hit ALt+Tab to switch back to the web browser Click on data item on page B Everything is fine. I'm a little confused as to how switching focus from my application makes it act as I want it to. Does anyone have any light to shine on the subject? I don't think it's a locking issue as even if I do the second set of steps quicker than the first, still no error. It's a Seam application using Hibernate 3.3.2.GA & 3.4.0.GA.

    Read the article

  • Script says Undefined

    - by user1058887
    I have this script that would let the user input a text and it would get translated into something else. It works only when the word has only 1 letter. When there is more than 1 letter it says Undefined. Here is the script : function copyit(theField) { var tempval=eval("document."+theField) tempval.focus() tempval.select() therange=tempval.createTextRange() therange.execCommand("Copy") } function results() { var behavior="form"; var text=document.csrAlpha.csrresult2.value; var ff22=text.toLowerCase(); var Words=new Array ; Words["b"]="Dadada"; Words["bob"]="Robert"; Words["flower"]="Banana"; Words["brad"]="Chair"; var trans=""; var regExp=/[\!@#$%^&*(),=";:\/]/; var stringCheck=regExp.exec(ff22); if(!stringCheck) { if(ff22.length > 0) { for(var i=0;i < ff22.length;i++) { var thisChar=ff22.charAt(i); trans += Words[thisChar] + " "; } } else { trans +="Please write something."; } } else { trans +="You entered invalid characters. Remove them and try again."; } document.csrAlpha.csrresult.value=trans; } Please insert your text below:

    Read the article

  • filling colors on a map - PHP

    - by jeremy
    I am trying to determine how to fill colors onto a map - such as the "Risk" board game map. I've done this before with HTML tables, by pulling an HTML color code from a SQL table and then just using it to fill the cell the color I want it. But for a non-square map, I'm not sure where to look. I have created a very simple two color map - its white with black borders. My desired result is having the 'regions' on the map shaded with a color, based on data in a sql table (just like the "fill" button in Paint). This looks like what I need: http://php.net/manual/en/function.imagefilltoborder.php and now.. how to define the borders... At the moment I have tried nothing, because the question was: how do I have PHP fill parts of an image? I have tried making an image in Paint, and then scratching my head wondering how to fill parts of it. Having stumbled upon a link, let me focus this a bit more: It appears that with imagefilltoborder that I can put an image on my server, perhaps one that looks like a black and white version of the RISK map - black borders and white everything else. Some questions: Is it correct that the 'border' variable should use the color of my border (whatever value black is) so that the code can "see" where the border is? Is it correct that I'll just need to figure out X,Y coords to begin the fill? Does this work if I have 10 different spots to fill on the map? Can I use varying colors from code or pulled from SQL to assign different colors to those 10 spots, and use 10 different X,Y coords to get them all?

    Read the article

  • problem with converting simple code from Winform to silverlight app.

    - by Sara
    Hi. I have this code for window form application and I have been attempting to convert it to a Silverlight application but it does not work!. There is a Textbox and I attached KeyDown event handler to it. when the user press the arrow key ( left or right) while the focus on the textbox, it will write . or -. When it is window form i used e.KeyCode and Keys.Right and its works great but when it is silverlight I used e.Key and key.Right and the program doesn't work good because the arrows do the 2 functions moving and write ./-. How I can work this out in Silverlight? (My English not good) The code ( window form): private void textBox1_KeyDown(object sender, KeyEventArgs e) { if (sender is TextBox) { TextBox textBox = (TextBox)sender; if (e.KeyCode == Keys.Left || e.KeyCode == Keys.Right) { e.Handled = true; char insert; if (e.KeyCode == Keys.Left) { insert = '.'; } else { insert = '-'; } int i = textBox.SelectionStart; textBox.Text = textBox.Text.Insert(i, insert.ToString()); textBox.Select(i + 1, 0); } } } (and Silverlight): private void textBox1_KeyDown(object sender, KeyEventArgs e) { if (sender is TextBox) { TextBox textBox = (TextBox)sender; if (e.Key == Key.Left || e.Key == Key.Right) { e.Handled = true; char insert; if (e.Key == Key.Left) { insert = '.'; } else { insert = '-'; } int i = textBox.SelectionStart; textBox.Text = textBox.Text.Insert(i, insert.ToString()); textBox.Select(i + 1, 0); } } } I don't understand, is there huge different effect between using Keycode/Keys and Key/Key or because something else?

    Read the article

  • WindowsFormsApplicationBase SplashScreen makes login form ignore keypresses until I click on it - how to debug?

    - by Tom Bushell
    My WinForms app has a simple modal login form, invoked at startup via ShowDialog(). When I run from inside Visual Studio, everything works fine. I can just type in my User ID, hit the Enter key, and get logged in. But when I run a release build directly, everything looks normal (the login form is active, there's a blinking cursor in the User ID MaskedEditBox), but all keypresses are ignored until I click somewhere on the login form. Very annoying if you are used to doing everything from the keyboard. I've tried to trace through the event handlers, and to set the focus directly with code, to no avail. Any suggestions how to debug this (outside of Visual Studio), or failing that - a possible workaround? Edit Here's the calling code, in my Main Form: private void OfeMainForm_Shown(object sender, EventArgs e) { OperatorLogon(); } private void OperatorLogon() { // Modal dialogs should be in a "using" block for proper disposal using (var logonForm = new C21CfrLogOnForm()) { var dr = logonForm.ShowDialog(this); if (dr == DialogResult.OK) SaveOperatorId(logonForm.OperatorId); else Application.Exit(); } } Edit 2 Didn't think this was relevant, but I'm using Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase for it's splash screen and SingleInstanceController support. I just commented out the splash screen code, and the problem has disappeared. So that's opened up a whole new line of inquiry... Edit 3 Changed title to reflect better understanding of the problem

    Read the article

  • Rationale of C# iterators design (comparing to C++)

    - by macias
    I found similar topic: http://stackoverflow.com/questions/56347/iterators-in-c-stl-vs-java-is-there-a-conceptual-difference Which basically deals with Java iterator (which is similar to C#) being unable to going backward. So here I would like to focus on limits -- in C++ iterator does not know its limit, you have by yourself compare the given iterator with the limit. In C# iterator knows more -- you can tell without comparing to any external reference, if the iterator is valid or not. I prefer C++ way, because once having iterator you can set any iterator as a limit. In other words if you would like to get only few elements instead of entire collection, you don't have to alter the iterator (in C++). For me it is more "pure" (clear). But of course MS knew this and C++ while designing C#. So what are the advantages of C# way? Which approach is more powerful (which leads to more elegant functions based on iterators). What do I miss? If you have thoughts on C# vs. C++ iterators design other than their limits (boundaries), please also answer. Note: (just in case) please, keep the discussion strictly technical. No C++/C# flamewar.

    Read the article

  • WPF/Silverlight Resources for Businesses

    - by Refracted Paladin
    I am the only developer at a non-profit organization(~200 employees) where we are a M$ shop and 90% of the things I develop are specific to our company and are internal only. I am given a lot of latitude on how I accomplish my goals so using new technologies is in my best interest. So far I have developed all winform & asp.net applications. I would now like to focus on XAML driven development(WPF & Silverlight) and would like your help. I am subscribed to numerous Silverlight blogs and I have went through a few good tutorials however, I would really appreciate a GOOD SOLID book in my hands going forward. I prefer learning books versus reference books and I REALLY would like one from a Business standpoint as well. Shameless, self-promoting is welcomed if you happen to be an author or reviewer for one that meets my criteria. I would, however, prefer that recomendations were based on first-hand experience(no, 'my friend as this awesome book he told me about', please). Though, I don't mind un-released books if say they are an updated version of an existing. If more info is needed to provide accurate recomendations please let me know. Thanks disclaimer -- I know there are an insane amount of Book posts here(SO) but none I believe for my specific need. If there is and I missed it I apologize.

    Read the article

  • Named Range Breaks Code

    - by Daniel
    I have one workbook with several sheets. I populate the listboxes (pulling static data from cells) on the 2nd sheet, click a button and it runs fine. When I populate the listboxes with a named range, the listbox populates the way I want, but I get an error because the code thinks that I didn't select anything in the listbox, even though I did. So it passes through "" instead of "title". Is this a common issue? The named range isn't a problem because it passes through the data to the listbox and I know it's selecting data because as soon as the listbox loses focus, it spits out the contents of the cell into cell A1. What's even stranger is that I have the contents of the listbox set to Msg1. So A1 gets populated with Msg1 (what I actually selected in the listbox). But when I try and use Msg1 in the code, it tells me that Msg1 is "". Again, this only happens when I use the dynamic named range, not with static data in cells K1:K9. Private Function strEndSQL1 As String Dim strSQL As String strSQL = "" 'Create SQL statement strSQL = "FROM (SELECT * FROM dbo.Filter WHERE ID = " & TextBox1.Text & " And Source IN (" & Msg1 & ")) a FULL OUTER JOIN " strSQL = strSQL & "(SELECT * FROM dbo.Filters WHERE ID = " & TextBox2.Text & " And Source IN (" & Msg1 & ")) b " strSQL = strSQL & "ON a.Group = b.Group strEndSQL = strSQL End Function

    Read the article

  • Python modules, classs, functions documentation through Sphinx

    - by user343934
    Hi everyone, I am trying to document my small project through sphinx which im recently trying to get familiar with. I read some tutorials and sphinx documentation but couldn't make it. Setup and configurations are ok! just have problems in using sphinx in a technical way. My table of content should look like this --- Overview .....Contents ----Configuration ....Contents ---- System Requirements .....Contents ---- How to use .....Contents ---- Modules ..... Index ......Display ----Help ......Content Moreover my focus is on Modules with docstrings. Details of Modules are Directory:- c:/wamp/www/project/ ----- Index.py >> Class HtmlTemplate: .... def header(): .... def body(): .... def form(): .... def header(): .... __init_main: ----- display.py >> Class MainDisplay: .... def execute(): .... def display(): .... def tree(): .... __init_main: My Documentation Directory:- c:/users/abc/Desktop/Documentation/doc/ --- _build --- _static --- _templates --- conf.py --- index.rst I have added Modules directory to the system environment and edited index.rst with following codes Welcome to Seq-alignment's documentation! Contents: .. toctree:: :maxdepth: 2 .. automodule:: index.py .. autoclass:: HtmlTemplate :members:Header,Body,Form,Footer,CloseHtml .. automodule:: display.py .. autoclass:: MainDisplay :members:execute,display,tree Indices and tables :ref:genindex :ref:modindex :ref:search When i make html file and view it, apparently i dont get Modules in the content tables but just there is show record and when i click it just i get "index.txt" version in another window. I need your suggestions Thanks

    Read the article

  • Outlook VSTO AddIn for Meetings

    - by BigDubb
    We have created a VSTO addin for Outlook Meetings. As part of this we trap on the SendEvent of the message on the FormRegionShowing event: _apptEvents.Send += new Microsoft.Office.Interop.Outlook.ItemEvents_SendEventHandler(_apptEvents_Send); The method _apptEvents_Send then tests on a couple of properties and exits where appropriate. private void _apptEvents_Send(ref bool Cancel) { if (!_Qualified) { MessageBox.Show("Meeting has not been qualified", "Not Qualified Meeting", MessageBoxButtons.OK, MessageBoxIcon.Information); chkQualified.Focus(); Cancel = true; } } The problem that we're having is that some users' messages get sent twice. Once when the meeting is sent and a second time when the user re-opens outlook. I've looked for memory leaks, thinking that something might not be getting disposed of properly, and have added explicit object disposal on all finally calls to try and make sure resources are managed, but still getting the functionality incosistently across the organization. i.e. I never encountered the problem during development, nor other developers during testing. All users are up to date on framework (3.5 SP1) and Hotfixes for Outlook. Does anyone have any ideas on what might be causing this? Any ideas anyone might have would be greatly appreciated.

    Read the article

  • jquery focusin() and preventing bubbling.

    - by DA
    I'm showing a div via an onclick event. If you click outside the div, I want to hide it. To do so, I'm binding a one time click event on the body: $('body').one('click.myDivPopup', function(e) { ...close my div... }); Within the div itself, I tell it to not propogate events so that actually clicking within the div won't trigger a click on the body: $myDiv.click(function(e){e.stopPropagation()}); This works fine as intended. I also want to hide the div if one tabs out of the div. My thinking was that in that scenario, I could use a focusin event on the body: $('body').one('focusin.myDivPopup', function(e) { ...close my div... }); Again, I don't want the events to bubble out of the div itself, so added this: $myDiv.focusin(function(e){e.preventDefault()}); This does NOT work. Changing focus within elements within myDiv triggers the focusin event on the body. Is this maybe a bug in jQuery? If so is there a better way to accomplish this?

    Read the article

  • Find whether a particular cell of a table has an img tag

    - by SilentPro
    I am generating a table dynamically using Django. The same table template is used to generate a variety of tables depending on the data supplied. In one scenario a particular column contains image tags. Since my table is editable (using jquery) the image cell also becomes editable and removes my content. I want some special behavior on double click of such cells like say upload an image. How do I accomplish this with a jquery? My script for making the table editable is given below. $(function() { $("td").dblclick(function() { var OriginalContent = $(this).text(); $(this).addClass("cellEditing"); $(this).html("<input type='text' value='" + OriginalContent + "' />"); $(this).children().first().focus(); $(this).children().first().keypress(function(e) { if (e.which == 13) { var newContent = $(this).val(); $(this).parent().text(newContent); $(this).parent().removeClass("cellEditing"); } }); $(this).children().first().blur(function() { $(this).parent().text(OriginalContent); $(this).parent().removeClass("cellEditing"); }); }); });

    Read the article

  • Spinner setonitemselectedlistener is not called

    - by Gabrielle
    I have a strange problem. I need to do something when an item from spinner is selected. Here is my code : language = (Spinner) findViewById(R.id.current_language_text); ArrayAdapter adapter = new ArrayAdapter(this, com.Orange.R.layout.my_spinner_textview, languages); adapter.setDropDownViewResource(com.Orange.R.layout.multiline_spinner_dropdown_item); language.setAdapter(adapter); language.setSelection(Integer.valueOf(language_id) - 1); language.setOnItemSelectedListener(new OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> parentView, View selectedItemView, int position, long id) { System.out.println("position "+position); Toast.makeText(Settings.this, "Hello Toast",Toast.LENGTH_SHORT).show(); } @Override public void onNothingSelected(AdapterView<?> parentView) { // your code here } }); The problem is that onItemSelectedListener is not called. I put System.out.println in onItemSelected() but I don't get it in LogCat. I tried with Toast, and I get the same, it doesn't appear. Every time I select an item from spinner, in LogCat I get this warning : Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@2b1dabd0 Any idea why onItemSelectedListener is not called ?

    Read the article

  • Post parameters to a frame of new window

    - by st.stoqnov
    I have to modify an existing web search page. There is a page, where all the search filters are (form with name "searchform"). When the search button is pressed, results are shown in new window. Because the search takes up to 30 seconds, and while searching the window stays blank, I have to add a label "Searching. Please wait..." at the new created window with the results. So the search window is created, and I set it's location to a frameset. First frame will show the label, and the second will show the results. But i can't manage to update the second frame with the results. Result windows is created as: var left = (screen.width/2) - 750/2; var top = (screen.height/2) - 600/2-100; var styleStr = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=750,height=600,left='+left+',top='+top+',screenX='+left+',screenY='+top; var msgWindow = window.open('ex_search_frameset.php', 'results_exi', styleStr); msgWindow.focus(); Than the search is requested: f = document.searchform; f.action = 'ex_search_results.php'; f.target = msgWindow.document.res_frame; // here i can't figure out what the target must be // or how to post the params from "f" to the second frame "res_frame" f.submit(); Here is the frameset. <frameset rows="200,*" border="1" name="SearchFrame"> <frame name="wait_frame" src="ex_search_wait.php" target="right"> <frame name="res_frame" src="ex_search_results.php" target="_self"> </frameset> Any idea how to do this?

    Read the article

  • autoscroll problem

    - by deepasundarip
    I have a panel and in that a control should get added on the panel click of the button in that control.. I docked those controls to bottom since i have another control which has to be at top always... Now the problem is, I set a maxsize so that after the maxsize is reached the autoscroll of the panel should kick in, and the requirement is like when a control is added, scroll should slide down to the latest added control.. I don't know how to achieve that requirement... Edit this code on the controls button click... SearchCriterionControl control = new SearchCriterionControl(); control.SupportedMetaDataItems = this.supportedSearchParams; control.AddOrRemoveButtonClick += new EventHandler(AddOrRemoveSearchItemsButtonClick); control.Location = new Point(SearchCriteriaControl.STARTWIDTH, this.searchCritenControl.Height * (this.pnlSearchItems.Controls.Count - 1) + (this.expanderWithLabelSearch.Height) + SearchCriteriaControl.MARGIN * 2); this.SuspendLayout(); this.pnlSearchItems.Controls.Add(control); this.ResumeLayout(false); this.PerformLayout(); control.Focus(); And this to place the controls accordingly on panel: this.pnlSearchItems.AutoScroll = false; this.pnlSearchItems.Height = this.expanderWithLabelSearch.Height + (numberOfControls) * this.searchCritenControl.Height + SearchCriteriaControl.MARGIN * 2; this.tlpSearchBy.Height = this.pnlSearchItems.Height; this.Height = this.pnlSearchItems.Height + his.pnlGroupItems.Height + this.pnlControls.Height + SearchCriteriaControl.MARGIN * 4; this.tblGroupBy.Location = new Point(SearchCriteriaControl.STARTWIDTH, this.pnlSearchItems.Height + SearchCriteriaControl.MARGIN * 2);

    Read the article

  • How reference popup object when opener page changes?

    - by achairapart
    This is driving me crazy! Scenario: The main page opens a pop-up window and later calls a function in it: newWin = window.open(someurl,'newWin',options); ...some code later... newWin.remoteFunction(options); and it's ok. Now, popup is still open and Main Page changes to Page 2. In Page 2 newWin doesn't exist anymore and I need to recreate the popup window object reference in order to call again the remote function (newWin.remoteFunction) I tried something like: newWin = open('','newWin', options); if (!newWin || newWin.closed || !newWin.remoteFunction) { newWin = window.open(someurl,'newWin',options); } And it works, I can call newWin.remoteFunction again BUT Safari for some reason gives Focus() to the popup window everytime the open() method is called breaking the navigation (I absolutely need the popup working in the background). Only workaround I can think to solve this is to create an interval in the popup with: if(window.opener && !window.opener.newWin) window.opener.newWin = self; and then set another interval in the opener Page with some try/catch but it is inelegant and very inefficient. so, I wonder, it's really so hard to get the popup object reference between different pages in the opener window?

    Read the article

  • Rate my C# code (~300 SLOC) using GDI+/Backgroundworker

    - by sebastianlarsson
    Hi, I want to get some feedback on my code! Below is some background info. I am taking a pre-certification course in C# (Sweden, 15 ECTS). The focus of the course is theoretical and only limited practical work. I dont find the assignments very hard at all to tell you the truth, but since I only have very limited work experience as a developer (I have worked 15h/week at Ericsson since November) I think I would benefit from having the certificate (70-536 and more probably). I am currently reading Martin Fowler's "Refactoring: Improving the design of existing code" and I tried to apply his techniques to my latest lab in the course. I have been on the lookout for a website which have the idea of providing feedback on code, but so far I have yet to discover any. Please take a look on my code and tell me what you think. It is only roughly 300 lines of code divided into a couple of classes. GDI+, backgroundworker and user controls are what the lab is about. I reckon you may have to spend as little as a couple of minutes on looking on the solution. Link to solution: http://www.filefactory.com/file/b18h7d5/n/Lab4_Lab5_SebastianLarsson.zip Regards and thank you, Sebastian

    Read the article

  • Password value on click is not changing the text to 'Password'

    - by Sam
    window.onload=function() { var password = document.getElementById('apassword'); var real = document.getElementById('password'); var fake = document.createElement('input'); fake.setAttribute('type', 'text'); /*fake.setAttribute('id', 'password');*/ fake.setAttribute('class', 'contact-input contact-right'); password.appendChild(fake); fake.setAttribute('value', 'Password'); fake.onfocus = function() {this.style.display='none';real.style.display=''; real.focus();}; real.style.display = 'none'; real.setAttribute('value', ''); real.onblur = function() {if(this.value==''){this.style.display='none';fake.style.display=''}}; }; AND <label id="apassword"> <input type="password" title="Password" id="password" class="contact-input contact-right" name="password" /> </label> What is supposed to happen is that when you click on the input box, it changes from 'Password' to a blank type="password" input box, however it doesn't happen. This originally worked, but then I had to change some ID's and classes etc. I'm not sure how to debug scripts, so hopefully someone can help me with that, and also with my question :). Thankyou :).

    Read the article

  • AJAX help needed

    - by tharindu
    Hi guys.. i have problem in ajax.. im new comer for ajax...:) <script type="text/javascript"> $(document).ready(function() { $("#bcode").focus(); //prevents autocomplete in some browsers $("#bcode").attr('autocomplete', 'off').keyup(function(event) { var name = $("#bcode").val(); $("#status").empty(); if(name.length > 17 ) { selectAll(); $("#status").html('<img align="absmiddle" src="loading.gif" /> Checking availability...').show(); $.ajax({ type: "POST", url: "namecheck.php", data: "bcode="+ name, success: function(msg) { $("#status").html(msg).show(); } }); } else { $("#status").html('').addClass('err').show(); } }); }); //--> </script> i got text box value 'bcode' using '$_POST['bcode']' <input name="bcode" type="text" class="bcode" id="bcode" maxlength="18"; /> also i have menu/list in that form <select name="pallete" class="list_box" id="select"> <option value="P0" selected> </option> <option value="P1">P1</option> <option value="P2">P2</option> <option value="P3">P3</option> <option value="P4">P4</option> <option value="P5">P5</option> </select> How i can access selected item from php file by using '$_POST['pallete']' please help me. Thanks in advance..

    Read the article

  • jquery problem in IE working fine in FF

    - by Bharanikumar
    function populate_customer_details(){ $.ajax({ type : 'POST', url : 'populate_customer_details.php', data: { email : $('#txt_email_id').val() }, success : function(data){ if(data=="NOROWSFOUND"){ alert("Sorry, Email ID not exist in our database"); document.getElementById("txt_email_id").focus(); }else{ var val = explode_all_into_arr(data,"|=|"); document.getElementById("FirstName").value = val[0]; document.getElementById("LastName").value = val[1]; document.getElementById("mobilecountrycode").value = parseInt(val[2]); document.getElementById("MobileNo").value = val[3]; document.getElementById("homecountrycode").value = parseInt(val[4]); document.getElementById("HomeNo").value = val[5]; document.getElementById("PaxEmail").value = val[6]; document.getElementById("PaxEmailConf").value = val[6]; } }, }); } This is my snippet purpose is getting the customer details and populate into textfield and combo box , That is Firstname will append into Firstname text field , Secondname will append into Secondname text field , Same like mobilecountrycode (but this is dropdown combo), Some time combo selectedindex work fine, but some time not selecting the value , I am not sure what s problem in that... Nothing works in IE , Also showing object expected error in IE , i have ajax_common.js : in this i added above script , in the page top first i included the jquery.js , Then i include ajax_common.js file, But no idea why this problem. Regards (NOTE i included the jquery.js ) ,

    Read the article

  • How to set default view in OpenLayers, WITHOUT restricting bounds?

    - by Jenny
    Based on samples, I can see that you can set a default view in OpenLayers by saying something along the lines of: var bounds = new OpenLayers.Bounds(-125, 25, -65, 50); var map = new OpenLayers.Map('map', {restrictedExtent: bounds }); However, this also (as the name implies), restricts me to be able to ONLY navigate within these bounds. I can zoom out and see things outside of these bounds, but I can't then zoom back onto them, or scroll to them. I've tried not having any restrictedExtent (or making it the entire map), but then I can't get it to focus on the area I want. I tried using: map.setCenter(new OpenLayers.LonLat(0,0), 3); console.log(map.getCenter()); To set the zoom and the center...but it doesn't seem to do ANYTHING, other than set the variable "center" which I can then read from map.getCenter() (if I don't set it, it's null, if I do set it, I can see it...but the map itself stays fully extended and it's center doesn't seem to change at all...) The Map layer I am using is: OpenLayers.Layer.OSM.Mapnik with displayOutsideMaxExtent set to true... I'm really at a loss here. My goal is to have a default region of the world zoomed in to and in view (such as the United States), with the option of viewers being able to go outside the default to view things.

    Read the article

< Previous Page | 142 143 144 145 146 147 148 149 150 151 152 153  | Next Page >