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

[jira] Created: (WICKET-2279) Losing focus on Autocomplete field if DropDownChoice is updated using Ajax.

Losing focus on Autocomplete field if DropDownChoice is updated using Ajax.
---------------------------------------------------------------------------

                 Key: WICKET-2279
                 URL: https://issues.apache.org/jira/browse/WICKET-2279
             Project: Wicket
          Issue Type: Bug
          Components: wicket, wicket-extensions
    Affects Versions: 1.4-RC4, 1.4-RC2
         Environment: Error exposed in IE 6, 7, 8.
Works in Firefox, Chrome.
            Reporter: Aslak Knutsen
            Priority: Critical


It seems that if a DropDownChoice is updated with ajax, the next AutoComplete field will lose focus when triggered if the 
updated DropDownChoice have had focus inbetween beeing updated and AutoComplete is triggered.
But only if focus on the DropDownChoice is gained/lost using KEY_TAB.

More description in the attached example..




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


[jira] Resolved: (WICKET-2279) Losing focus on Autocomplete field if DropDownChoice is updated using Ajax.

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

Igor Vaynberg resolved WICKET-2279.
-----------------------------------

         Assignee: Igor Vaynberg
    Fix Version/s: 1.4.11
       Resolution: Fixed

> Losing focus on Autocomplete field if DropDownChoice is updated using Ajax.
> ---------------------------------------------------------------------------
>
>                 Key: WICKET-2279
>                 URL: https://issues.apache.org/jira/browse/WICKET-2279
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket, wicket-extensions
>    Affects Versions: 1.4-RC2, 1.4-RC4
>         Environment: Error exposed in IE 6, 7, 8.
> Works in Firefox, Chrome.
>            Reporter: Aslak Knutsen
>            Assignee: Igor Vaynberg
>            Priority: Minor
>             Fix For: 1.4.11
>
>         Attachments: AutoCompleteFocusIssuePage.html, AutoCompleteFocusIssuePage.java
>
>
> It seems that if a DropDownChoice is updated with ajax, the next AutoComplete field will lose focus when triggered if the 
> updated DropDownChoice have had focus inbetween beeing updated and AutoComplete is triggered.
> But only if focus on the DropDownChoice is gained/lost using KEY_TAB.
> More description in the attached example..

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


[jira] Updated: (WICKET-2279) Losing focus on Autocomplete field if DropDownChoice is updated using Ajax.

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

Aslak Knutsen updated WICKET-2279:
----------------------------------

    Attachment: AutoCompleteFocusIssuePage.java
                AutoCompleteFocusIssuePage.html

TestCase exposing the 'feature'

> Losing focus on Autocomplete field if DropDownChoice is updated using Ajax.
> ---------------------------------------------------------------------------
>
>                 Key: WICKET-2279
>                 URL: https://issues.apache.org/jira/browse/WICKET-2279
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket, wicket-extensions
>    Affects Versions: 1.4-RC2, 1.4-RC4
>         Environment: Error exposed in IE 6, 7, 8.
> Works in Firefox, Chrome.
>            Reporter: Aslak Knutsen
>            Priority: Critical
>         Attachments: AutoCompleteFocusIssuePage.html, AutoCompleteFocusIssuePage.java
>
>
> It seems that if a DropDownChoice is updated with ajax, the next AutoComplete field will lose focus when triggered if the 
> updated DropDownChoice have had focus inbetween beeing updated and AutoComplete is triggered.
> But only if focus on the DropDownChoice is gained/lost using KEY_TAB.
> More description in the attached example..

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


[jira] Updated: (WICKET-2279) Losing focus on Autocomplete field if DropDownChoice is updated using Ajax.

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

Igor Vaynberg updated WICKET-2279:
----------------------------------

    Priority: Minor  (was: Critical)

> Losing focus on Autocomplete field if DropDownChoice is updated using Ajax.
> ---------------------------------------------------------------------------
>
>                 Key: WICKET-2279
>                 URL: https://issues.apache.org/jira/browse/WICKET-2279
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket, wicket-extensions
>    Affects Versions: 1.4-RC2, 1.4-RC4
>         Environment: Error exposed in IE 6, 7, 8.
> Works in Firefox, Chrome.
>            Reporter: Aslak Knutsen
>            Priority: Minor
>         Attachments: AutoCompleteFocusIssuePage.html, AutoCompleteFocusIssuePage.java
>
>
> It seems that if a DropDownChoice is updated with ajax, the next AutoComplete field will lose focus when triggered if the 
> updated DropDownChoice have had focus inbetween beeing updated and AutoComplete is triggered.
> But only if focus on the DropDownChoice is gained/lost using KEY_TAB.
> More description in the attached example..

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


