power-media / prado3

Automatically exported from code.google.com/p/prado3
Other
0 stars 0 forks source link

TAutocomplete not rendering an empty suggestion list #421

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
TAutocomplete use a TRepeater to render a suggestion list.
Following Scriptacoulous autocompleter docs:
"...If your search returns no results, it is critical that your server 
immediately return an empty list, rather than nothing...."
The TAutocomplete createRepeater method doesn't set EmptyTemplate for TRepeater 
and in case an empty list is rendered an empty response is sent back to the 
autocompleter.

What steps will reproduce the problem?
1. Create an autocomplete code example.
2. Type a text that match some autocomplete results
3. Then add some chars not matching any suggestions
4. Suggestion panel will stay open with latest suggestions

What is the expected output? What do you see instead?
Suggestion panel will not disappear in case an empty list is returned because 
TRepeater will not rendere header and footer in case an empty datasource is 
passed.
We fixed this adding a 
$repeater->setEmptyTemplate("<ul></ul>");
in createRepeater() method of TAutoComplete.

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by drigo...@gmail.com on 7 Aug 2012 at 2:59

GoogleCodeExporter commented 8 years ago
fixed in r3198, thank you

Original comment by ctrlal...@gmail.com on 10 Aug 2012 at 12:54