[Jifty-commit] r1056 - in jifty/trunk: lib/Jifty
share/web/templates/__jifty
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Sun May 14 21:51:26 EDT 2006
Author: seanmil
Date: Sun May 14 21:51:20 2006
New Revision: 1056
Modified:
jifty/trunk/ (props changed)
jifty/trunk/lib/Jifty/Action.pm
jifty/trunk/share/web/templates/__jifty/autocomplete.xml
Log:
r68 at localhost: sean | 2006-05-14 21:48:50 -0400
* Fix autocompletes so that the simple list method that was
documented now works.
* Document the autocomplete hash reference return value method
already in the code.
Modified: jifty/trunk/lib/Jifty/Action.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Action.pm (original)
+++ jifty/trunk/lib/Jifty/Action.pm Sun May 14 21:51:20 2006
@@ -706,7 +706,12 @@
=head2 _autocomplete_argument ARGUMENT
-Get back a list of possible completions for C<ARGUMENT>.
+Get back a list of possible completions for C<ARGUMENT>. The list
+should either be a list of scalar values or a list of hash references.
+Each hash reference must have a key named C<value>. There can also
+additionally be a key named C<label> which, if present, will be used
+as the user visible label. If C<label> is not present then the
+contents of C<value> will be used for the label.
If the field has an attribute named B<autocompleter>, call the
subroutine reference B<autocompleter> points to.
Modified: jifty/trunk/share/web/templates/__jifty/autocomplete.xml
==============================================================================
--- jifty/trunk/share/web/templates/__jifty/autocomplete.xml (original)
+++ jifty/trunk/share/web/templates/__jifty/autocomplete.xml Sun May 14 21:51:20 2006
@@ -9,7 +9,9 @@
<body>
<ul>
% foreach my $item ( @options) {
-% if (exists $item->{label}) {
+% if (!ref($item)) {
+<li><% $item %></li>
+% } elsif (exists $item->{label}) {
<li><span class="informal"><% $item->{label} %></span><span style="visibility: hidden"><% $item->{value} %></span></li>
% } else {
<li><% $item->{value} %></li>
More information about the Jifty-commit
mailing list