You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Olivier Dutrieux (JIRA)" <ji...@apache.org> on 2009/01/05 19:15:44 UTC

[jira] Created: (WICKET-2005) pb to access to this on event onchange on the AutoCompleteTextField

pb to access to this on event onchange on the AutoCompleteTextField
-------------------------------------------------------------------

                 Key: WICKET-2005
                 URL: https://issues.apache.org/jira/browse/WICKET-2005
             Project: Wicket
          Issue Type: Bug
          Components: wicket-extensions
    Affects Versions: 1.4-RC1
         Environment: Windows XP, Firefox 3.0, IE7, safari 3.0
            Reporter: Olivier Dutrieux


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){
86      		if(mouseactive==1)return false;
87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal();
88      	}
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 = "{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 :

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


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

Duto

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-2005) pb to access to this on event onchange on the AutoCompleteTextField

Posted by "Olivier Dutrieux (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2005?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olivier Dutrieux updated WICKET-2005:
-------------------------------------

    Attachment:     (was: src.rar)

> pb to access to this on event onchange on the AutoCompleteTextField
> -------------------------------------------------------------------
>
>                 Key: WICKET-2005
>                 URL: https://issues.apache.org/jira/browse/WICKET-2005
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.4-RC1
>         Environment: Windows XP, Firefox 3.0, IE7, safari 3.0
>            Reporter: Olivier Dutrieux
>         Attachments: src.zip
>
>
> 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){
> 86      		if(mouseactive==1)return false;
> 87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal();
> 88      	}
> 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 = "{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 :
> 83// WICKET-1280
> 84        objonchangeoriginal=obj.onchange; 
> 85        obj.onchange=function(event){
> 86      		if(mouseactive==1)return false;
> 87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal.apply(this, [event]);
> 88      	}
> 89        objonchange=obj.onchange;
> all invocation of function need to be change this with new invocation on the wicket-autocomplete.js file
> I will add a full example in the 1-2 hours (wait please ^^^)
> Duto

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-2005) pb to access to this on event onchange on the AutoCompleteTextField

Posted by "Olivier Dutrieux (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2005?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olivier Dutrieux updated WICKET-2005:
-------------------------------------

    Attachment: screenshot-1.jpg

> pb to access to this on event onchange on the AutoCompleteTextField
> -------------------------------------------------------------------
>
>                 Key: WICKET-2005
>                 URL: https://issues.apache.org/jira/browse/WICKET-2005
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.4-RC1
>         Environment: Windows XP, Firefox 3.0, IE7, safari 3.0
>            Reporter: Olivier Dutrieux
>         Attachments: screenshot-1.jpg, src.zip, wicket-autocomplete.js
>
>
> 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){
> 86      		if(mouseactive==1)return false;
> 87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal();
> 88      	}
> 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 = "{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 :
> 83// WICKET-1280
> 84        objonchangeoriginal=obj.onchange; 
> 85        obj.onchange=function(event){
> 86      		if(mouseactive==1)return false;
> 87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal.apply(this, [event]);
> 88      	}
> 89        objonchange=obj.onchange;
> all invocation of function need to be change this with new invocation on the wicket-autocomplete.js file
> I will add a full example in the 1-2 hours (wait please ^^^)
> Duto

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-2005) pb to access to this on event onchange on the AutoCompleteTextField

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2005?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg updated WICKET-2005:
----------------------------------

    Fix Version/s:     (was: 1.4-RC2)
                   1.4-RC3

see any other spots i missed?

> pb to access to this on event onchange on the AutoCompleteTextField
> -------------------------------------------------------------------
>
>                 Key: WICKET-2005
>                 URL: https://issues.apache.org/jira/browse/WICKET-2005
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.4-RC1
>         Environment: Windows XP, Firefox 3.0, IE7, safari 3.0
>            Reporter: Olivier Dutrieux
>            Assignee: Igor Vaynberg
>             Fix For: 1.4-RC3
>
>         Attachments: screenshot-1.jpg, src.zip, wicket-autocomplete.js
>
>
> 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){
> 86      		if(mouseactive==1)return false;
> 87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal();
> 88      	}
> 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 = "{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 :
> 83// WICKET-1280
> 84        objonchangeoriginal=obj.onchange; 
> 85        obj.onchange=function(event){
> 86      		if(mouseactive==1)return false;
> 87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal.apply(this, [event]);
> 88      	}
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-2005) pb to access to this on event onchange on the AutoCompleteTextField

