Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1060
Webdropdown java error if control hidden while loadItems() still waiting for data
posted

Hi - I have a popup panel on my page that contains a number of webdropdown controls.

The web drops downs are in a cascading style...so the drop down above affects the available data in the web drowndown below.

I am using the dropdownobject.loadItems() method from the client side code.

if I change drop down 'A' and that in turn calls the loadItems() method of drop down B, then immediately click a button in my popup panel that causes the panel to close/hide itself, then I get an error in the javascript when the loaditems has completed as the drop down 'B' is no longer visible...but it is trying to switch focus to that control (which the loaditems() method seems to do automatically?!).

The line it fails on is: this._elements["Input"].focus(); within the function :-
      // handles async AJAX response
    _responseComplete: function(callbackObject, responseObject)

I made this easy to demonstrate by adding in a 5 second delay in the server side code of the ItemsRequested event, so I could easily change drop down A, then click a button on my panel which hides the panel (and all the drop downs!)...then a few seconds later the server side code completes and the java code falls over!

Is there a way I can determine on the client side if dropdown is in the middle of an ajax request?  I have tried looking through the online docs but couldn't really spot anything obvious!

many thanks in advance!

Jonathan

Parents
No Data
Reply Children