wicket-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "rajeev (JIRA)" <j...@apache.org>
Subject [jira] Commented: (WICKET-3093) Self-updating AutoCompleteTextField moves focus to start of field in IE only
Date Mon, 07 Mar 2011 07:29:59 GMT

    [ https://issues.apache.org/jira/browse/WICKET-3093?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13003283#comment-13003283
] 

rajeev commented on WICKET-3093:
--------------------------------

Hi Attila,

Thanks for the update. I tried it in my quickstart project and it is working fine in IE9.
Now even onchange event does not lose focus after adding this line in my html and also target.addComponent(getFormComponent())
is working fine without any issues.

But in my real time project, even after adding this line, it is not resoving the issue. I
checked the ajax logs from both apps and I am copying logs below:
============QUICKSTART APPLICATION =========================================================================================

INFO: focus removed from 

INFO: focus set on autocomplete1

INFO: 

INFO: Initiating Ajax GET request on ?wicket:interface=:0:form:autocomplete::IActivePageBehaviorListener:1:-1&wicket:ignoreIfNotActive=true&q=i&random=0.2713084402249128

INFO: Invoking pre-call handler(s)...

INFO: Received ajax response (317 characters)

INFO: 
<ul><li textvalue="Iraq">Iraq</li><li textvalue="Ireland">Ireland</li><li
textvalue="Indonesia">Indonesia</li><li textvalue="India">India</li><li
textvalue="Iceland">Iceland</li><li textvalue="Italy">Italy</li><li
textvalue="Ireland">Ireland</li><li textvalue="India">India</li><li
textvalue="Israel">Israel</li></ul>

INFO: returned focused element: [object HTMLInputElement]

INFO: Response processed successfully.

INFO: Invoking post-call handler(s)...

INFO: focus removed from autocomplete1

INFO: focus set on autocomplete1

INFO: 

INFO: Initiating Ajax POST request on ?wicket:interface=:0:form:autocomplete::IBehaviorListener:0:-1&random=0.4214748885916746

INFO: Invoking pre-call handler(s)...
INFO: returned focused element: [object HTMLInputElement]
INFO: Received ajax response (1699 characters)
INFO: 
<?xml version="1.0" encoding="UTF-8"?><ajax-response><header-contribution encoding="wicket1"
><![CDATA[<head xmlns:wicket="http://wicket.apache.org"><script type="text/javascript"
src="resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js"></script>
 <script type="text/javascript" src="resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js"></script>
 <script type="text/javascript" src="resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax-debug.js"></script>
 <script type="text/javascript" id="wicket-ajax-debug-enable"><!--/*--><![CDATA[/*><!--*/
wicketAjaxDebugEnable=true;
/*-->]^]^>*/</script>

<script type="text/javascript" src="resources/org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteBehavior/wicket-autocomplete.js"></script>
 </head>]]></header-contribution><component id="autocomplete1" ><![CDATA[<input
type="text" size="50" value="India" name="autocomplete" id="autocomplete1" autocomplete="off"
onchange="var wcall=wicketAjaxPost('?wicket:interface=:0:form:autocomplete::IBehaviorListener:0:-1',
wicketSerialize(Wicket.$('autocomplete1')),function() { }.bind(this),function() { }.bind(this),
function() {return Wicket.$('autocomplete1') != null;}.bind(this));"/>]]></component><evaluate><![CDATA[new
Wicket.AutoComplete('autocomplete1','?wicket:interface=:0:form:autocomplete::IActivePageBehaviorListener:1:-1&wicket:ignoreIfNotActive=true',{preselect:
false,maxHeight: -1,adjustInputWidth: true,useSmartPositioning: false,useHideShowCoveredIEFix:
true,showListOnEmptyInput: false,showListOnFocusGain: false,throttleDelay: 300,showCompleteListOnFocusGain:
false},null);]]></evaluate></ajax-response>

INFO: Response parsed. Now invoking steps...

INFO: returned focused element: [object HTMLInputElement]

INFO: returned focused element: [object HTMLInputElement]

INFO: Response processed successfully.

INFO: Invoking post-call handler(s)...

INFO: Calling focus on autocomplete1

INFO: focus set on autocomplete1

INFO: focus removed from autocomplete1

================================== REAL TIME APPLICATION=========================================================