Posted by "Olivier Dutrieux (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2005?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olivier Dutrieux updated WICKET-2005:
-------------------------------------

    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){
86      		if(mouseactive==1)return false;
87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal();
88      	}
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 = "{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 :

83// WICKET-1280
84        objonchangeoriginal=obj.onchange; 
85        obj.onchange=function(event){
86      		if(mouseactive==1)return false;
87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal.apply(this, [event]);
88      	}
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

  was:
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){
86      		if(mouseactive==1)return false;
87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal();
88      	}
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 = "{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 :

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


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

I will add a full example in the 1-2 hours (wait please ^^^)

Duto


> pb to access to this on event onchange on the AutoCompleteTextField
> -------------------------------------------------------------------
>
>                 Key: WICKET-2005
>                 URL: https://issues.apache.org/jira/browse/WICKET-2005
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.4-RC1
>         Environment: Windows XP, Firefox 3.0, IE7, safari 3.0
>            Reporter: Olivier Dutrieux
>         Attachments: screenshot-1.jpg, src.zip, wicket-autocomplete.js
>
>
> 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){
> 86      		if(mouseactive==1)return false;
> 87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal();
> 88      	}
> 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 = "{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 :
> 83// WICKET-1280
> 84        objonchangeoriginal=obj.onchange; 
> 85        obj.onchange=function(event){
> 86      		if(mouseactive==1)return false;
> 87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal.apply(this, [event]);
> 88      	}
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-2005) pb to access to this on event onchange on the AutoCompleteTextField

Posted by "Olivier Dutrieux (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2005?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olivier Dutrieux updated WICKET-2005:
-------------------------------------

    Attachment: src.zip

I simple test that's add a AutoCompleteTextField on form. And I overwrite the onchange script to display (on javascripty alert) the id of AutoCompleteTextField. And the id is undefined. It's not normal and it's due to the how the the original onchange event is execute on the wicket-autocomplete.js.

> pb to access to this on event onchange on the AutoCompleteTextField
> -------------------------------------------------------------------
>
>                 Key: WICKET-2005
>                 URL: https://issues.apache.org/jira/browse/WICKET-2005
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.4-RC1
>         Environment: Windows XP, Firefox 3.0, IE7, safari 3.0
>            Reporter: Olivier Dutrieux
>         Attachments: src.zip
>
>
> 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){
> 86      		if(mouseactive==1)return false;
> 87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal();
> 88      	}
> 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 = "{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 :
> 83// WICKET-1280
> 84        objonchangeoriginal=obj.onchange; 
> 85        obj.onchange=function(event){
> 86      		if(mouseactive==1)return false;
> 87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal.apply(this, [event]);
> 88      	}
> 89        objonchange=obj.onchange;
> all invocation of function need to be change this with new invocation on the wicket-autocomplete.js file
> I will add a full example in the 1-2 hours (wait please ^^^)
> Duto

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2005) pb to access to this on event onchange on the AutoCompleteTextField

Posted by "Olivier Dutrieux (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2005?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12671092#action_12671092 ] 

Olivier Dutrieux commented on WICKET-2005:
------------------------------------------

No I think it's ok now. Thinks very much.

> pb to access to this on event onchange on the AutoCompleteTextField
> -------------------------------------------------------------------
>
>                 Key: WICKET-2005
>                 URL: https://issues.apache.org/jira/browse/WICKET-2005
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.4-RC1
>         Environment: Windows XP, Firefox 3.0, IE7, safari 3.0
>            Reporter: Olivier Dutrieux
>            Assignee: Igor Vaynberg
>             Fix For: 1.4-RC3
>
>         Attachments: screenshot-1.jpg, src.zip, wicket-autocomplete.js
>
>
> 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){
> 86      		if(mouseactive==1)return false;
> 87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal();
> 88      	}
> 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 = "{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 :
> 83// WICKET-1280
> 84        objonchangeoriginal=obj.onchange; 
> 85        obj.onchange=function(event){
> 86      		if(mouseactive==1)return false;
> 87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal.apply(this, [event]);
> 88      	}
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2005) pb to access to this on event onchange on the AutoCompleteTextField