[jira] Commented: (WICKET-2279) Losing focus on Autocomplete field if DropDownChoice is updated using Ajax.

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

Hudson commented on WICKET-2279:
--------------------------------

Integrated in Apache Wicket 1.4.x #114 (See [https://hudson.apache.org/hudson/job/Apache%20Wicket%201.4.x/114/])
    fix focus problem in autocomplete/ie
Issue: WICKET-2279


> Losing focus on Autocomplete field if DropDownChoice is updated using Ajax.
> ---------------------------------------------------------------------------
>
>                 Key: WICKET-2279
>                 URL: https://issues.apache.org/jira/browse/WICKET-2279
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket, wicket-extensions
>    Affects Versions: 1.4-RC2, 1.4-RC4
>         Environment: Error exposed in IE 6, 7, 8.
> Works in Firefox, Chrome.
>            Reporter: Aslak Knutsen
>            Assignee: Igor Vaynberg
>            Priority: Minor
>             Fix For: 1.4.11
>
>         Attachments: AutoCompleteFocusIssuePage.html, AutoCompleteFocusIssuePage.java
>
>
> It seems that if a DropDownChoice is updated with ajax, the next AutoComplete field will lose focus when triggered if the 
> updated DropDownChoice have had focus inbetween beeing updated and AutoComplete is triggered.
> But only if focus on the DropDownChoice is gained/lost using KEY_TAB.
> More description in the attached example..

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


[jira] Commented: (WICKET-2279) Losing focus on Autocomplete field if DropDownChoice is updated using Ajax.

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

Aslak Knutsen commented on WICKET-2279:
---------------------------------------

Some more testing shows that the ajax update is irellevant. 
A simple DropDownChoice before a Autocomplete Field results in the same behaviour.

As far as I can see, the error fields focus is called, but ignored by IE, probably becaus it thinks it allready has focus(based on keypress event source etc..).

This code expose the same bug:

{code}
Form<?> form = new Form<Void>("form");
add(form);

final TextField<String> startField = new TextField<String>("startField", new Model<String>(""));
startField.setOutputMarkupId(true);
form.add(startField);

final TextField<String> errorField = new TextField<String>("errorField", new Model<String>(""));
errorField.setOutputMarkupId(true);
form.add(errorField);

final DropDownChoice<String> triggerField = new DropDownChoice<String>("triggerField", Arrays.asList("A", "B"));
triggerField.setOutputMarkupId(true);
form.add(triggerField);

errorField.add(new AutoCompleteBehavior<String>(StringAutoCompleteRenderer.INSTANCE) {
	private static final long serialVersionUID = 1L;

	@Override
	protected Iterator<String> getChoices(String input) {
		return Arrays.asList("1", "2").listIterator();
	}
});
{code}

{code:xml}
<form wicket:id="form">
	<table>
		<tr>
			<th>Start</th>
			<td><input type="text" wicket:id="startField" /></td>
			<td></td>
		</tr>
		<tr>
			<th>Trigger</th>
			<td><select type="text" wicket:id="triggerField" /></td>
			<td></td>
		</tr>
		<tr>
			<th>Error</th>
			<td><input type="text" wicket:id="errorField" /></td>
			<td></td>
		</tr>
	</table>
</form>
{code}

As a temporary workaround/solution I've found is calling blur before focus:

{code:title=wicket-autocomplete.js}
..

function doUpdateChoices(resp){
..
	if(Wicket.Browser.isIE()) {
		Wicket.Focus.refocusLastFocusedComponentAfterResponse = true;
		var focusedElement = Wicket.$(elementId);
		var temponblur = focusedElement.onblur;
		focusedElement.onblur = null;
		focusedElement.blur();
		setTimeout(function() { focusedElement.onblur = temponblur;}, 0);
		Wicket.Focus.requestFocus();
	}
}
..
{code}


> Losing focus on Autocomplete field if DropDownChoice is updated using Ajax.
> ---------------------------------------------------------------------------
>
>                 Key: WICKET-2279
>                 URL: https://issues.apache.org/jira/browse/WICKET-2279
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket, wicket-extensions
>    Affects Versions: 1.4-RC2, 1.4-RC4
>         Environment: Error exposed in IE 6, 7, 8.
> Works in Firefox, Chrome.
>            Reporter: Aslak Knutsen
>            Priority: Minor
>         Attachments: AutoCompleteFocusIssuePage.html, AutoCompleteFocusIssuePage.java
>
>
> It seems that if a DropDownChoice is updated with ajax, the next AutoComplete field will lose focus when triggered if the 
> updated DropDownChoice have had focus inbetween beeing updated and AutoComplete is triggered.
> But only if focus on the DropDownChoice is gained/lost using KEY_TAB.
> More description in the attached example..

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