You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Ben Dotte (JIRA)" <de...@tapestry.apache.org> on 2007/05/04 19:08:15 UTC

[jira] Created: (TAPESTRY-1441) Autocompleter autofills textfield with unexpected value

Autocompleter autofills textfield with unexpected value
-------------------------------------------------------

                 Key: TAPESTRY-1441
                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1441
             Project: Tapestry
          Issue Type: Bug
          Components: XHR/dhtml/Ajax
    Affects Versions: 4.1.2
         Environment: Tapestry 4.1.2 snapshot from 5-3, WinXP, Firefox 2
            Reporter: Ben Dotte


After you begin typing into an Autocompleter, the dropdown appears with possible values and the textfield attempts to autofill itself. I would assume it is supposed to autofill with the first available value. The problem is the text it tries to autofill with is not right if the possible values don't start with the value entered by the user (a contains search).

As an example, say I have an autocompleter with the values "01 blah", "02 blah", "03 blah", "04 blah", and "05 blah". I type "bla" into the textfield and wait for the dropdown to appear. When the dropdown appears, all of the possible values appear as expected, but the textfield now says "blablah". I would not expect "blah" to get appended to the "bla" I typed in as this is not a valid choice.

Either the textfield should autofill with a valid value, or it shouldn't autofill at all, like the Tacos autocompleter. (I would prefer the latter.)

Here is some code to replicate the example:

.html:
<form jwcid="@Form">
	<span jwcid="autocompleteTest@Autocompleter" value="ognl:curValue" model="ognl:model" />
</form>

.java:
public abstract String getCurValue();

public IAutocompleteModel getModel()
{
	final List<String> values = Arrays.asList("01 blah", "02 blah", "03 blah", "04 blah", "05 blah");
		
	return new IAutocompleteModel()
	{
		public String getLabelFor(Object value)
		{
			return (String) value;
		}

		public List getValues(String filter)
		{
			List<String> result = new ArrayList<String>();
			
			for (String val : values)
			{
				if (val.contains(filter))
				{
					result.add(val);
				}
			}
			return result;
		}

		public Object getPrimaryKey(Object value)
		{
			return values.indexOf(value);
		}

		public Object getValue(Object primaryKey)
		{
			return values.get((Integer) primaryKey);
		}
	};
}

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAPESTRY-1441) Autocompleter autofills textfield with unexpected value