Posted by "dutrieux (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2005?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12667620#action_12667620 ] 

dutrieux commented on WICKET-2005:
----------------------------------

Do you have some news about my issue Gerolf Seitz ?

Best regards

> pb to access to this on event onchange on the AutoCompleteTextField
> -------------------------------------------------------------------
>
>                 Key: WICKET-2005
>                 URL: https://issues.apache.org/jira/browse/WICKET-2005
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.4-RC1
>         Environment: Windows XP, Firefox 3.0, IE7, safari 3.0
>            Reporter: Olivier Dutrieux
>         Attachments: screenshot-1.jpg, src.zip, wicket-autocomplete.js
>
>
> 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){
> 86      		if(mouseactive==1)return false;
> 87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal();
> 88      	}
> 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 = "{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 :
> 83// WICKET-1280
> 84        objonchangeoriginal=obj.onchange; 
> 85        obj.onchange=function(event){
> 86      		if(mouseactive==1)return false;
> 87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal.apply(this, [event]);
> 88      	}
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2005) pb to access to this on event onchange on the AutoCompleteTextField

Posted by "Olivier Dutrieux (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2005?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12669521#action_12669521 ] 

Olivier Dutrieux commented on WICKET-2005:
------------------------------------------

Well done but I think you forget to correct the line 357 : 

if (typeof objonchange=="function") {objonchange();}

patch ==> if (typeof objonchange=="function") {objonchange.apply(wicketGet(elementId), [event]);}

best regards

> pb to access to this on event onchange on the AutoCompleteTextField
> -------------------------------------------------------------------
>
>                 Key: WICKET-2005
>                 URL: https://issues.apache.org/jira/browse/WICKET-2005
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.4-RC1
>         Environment: Windows XP, Firefox 3.0, IE7, safari 3.0
>            Reporter: Olivier Dutrieux
>            Assignee: Igor Vaynberg
>             Fix For: 1.4-RC2
>
>         Attachments: screenshot-1.jpg, src.zip, wicket-autocomplete.js
>
>
> 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){
> 86      		if(mouseactive==1)return false;
> 87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal();
> 88      	}
> 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 = "{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 :
> 83// WICKET-1280
> 84        objonchangeoriginal=obj.onchange; 
> 85        obj.onchange=function(event){
> 86      		if(mouseactive==1)return false;
> 87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal.apply(this, [event]);
> 88      	}
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-2005) pb to access to this on event onchange on the AutoCompleteTextField

Posted by "Olivier Dutrieux (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2005?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olivier Dutrieux updated WICKET-2005:
-------------------------------------

    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){
86      		if(mouseactive==1)return false;
87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal();
88      	}
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 = "{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 :

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


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

I will add a full example in the 1-2 hours (wait please ^^^)

Duto

  was:
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){
86      		if(mouseactive==1)return false;
87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal();
88      	}
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 = "{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 :

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


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

<b>I will add a full example in the 1-2 hours (wait please ^^^)<b>

Duto


> pb to access to this on event onchange on the AutoCompleteTextField
> -------------------------------------------------------------------
>
>                 Key: WICKET-2005
>                 URL: https://issues.apache.org/jira/browse/WICKET-2005
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.4-RC1
>         Environment: Windows XP, Firefox 3.0, IE7, safari 3.0
>            Reporter: Olivier Dutrieux
>
> 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){
> 86      		if(mouseactive==1)return false;
> 87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal();
> 88      	}
> 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 = "{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 :
> 83// WICKET-1280
> 84        objonchangeoriginal=obj.onchange; 
> 85        obj.onchange=function(event){
> 86      		if(mouseactive==1)return false;
> 87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal.apply(this, [event]);
> 88      	}
> 89        objonchange=obj.onchange;
> all invocation of function need to be change this with new invocation on the wicket-autocomplete.js file
> I will add a full example in the 1-2 hours (wait please ^^^)
> Duto

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-2005) pb to access to this on event onchange on the AutoCompleteTextField

