From: Brad C. <yo...@br...> - 2005-03-11 23:33:35
|
Not just javascript, but I'd think any page load should clear it. Log a bug on sf.net (with a simple test case if you've got one) so this doesn't get lost :) Brad C --- bk...@up... wrote: > HtmlUnit's implementation for onblur() through the methods > WebClient.moveFocusFromElement and WebClient.moveFocusToElement ends up > causing an infinite loop in certain cases. > > We have javascript on all our pages that set the focus to the correct > input field upon page load. We also have input fields on our pages that > post back to the server to obtain more info when the user enters a value > and tabs out. These fields use the onblur() event to post back to the > server and reload the page. > > Seems pretty straight forward....but here is the issue - HtmlUnit does > not clear the elementWithFocus if an onblur causes a roundtrip to the > server, so when our new page loads, it sets the focus on the correct > input field, which in turn causes the method > WebClient.moveFocusToElement to run, which does another onblur on the > elementWithFocus which is the original field that did the original > onblur from the previous page - so over and over again until the system > crashes onblur is called on this field. I think the fix is for HtmlUnit > to clear the elementWithFocus if javascript causes a post back to the > server. Thoughts? > > Thanks, > > Brian > > > |