Posted by "Andreas Andreou (JIRA)" <de...@tapestry.apache.org>.
    [ https://issues.apache.org/jira/browse/TAPESTRY-1441?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12528087 ] 

Andreas Andreou commented on TAPESTRY-1441:
-------------------------------------------

Arent you using the scriptaculous autocompleter now? Anyway, dojo's seems indeed broken with that regard.

Best thing that can be done is allow setting their autoComplete parameter to false - so that the textfield doesn't get
autocompleted

> Autocompleter autofills textfield with unexpected value
> -------------------------------------------------------
>
>                 Key: TAPESTRY-1441
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1441
>             Project: Tapestry
>          Issue Type: Bug
>          Components: XHR/dhtml/Ajax
>    Affects Versions: 4.1.2
>         Environment: Tapestry 4.1.2 snapshot from 5-3, WinXP, Firefox 2
>            Reporter: Ben Dotte
>             Fix For: 4.1.4
>
>
> After you begin typing into an Autocompleter, the dropdown appears with possible values and the textfield attempts to autofill itself. I would assume it is supposed to autofill with the first available value. The problem is the text it tries to autofill with is not right if the possible values don't start with the value entered by the user (a contains search).
> As an example, say I have an autocompleter with the values "01 blah", "02 blah", "03 blah", "04 blah", and "05 blah". I type "bla" into the textfield and wait for the dropdown to appear. When the dropdown appears, all of the possible values appear as expected, but the textfield now says "blablah". I would not expect "blah" to get appended to the "bla" I typed in as this is not a valid choice.
> Either the textfield should autofill with a valid value, or it shouldn't autofill at all, like the Tacos autocompleter. (I would prefer the latter.)
> Here is some code to replicate the example:
> .html:
> <form jwcid="@Form">
> 	<span jwcid="autocompleteTest@Autocompleter" value="ognl:curValue" model="ognl:model" />
> </form>
> .java:
> public abstract String getCurValue();
> public IAutocompleteModel getModel()
> {
> 	final List<String> values = Arrays.asList("01 blah", "02 blah", "03 blah", "04 blah", "05 blah");
> 		
> 	return new IAutocompleteModel()
> 	{
> 		public String getLabelFor(Object value)
> 		{
> 			return (String) value;
> 		}
> 		public List getValues(String filter)
> 		{
> 			List<String> result = new ArrayList<String>();
> 			
> 			for (String val : values)
> 			{
> 				if (val.contains(filter))
> 				{
> 					result.add(val);
> 				}
> 			}
> 			return result;
> 		}
> 		public Object getPrimaryKey(Object value)
> 		{
> 			return values.indexOf(value);
> 		}
> 		public Object getValue(Object primaryKey)
> 		{
> 			return values.get((Integer) primaryKey);
> 		}
> 	};
> }

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Updated: (TAPESTRY-1441) Autocompleter autofills textfield with unexpected value

Posted by "Jesse Kuhnert (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-1441?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jesse Kuhnert updated TAPESTRY-1441:
------------------------------------

    Fix Version/s:     (was: 4.1.2)
                   4.1.3

> Autocompleter autofills textfield with unexpected value
> -------------------------------------------------------
>
>                 Key: TAPESTRY-1441
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1441
>             Project: Tapestry
>          Issue Type: Bug
>          Components: XHR/dhtml/Ajax
>    Affects Versions: 4.1.2
>         Environment: Tapestry 4.1.2 snapshot from 5-3, WinXP, Firefox 2
>            Reporter: Ben Dotte
>             Fix For: 4.1.3
>
>
> After you begin typing into an Autocompleter, the dropdown appears with possible values and the textfield attempts to autofill itself. I would assume it is supposed to autofill with the first available value. The problem is the text it tries to autofill with is not right if the possible values don't start with the value entered by the user (a contains search).
> As an example, say I have an autocompleter with the values "01 blah", "02 blah", "03 blah", "04 blah", and "05 blah". I type "bla" into the textfield and wait for the dropdown to appear. When the dropdown appears, all of the possible values appear as expected, but the textfield now says "blablah". I would not expect "blah" to get appended to the "bla" I typed in as this is not a valid choice.
> Either the textfield should autofill with a valid value, or it shouldn't autofill at all, like the Tacos autocompleter. (I would prefer the latter.)
> Here is some code to replicate the example:
> .html:
> <form jwcid="@Form">
> 	<span jwcid="autocompleteTest@Autocompleter" value="ognl:curValue" model="ognl:model" />
> </form>
> .java:
> public abstract String getCurValue();
> public IAutocompleteModel getModel()
> {
> 	final List<String> values = Arrays.asList("01 blah", "02 blah", "03 blah", "04 blah", "05 blah");
> 		
> 	return new IAutocompleteModel()
> 	{
> 		public String getLabelFor(Object value)
> 		{
> 			return (String) value;
> 		}
> 		public List getValues(String filter)
> 		{
> 			List<String> result = new ArrayList<String>();
> 			
> 			for (String val : values)
> 			{
> 				if (val.contains(filter))
> 				{
> 					result.add(val);
> 				}
> 			}
> 			return result;
> 		}
> 		public Object getPrimaryKey(Object value)
> 		{
> 			return values.indexOf(value);
> 		}
> 		public Object getValue(Object primaryKey)
> 		{
> 			return values.get((Integer) primaryKey);
> 		}
> 	};
> }

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAPESTRY-1441) Autocompleter autofills textfield with unexpected value

