You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Craig McIlwee <cr...@openroadsconsulting.com> on 2010/02/04 21:40:26 UTC

Override a method in wicket-autocomplete.js

Hello,
 
This is more a JavaScript problem than wicket, but I'm encountering it in the context of a wicket component so maybe others have had the same issue and can offer some guidance.  I'm having some trouble with Wicket.AutoComplete's getOffsetParentZIndex definition, in IE 7 it's returning 0 even though the div that my text field lives on has a z index of 3.  This causes the auto complete popup to be invisible.  I have a suspicion that this is some kind of dojo compatibility issue (the div that the component lives on is a dijit tab), but haven't had much luck on the dojo side.  My next step was to try and override the wicket function and always return a large number.  I'm having problems with this approach also due to the way that the functions are defined within the Wicket.AutoComplete 'class':
 
Wicket.AutoComplete=function(...){
  function getOffsetParentZIndex(...) {
    ...
  }
}
 
As you can see, the functions are not named properties of a Wicket.AutoComplete object so even if I can get a reference to the object created by a call to 'new' I can't replace the function's definition.  Any suggestions on how to get at the Wicket.AutoComplete function definitions without overriding the entire thing?
 
And on a side note, is there any reason that the class isn't defined with this style:
 
Wicket.AutoComplete=function(...){
  this.getOffsetParentZIndex = function(...) {
    ...
  }
}
 
 
Thanks,
Craig