Thanks for the suggestion and the background information on the autocompleter. I guess the behavior makes sense on some levels but there are still some pretty big problems:
- If you type a valid value and submit the form before the dropdown appears, the original value is used instead of the one you typed. - The autocompleter models we are using operate on objects that are not strings. So to use the input from the user as a dropdown value, we would need to construct a fake object with the user-entered value for one of the fields on every single model. It also seems a bit odd to allow the user to select a non-valid value they just typed from a dropdown, only to display an error that they picked a non-valid value? I guess the autocompleter from Tacos just seems a lot more robust. There wasn't a lot users could do to that thing to cause unexpected behavior. I see the next big push for Tacos is to convert to Maven2, then try to get it working for Tapestry 4.1. If these issues can't be resolved in the current Autocompleter, I would really like to see Tacos work on 4.1 as soon as possible. In fact, I've already gone through and gotten the Tacos autocompleter to work for us on Tapestry 4.1 but it required pulling in quite a few classes, scripts, and HiveMind configuration. Thanks, Ben -----Original Message----- From: andreas a [mailto:[EMAIL PROTECTED] On Behalf Of andyhot Sent: Wednesday, January 31, 2007 1:20 PM To: Tapestry users Subject: Re: Autocompleter Validation Issues 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 - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr Tapestry / Tacos developer Open Source / J2EE Consulting --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]