Posted by "Ben Dotte (JIRA)" <de...@tapestry.apache.org>.
    [ https://issues.apache.org/jira/browse/TAPESTRY-1441?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12528089 ] 

Ben Dotte commented on TAPESTRY-1441:
-------------------------------------

Yes, we use the scriptaculous autocompleter exclusively now. This bug was reported before the scriptaculous version existed, so it isn't something we need fixed but yes, it is still a problem with the dojo version for anyone else who might want to use that instead.

> Autocompleter autofills textfield with unexpected value
> -------------------------------------------------------
>
>                 Key: TAPESTRY-1441
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1441
>             Project: Tapestry
>          Issue Type: Bug
>          Components: XHR/dhtml/Ajax
>    Affects Versions: 4.1.2
>         Environment: Tapestry 4.1.2 snapshot from 5-3, WinXP, Firefox 2
>            Reporter: Ben Dotte
>             Fix For: 4.1.4
>
>
> After you begin typing into an Autocompleter, the dropdown appears with possible values and the textfield attempts to autofill itself. I would assume it is supposed to autofill with the first available value. The problem is the text it tries to autofill with is not right if the possible values don't start with the value entered by the user (a contains search).
> As an example, say I have an autocompleter with the values "01 blah", "02 blah", "03 blah", "04 blah", and "05 blah". I type "bla" into the textfield and wait for the dropdown to appear. When the dropdown appears, all of the possible values appear as expected, but the textfield now says "blablah". I would not expect "blah" to get appended to the "bla" I typed in as this is not a valid choice.
> Either the textfield should autofill with a valid value, or it shouldn't autofill at all, like the Tacos autocompleter. (I would prefer the latter.)
> Here is some code to replicate the example:
> .html:
> <form jwcid="@Form">
> 	<span jwcid="autocompleteTest@Autocompleter" value="ognl:curValue" model="ognl:model" />
> </form>
> .java:
> public abstract String getCurValue();
> public IAutocompleteModel getModel()
> {
> 	final List<String> values = Arrays.asList("01 blah", "02 blah", "03 blah", "04 blah", "05 blah");
> 		
> 	return new IAutocompleteModel()
> 	{
> 		public String getLabelFor(Object value)
> 		{
> 			return (String) value;
> 		}
> 		public List getValues(String filter)
> 		{
> 			List<String> result = new ArrayList<String>();
> 			
> 			for (String val : values)
> 			{
> 				if (val.contains(filter))
> 				{
> 					result.add(val);
> 				}
> 			}
> 			return result;
> 		}
> 		public Object getPrimaryKey(Object value)
> 		{
> 			return values.indexOf(value);
> 		}
> 		public Object getValue(Object primaryKey)
> 		{
> 			return values.get((Integer) primaryKey);
> 		}
> 	};
> }

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Updated: (TAPESTRY-1441) Autocompleter autofills textfield with unexpected value

Posted by "Jesse Kuhnert (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-1441?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jesse Kuhnert updated TAPESTRY-1441:
------------------------------------

    Fix Version/s: 4.1.2

> Autocompleter autofills textfield with unexpected value
> -------------------------------------------------------
>
>                 Key: TAPESTRY-1441
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1441
>             Project: Tapestry
>          Issue Type: Bug
>          Components: XHR/dhtml/Ajax
>    Affects Versions: 4.1.2
>         Environment: Tapestry 4.1.2 snapshot from 5-3, WinXP, Firefox 2
>            Reporter: Ben Dotte
>             Fix For: 4.1.2
>
>
> After you begin typing into an Autocompleter, the dropdown appears with possible values and the textfield attempts to autofill itself. I would assume it is supposed to autofill with the first available value. The problem is the text it tries to autofill with is not right if the possible values don't start with the value entered by the user (a contains search).
> As an example, say I have an autocompleter with the values "01 blah", "02 blah", "03 blah", "04 blah", and "05 blah". I type "bla" into the textfield and wait for the dropdown to appear. When the dropdown appears, all of the possible values appear as expected, but the textfield now says "blablah". I would not expect "blah" to get appended to the "bla" I typed in as this is not a valid choice.
> Either the textfield should autofill with a valid value, or it shouldn't autofill at all, like the Tacos autocompleter. (I would prefer the latter.)
> Here is some code to replicate the example:
> .html:
> <form jwcid="@Form">
> 	<span jwcid="autocompleteTest@Autocompleter" value="ognl:curValue" model="ognl:model" />
> </form>
> .java:
> public abstract String getCurValue();
> public IAutocompleteModel getModel()
> {
> 	final List<String> values = Arrays.asList("01 blah", "02 blah", "03 blah", "04 blah", "05 blah");
> 		
> 	return new IAutocompleteModel()
> 	{
> 		public String getLabelFor(Object value)
> 		{
> 			return (String) value;
> 		}
> 		public List getValues(String filter)
> 		{
> 			List<String> result = new ArrayList<String>();
> 			
> 			for (String val : values)
> 			{
> 				if (val.contains(filter))
> 				{
> 					result.add(val);
> 				}
> 			}
> 			return result;
> 		}
> 		public Object getPrimaryKey(Object value)
> 		{
> 			return values.indexOf(value);
> 		}
> 		public Object getValue(Object primaryKey)
> 		{
> 			return values.get((Integer) primaryKey);
> 		}
> 	};
> }

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Resolved: (TAPESTRY-1441) Autocompleter autofills textfield with unexpected value

Posted by "Andreas Andreou (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-1441?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Andreou resolved TAPESTRY-1441.
---------------------------------------

    Resolution: Fixed
      Assignee: Andreas Andreou

New parameter added and documented.

> Autocompleter autofills textfield with unexpected value
> -------------------------------------------------------
>
>                 Key: TAPESTRY-1441
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1441
>             Project: Tapestry
>          Issue Type: Bug
>          Components: XHR/dhtml/Ajax
>    Affects Versions: 4.1.2
>         Environment: Tapestry 4.1.2 snapshot from 5-3, WinXP, Firefox 2
>            Reporter: Ben Dotte
>            Assignee: Andreas Andreou
>             Fix For: 4.1.4
>
>
> After you begin typing into an Autocompleter, the dropdown appears with possible values and the textfield attempts to autofill itself. I would assume it is supposed to autofill with the first available value. The problem is the text it tries to autofill with is not right if the possible values don't start with the value entered by the user (a contains search).
> As an example, say I have an autocompleter with the values "01 blah", "02 blah", "03 blah", "04 blah", and "05 blah". I type "bla" into the textfield and wait for the dropdown to appear. When the dropdown appears, all of the possible values appear as expected, but the textfield now says "blablah". I would not expect "blah" to get appended to the "bla" I typed in as this is not a valid choice.
> Either the textfield should autofill with a valid value, or it shouldn't autofill at all, like the Tacos autocompleter. (I would prefer the latter.)
> Here is some code to replicate the example:
> .html:
> <form jwcid="@Form">
> 	<span jwcid="autocompleteTest@Autocompleter" value="ognl:curValue" model="ognl:model" />
> </form>
> .java:
> public abstract String getCurValue();
> public IAutocompleteModel getModel()
> {
> 	final List<String> values = Arrays.asList("01 blah", "02 blah", "03 blah", "04 blah", "05 blah");
> 		
> 	return new IAutocompleteModel()
> 	{
> 		public String getLabelFor(Object value)
> 		{
> 			return (String) value;
> 		}
> 		public List getValues(String filter)
> 		{
> 			List<String> result = new ArrayList<String>();
> 			
> 			for (String val : values)
> 			{
> 				if (val.contains(filter))
> 				{
> 					result.add(val);
> 				}
> 			}
> 			return result;
> 		}
> 		public Object getPrimaryKey(Object value)
> 		{
> 			return values.indexOf(value);
> 		}
> 		public Object getValue(Object primaryKey)
> 		{
> 			return values.get((Integer) primaryKey);
> 		}
> 	};
> }

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Updated: (TAPESTRY-1441) Autocompleter autofills textfield with unexpected value

Posted by "Jesse Kuhnert (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-1441?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jesse Kuhnert updated TAPESTRY-1441:
------------------------------------

    Fix Version/s:     (was: 4.1.3)
                   4.1.4

> Autocompleter autofills textfield with unexpected value
> -------------------------------------------------------
>
>                 Key: TAPESTRY-1441
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1441
>             Project: Tapestry
>          Issue Type: Bug
>          Components: XHR/dhtml/Ajax
>    Affects Versions: 4.1.2
>         Environment: Tapestry 4.1.2 snapshot from 5-3, WinXP, Firefox 2
>            Reporter: Ben Dotte
>             Fix For: 4.1.4
>
>
> After you begin typing into an Autocompleter, the dropdown appears with possible values and the textfield attempts to autofill itself. I would assume it is supposed to autofill with the first available value. The problem is the text it tries to autofill with is not right if the possible values don't start with the value entered by the user (a contains search).
> As an example, say I have an autocompleter with the values "01 blah", "02 blah", "03 blah", "04 blah", and "05 blah". I type "bla" into the textfield and wait for the dropdown to appear. When the dropdown appears, all of the possible values appear as expected, but the textfield now says "blablah". I would not expect "blah" to get appended to the "bla" I typed in as this is not a valid choice.
> Either the textfield should autofill with a valid value, or it shouldn't autofill at all, like the Tacos autocompleter. (I would prefer the latter.)
> Here is some code to replicate the example:
> .html:
> <form jwcid="@Form">
> 	<span jwcid="autocompleteTest@Autocompleter" value="ognl:curValue" model="ognl:model" />
> </form>
> .java:
> public abstract String getCurValue();
> public IAutocompleteModel getModel()
> {
> 	final List<String> values = Arrays.asList("01 blah", "02 blah", "03 blah", "04 blah", "05 blah");
> 		
> 	return new IAutocompleteModel()
> 	{
> 		public String getLabelFor(Object value)
> 		{
> 			return (String) value;
> 		}
> 		public List getValues(String filter)
> 		{
> 			List<String> result = new ArrayList<String>();
> 			
> 			for (String val : values)
> 			{
> 				if (val.contains(filter))
> 				{
> 					result.add(val);
> 				}
> 			}
> 			return result;
> 		}
> 		public Object getPrimaryKey(Object value)
> 		{
> 			return values.indexOf(value);
> 		}
> 		public Object getValue(Object primaryKey)
> 		{
> 			return values.get((Integer) primaryKey);
> 		}
> 	};
> }

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org