Posted by "Olivier Dutrieux (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2005?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olivier Dutrieux updated WICKET-2005:
-------------------------------------

    Attachment: wicket-autocomplete.js

This is my patched version of wicket-autocomplete.js : That's solve the problem for all events :

affected lines : 
87 : if(typeof objonchangeoriginal=="function")objonchangeoriginal.apply(this, [event]);
97 : if(typeof objonblur=="function")objonblur.apply(this, [event]);
108 : if(typeof objonfocus=="function")objonfocus.apply(this, [event]);
143 : if(typeof objonchange=="function") objonchange.apply(this, [event]);
152 : if(typeof objonkeydown=="function")objonkeydown.apply(this, [event]);
181 : if(typeof objonkeyup=="function")objonkeyup.apply(this, [event]);
192 : if(typeof objonkeypress=="function")objonkeypress.apply(this, [event]);
356 : if (typeof objonchange=="function") {objonchange.apply(wicketGet(elementId), [event]);}


> pb to access to this on event onchange on the AutoCompleteTextField
> -------------------------------------------------------------------
>
>                 Key: WICKET-2005
>                 URL: https://issues.apache.org/jira/browse/WICKET-2005
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.4-RC1
>         Environment: Windows XP, Firefox 3.0, IE7, safari 3.0
>            Reporter: Olivier Dutrieux
>         Attachments: src.zip, wicket-autocomplete.js
>
>
> 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){
> 86      		if(mouseactive==1)return false;
> 87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal();
> 88      	}
> 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 = "{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 :
> 83// WICKET-1280
> 84        objonchangeoriginal=obj.onchange; 
> 85        obj.onchange=function(event){
> 86      		if(mouseactive==1)return false;
> 87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal.apply(this, [event]);
> 88      	}
> 89        objonchange=obj.onchange;
> all invocation of function need to be change this with new invocation on the wicket-autocomplete.js file
> I will add a full example in the 1-2 hours (wait please ^^^)
> Duto

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2005) pb to access to this on event onchange on the AutoCompleteTextField

Posted by "Olivier Dutrieux (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2005?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12661648#action_12661648 ] 

Olivier Dutrieux commented on WICKET-2005:
------------------------------------------

I hope it's not to bad for your system :-S

> pb to access to this on event onchange on the AutoCompleteTextField
> -------------------------------------------------------------------
>
>                 Key: WICKET-2005
>                 URL: https://issues.apache.org/jira/browse/WICKET-2005
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.4-RC1
>         Environment: Windows XP, Firefox 3.0, IE7, safari 3.0
>            Reporter: Olivier Dutrieux
>         Attachments: screenshot-1.jpg, src.zip, wicket-autocomplete.js
>
>
> 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){
> 86      		if(mouseactive==1)return false;
> 87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal();
> 88      	}
> 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 = "{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 :
> 83// WICKET-1280
> 84        objonchangeoriginal=obj.onchange; 
> 85        obj.onchange=function(event){
> 86      		if(mouseactive==1)return false;
> 87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal.apply(this, [event]);
> 88      	}
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WICKET-2005) pb to access to this on event onchange on the AutoCompleteTextField

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2005?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg resolved WICKET-2005.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 1.4-RC2
         Assignee: Igor Vaynberg

> pb to access to this on event onchange on the AutoCompleteTextField
> -------------------------------------------------------------------
>
>                 Key: WICKET-2005
>                 URL: https://issues.apache.org/jira/browse/WICKET-2005
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.4-RC1
>         Environment: Windows XP, Firefox 3.0, IE7, safari 3.0
>            Reporter: Olivier Dutrieux
>            Assignee: Igor Vaynberg
>             Fix For: 1.4-RC2
>
>         Attachments: screenshot-1.jpg, src.zip, wicket-autocomplete.js
>
>
> 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){
> 86      		if(mouseactive==1)return false;
> 87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal();
> 88      	}
> 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 = "{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 :
> 83// WICKET-1280
> 84        objonchangeoriginal=obj.onchange; 
> 85        obj.onchange=function(event){
> 86      		if(mouseactive==1)return false;
> 87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal.apply(this, [event]);
> 88      	}
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-2005) pb to access to this on event onchange on the AutoCompleteTextField