INFO: focus set on searchboxa
INFO: 
INFO: Initiating Ajax GET request on ?wicket:interface=:0:header:search:searchBoxForm:searchbox::IActivePageBehaviorListener:2:-1&wicket:ignoreIfNotActive=true&q=dell&random=0.8830562480124044
INFO: Invoking pre-call handler(s)...
INFO: Received ajax response (743 characters)
INFO: 
<ul><li textvalue="DELL 2707WFP">DELL 2707WFP</li><li textvalue="DELL
2709W">DELL 2709W</li><li textvalue="DELL 3007WFP">DELL 3007WFP</li><li
textvalue="DELL 3007WFP-HC">DELL 3007WFP-HC</li><li textvalue="DELL 4220">DELL
4220</li><li textvalue="DELL 4320">DELL 4320</li><li textvalue="DELL
EC280">DELL EC280</li><li textvalue="DELL MINI 3">DELL MINI 3</li><li
textvalue="DELL MINI 5">DELL MINI 5</li><li textvalue="DELL S500">DELL S500</li><li
textvalue="DELL S500WI">DELL S500WI</li><li textvalue="DELL ULTRASHARP U2711">DELL
ULTRASHARP U2711</li><li textvalue="DELL ULTRASHARP U3011">DELL ULTRASHARP U3011</li><li
textvalue="Dell Enterprise Technology Center">Dell Enterprise Technology Center</li><li
textvalue="Why Dell">Why Dell</li></ul>
INFO: returned focused element: [object]
INFO: Response processed successfully.
INFO: Invoking post-call handler(s)...
INFO: 
INFO: Initiating Ajax POST request on ?wicket:interface=:0:header:search:searchBoxForm:searchbox::IBehaviorListener:1:-1&random=0.8094410115518278
INFO: Invoking pre-call handler(s)...
INFO: Calling focus on searchboxa
INFO: focus removed from searchboxa
INFO: focus set on searchboxa
INFO: Received ajax response (1839 characters)
INFO: 
<?xml version="1.0" encoding="UTF-8"?><ajax-response><header-contribution encoding="wicket1"
><![CDATA[<head xmlns:wicket="http://wicket.apache.org"><script type="text/javascript"
src="resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js"></script>

<script type="text/javascript" src="resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js"></script>

<script type="text/javascript" src="resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax-debug.js"></script>

<script type="text/javascript" id="wicket-ajax-debug-enable"><!--/*--><![CDATA[/*><!--*/
wicketAjaxDebugEnable=true;
/*-->]^]^>*/</script>

<script type="text/javascript" src="resources/org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteBehavior/wicket-autocomplete.js"></script>

</head>]]></header-contribution><component id="searchboxa" ><![CDATA[<input
name="searchbox" type="text" class="searchbox" style="vertical-align: middle;" value="dell"
id="searchboxa" autocomplete="off" onchange="var wcall=wicketAjaxPost('?wicket:interface=:0:header:search:searchBoxForm:searchbox::IBehaviorListener:1:-1',
wicketSerialize(Wicket.$('searchboxa')),function() { }.bind(this),function() { }.bind(this),
function() {return Wicket.$('searchboxa') != null;}.bind(this));"/>]]></component><evaluate><![CDATA[new
Wicket.AutoComplete('searchboxa','?wicket:interface=:0:header:search:searchBoxForm:searchbox::IActivePageBehaviorListener:2:-1&wicket:ignoreIfNotActive=true',{preselect:
false,maxHeight: -1,adjustInputWidth: true,useSmartPositioning: false,useHideShowCoveredIEFix:
true,showListOnEmptyInput: false,showListOnFocusGain: false,throttleDelay: 300,showCompleteListOnFocusGain:
false},null);]]></evaluate><evaluate><![CDATA[document.getElementById('searchboxa').focus();]]></evaluate></ajax-response>
INFO: Response parsed. Now invoking steps...
INFO: returned focused element: [object]
INFO: returned focused element: [object]
INFO: Response processed successfully.
INFO: Invoking post-call handler(s)...
INFO: focus set on searchboxa
INFO: refocus last focused component not needed/allowed
INFO: focus removed from searchboxa

==================================================================




> Self-updating AutoCompleteTextField moves focus to start of field in IE only
> ----------------------------------------------------------------------------
>
>                 Key: WICKET-3093
>                 URL: https://issues.apache.org/jira/browse/WICKET-3093
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.4.12
>            Reporter: Alex Grant
>            Assignee: Martin Grigorov
>            Priority: Minor
>         Attachments: WICKET-3093-autocomplete.zip, WicketTestProject.zip
>
>
> I have an AutoCompleteTextField that has a AjaxFormSubmitBehavior("onchange") attached
so that we can canonicalise the value (eg correct the case) automatically. In IE only, when
you pause long enough to trigger the AjaxFormSubmitBehavior, the cursor moves to the start
of the text field, so if you type "123" slowly you may be "312".
> This is only an issue in IE as it is caused by WICKET-2279 - if I remove the javascript
added for that bug the problem goes away.
> The problem can also be solved by changing AjaxFormSubmitBehavior("onchange") to AjaxFormSubmitBehavior("onblur"),
but I still consider it a bug given it only occurs in IE - Firefox and Chrome behave correctly
no matter what you do.
> Also, since the javascript added in WICKET-2279 starts with the comment "// hack for
a focus issue in IE, WICKET-2279" I figured you'd like to know about any quirky behaviour
it causes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message