Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.4-RC1
-
None
-
Windows XP, Firefox 3.0, IE7, safari 3.0
Description
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) :
83// WICKET-1280
84 objonchangeoriginal=obj.onchange;
85 obj.onchange=function(event)
89 objonchange=obj.onchange;
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;
@Override
protected void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
final String saveCall = "
";
tag.put("onchange", saveCall);
}
});
then the best way to solve the problem is to change the invocation of objonchangeoriginal function with that :
83// WICKET-1280
84 objonchangeoriginal=obj.onchange;
85 obj.onchange=function(event)
89 objonchange=obj.onchange;
all invocation of function need to be change this with new invocation on the wicket-autocomplete.js file
You find on attach file a simple example that's show the problem. And my version of wicket-autocomplete.js that solve the problem.
Duto