I would like create a component that extends AjaxEditableLabel with replace
TextField with AjaxEditableAutoComplete.

And I discovert a problem in the wicket-autocomplete.js when the event
onchange is rewriting (line 83) :

// WICKET-1280
                if(mouseactive==1)return false;
                if(typeof objonchangeoriginal=="function")objonchangeoriginal();

the problem is that the objonchangeoriginal function can't access to the
this object, and it's necessary because I change the onchange event on
AjaxEditableAutoComplete in case I extends AjaxEditableLabel with this : 

        editor.add(new EditorAjaxBehavior()     {
                        private static final long serialVersionUID = 1L;
                        protected void onComponentTag(ComponentTag tag) {
                                final String saveCall = "{wicketAjaxGet('" + 
getCallbackUrl() +
"&save=true&'+this.name+'='+wicketEncode(this.value)); return true;}";
                                tag.put("onchange", saveCall);

then the best way to solve the problem is to change the invocation of
objonchangeoriginal function with that :

84// WICKET-1280
85        objonchangeoriginal=obj.onchange; 
86        obj.onchange=function(event){
87                      if(mouseactive==1)return false;
88                      if(typeof
objonchangeoriginal=="function")objonchangeoriginal.apply(this, [event]);
89              }
90        objonchange=obj.onchange;

all invocation of function need to be change this with new invocation on the
wicket-autocomplete.js file.

View this message in context: 
Sent from the Wicket - User mailing list archive at Nabble.com.

Reply via email to