Posted by "Olivier Dutrieux (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2005?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olivier Dutrieux updated WICKET-2005:
-------------------------------------

    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){
86      		if(mouseactive==1)return false;
87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal();
88      	}
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 = "{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 :

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


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

<b>I will add a full example in the 1-2 hours (wait please ^^^)<b>

Duto

  was:
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){
86      		if(mouseactive==1)return false;
87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal();
88      	}
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 = "{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 :

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


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

Duto


> pb to access to this on event onchange on the AutoCompleteTextField
> -------------------------------------------------------------------
>
>                 Key: WICKET-2005
>                 URL: https://issues.apache.org/jira/browse/WICKET-2005
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.4-RC1
>         Environment: Windows XP, Firefox 3.0, IE7, safari 3.0
>            Reporter: Olivier Dutrieux
>
> 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){
> 86      		if(mouseactive==1)return false;
> 87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal();
> 88      	}
> 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 = "{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 :
> 83// WICKET-1280
> 84        objonchangeoriginal=obj.onchange; 
> 85        obj.onchange=function(event){
> 86      		if(mouseactive==1)return false;
> 87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal.apply(this, [event]);
> 88      	}
> 89        objonchange=obj.onchange;
> all invocation of function need to be change this with new invocation on the wicket-autocomplete.js file
> <b>I will add a full example in the 1-2 hours (wait please ^^^)<b>
> Duto

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-2005) pb to access to this on event onchange on the AutoCompleteTextField

Posted by "Olivier Dutrieux (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2005?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olivier Dutrieux updated WICKET-2005:
-------------------------------------

    Attachment: src.rar

I simple test that's add a AutoCompleteTextField on form. And I overwrite the onchange script to display (on javascripty alert) the id of AutoCompleteTextField. And the id is undefined. It's not normal and it's due to the how the the original onchange event is execute on the wicket-autocomplete.js.

> pb to access to this on event onchange on the AutoCompleteTextField
> -------------------------------------------------------------------
>
>                 Key: WICKET-2005
>                 URL: https://issues.apache.org/jira/browse/WICKET-2005
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.4-RC1
>         Environment: Windows XP, Firefox 3.0, IE7, safari 3.0
>            Reporter: Olivier Dutrieux
>         Attachments: src.zip
>
>
> 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){
> 86      		if(mouseactive==1)return false;
> 87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal();
> 88      	}
> 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 = "{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 :
> 83// WICKET-1280
> 84        objonchangeoriginal=obj.onchange; 
> 85        obj.onchange=function(event){
> 86      		if(mouseactive==1)return false;
> 87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal.apply(this, [event]);
> 88      	}
> 89        objonchange=obj.onchange;
> all invocation of function need to be change this with new invocation on the wicket-autocomplete.js file
> I will add a full example in the 1-2 hours (wait please ^^^)
> Duto

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2005) pb to access to this on event onchange on the AutoCompleteTextField

Posted by "Gerolf Seitz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2005?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12660909#action_12660909 ] 

Gerolf Seitz commented on WICKET-2005:
--------------------------------------

thx olivier,
unfortunately, one of my raid5 drives crashed and my computer is still rebuilding the raid.
it takes 5-10 minutes for eclipse to just start, so i'll have to postpone this until my computer is ready for action again.

> pb to access to this on event onchange on the AutoCompleteTextField
> -------------------------------------------------------------------
>
>                 Key: WICKET-2005
>                 URL: https://issues.apache.org/jira/browse/WICKET-2005
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.4-RC1
>         Environment: Windows XP, Firefox 3.0, IE7, safari 3.0
>            Reporter: Olivier Dutrieux
>         Attachments: screenshot-1.jpg, src.zip, wicket-autocomplete.js
>
>
> 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){
> 86      		if(mouseactive==1)return false;
> 87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal();
> 88      	}
> 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 = "{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 :
> 83// WICKET-1280
> 84        objonchangeoriginal=obj.onchange; 
> 85        obj.onchange=function(event){
> 86      		if(mouseactive==1)return false;
> 87      		if(typeof objonchangeoriginal=="function")objonchangeoriginal.apply(this, [event]);
> 88      	}
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.