You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ben Dotte <bd...@widen.com> on 2007/01/31 17:22:10 UTC

Autocompleter Validation Issues

Since we switched to Tapestry 4.1 we replaced our Tacos autocompleters
with the new dojo-based one but it seems to have some pretty serious
validation problems. Let's say I have an autocompleter with a required
validator and an existing value. I type a bunch of characters into the
field without picking anything from the dropdown and hit submit.
Sometimes my input is lost and I get a validation error that the field
is required. Normally, I would expect my input to be kept in the
validation delegate and redisplayed but instead it is lost. Other times
when I do the same thing, the form submits successfully but the value it
submits with is the original value, not what I typed. When a custom
validator is added on, the value that it gets is also the original value
so there is no way to know the value is invalid either.

 

I'm thinking about submitting a JIRA issue for this but I wanted to
check first to make sure I'm not missing something? We are on one of the
4.1.2 snapshots right now.

 

Thanks,

Ben


Re: Autocompleter Validation Issues

Posted by andyhot <an...@di.uoa.gr>.
Well, the autocompleter uses dojo's Select widget (which extends ComboBox)

It's normal behavior is to allow users to type in anything, but it keeps the
typed text only if it matches one of the available options - just like a 
normal
html select does.
That's why it auto-reverts to the initial value, if it can't match
the current one. And this is by design.

Now, the options to select from are returned by that 
IAutocompleteModel.getValues(String)
method

What i did, was having that method also return the passed in string, so 
that it's
also available as an option ;)



Ben Dotte wrote:
> Since we switched to Tapestry 4.1 we replaced our Tacos autocompleters
> with the new dojo-based one but it seems to have some pretty serious
> validation problems. Let's say I have an autocompleter with a required
> validator and an existing value. I type a bunch of characters into the
> field without picking anything from the dropdown and hit submit.
> Sometimes my input is lost and I get a validation error that the field
> is required. Normally, I would expect my input to be kept in the
> validation delegate and redisplayed but instead it is lost. Other times
> when I do the same thing, the form submits successfully but the value it
> submits with is the original value, not what I typed. When a custom
> validator is added on, the value that it gets is also the original value
> so there is no way to know the value is invalid either.
>
>  
>
> I'm thinking about submitting a JIRA issue for this but I wanted to
> check first to make sure I'm not missing something? We are on one of the
> 4.1.2 snapshots right now.
>
>  
>
> Thanks,
>
> Ben
>
>
>   


-- 
Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / J2EE Consulting 


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