listbox.autocomplete patch

Showing 1-1 of 1 messages
listbox.autocomplete patch John Bell 3/17/12 8:53 AM
I'm trying to use autocomplete on a form and run into a few issues:

The name of the input field defaults to $config->value and cannot be
overridden. The convention in other helpers is that it should be
$config->name.
Patch:
KTemplateHelperListbox
# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- Base (BASE)
+++ Locally Modified (Based On LOCAL)
@@ -138,8 +138,10 @@
          ));

          //For the autocomplete behavior
-        $config->element = $config->value;
-        $config->path    = $config->text;
\ No newline at end of file
+                $config->append(array(
+                    'element' => $config->name,
+                    'path'    => $config->text
+                ));
\ No newline at end of file

          $html =
$this->getTemplate()->getHelper('behavior')->autocomplete($config);


KTemplateHelperBehavior
# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- Base (BASE)
+++ Locally Modified (Based On LOCAL)
@@ -328,7 +328,7 @@
          $html .= '<input '.KHelperArray::toString($config->attribs).' />';
          $html .= '<input '.KHelperArray::toString(array(
              'type'  => 'hidden',
-            'name'  => $config->value,
\ No newline at end of file
+            'name'  => $config->name,
\ No newline at end of file
              'id'    => $config->element.'-value',
              'value' => $config->selected
             )).' />';

====
John