Alien-GvaScript

 view release on metacpan or  search on metacpan

doc/html/AutoCompleter.html  view on Meta::CPAN

</li>
<li><a name="item_scrollCount"></a><b>scrollCount</b>
<p>How many items to skip when hitting the 
<code>PAGE_UP</code> or <code>PAGE_DOWN</code> keys. 
Default is 5</p>
</li>
<li><a name="item_htmlWrapper"></a><b>htmlWrapper</b>
<p>See the <code>ChoiceList</code> documentation.</p>
</li>
<li><a name="item_choiceItemTagName"></a><b>choiceItemTagName</b>
<p>See the <code>ChoiceList</code> documentation.</p>
</li>
<li><a name="item_classes"></a><b>classes</b>
<p>Classes that will be assigned at various stages
to autocompleter DOM elements .
Possible classes are</p>
<ul>
<li><a name="item_loading"></a><b>loading</b>
<p>Class added to the  input or textarea field while an Ajax
request is pending. Default is <code>AC_loading</code>, a class that displays
an Ajax-loading icon.</p>
</li>
<li><a name="item_dropdown"></a><b>dropdown</b>
<p>Class for the dropdown div that displays the autocompletion choices.
Default is <code>AC_dropdown</code>.</p>
</li>
<li><a name="item_message"></a><b>message</b>
<p>Class for displaying warning messages.
Default is <code>AC_message</code>.</p>
</li>
</ul>
</li>
<li><a name="item_additional_params"></a><b>additional_params</b>
<p>Other parameters to be added in the Ajax query for autocompletion.
Can be either an array or an already encoded string (see <code>Ajax.Options</code> in
<code>prototype.js</code>).
[TODO: should be camelCase to be consistent with other options; 
check dependencies in DMWeb].</p>
</li>
<li><a name="item_dependentFields"></a><b>dependentFields</b>
<pre>  var ac =  new GvaScript.Autocompleter(url, {
              dependentFields : {
                foo : "firstname",
                bar : "lastname",
                id  : "id"
              } } );</pre>

<p>Inline object that specifies dependencies between the field
controlled by the autocompleter, and other fields in the same form.
When leaving the autocompleted field (<code>onBlur</code>), the dependent fields
will be updated automatically. This only works for autocompleters
in strict mode.</p>
<p>Each key in the inline object specifies the name of a field related
to the autocompleted field. If field names are in dotted notation, 
then the related field is taken as a path relative to the autocompleted
field : so for example if the autocompleted field has name
<code>some.very.3.long.2.path</code>, then the <code>foo</code> entry in
<code>dependentFields</code> will refer to field <code>some.very.3.long.2.foo</code>.</p>
<p>The corresponding value (in our example above: <code>firstname</code>) is
the name of a property to extract from the <code>choice</code> member
that validated the current input. However, the autocompleted field
may also contain an empty value (in which case the related fields
are also emptied), or an illegal value (in which case the related
fields are filled with string <code>ILLEGAL_***</code>, where <code>***</code> is the 
key from the inline object).</p>
<p>If the <code>choice</code> member is not an object, but just a string,
then that string is copied to the dependent field, therefore ignoring
the hash value (<code>firstname</code> in our example).</p>
<p>As a special case, if the hash value is an empty string,
then the dependent field is emptied, ignoring whatever
information may be in the <code>choice</code> element.</p>
<p>The dependent fields structure might also be specified as
an HTML attribute <code>ac:dependentFields</code>, instead of an option 
to the Javascript object :</p>
<pre>  &lt;input name="some.very.3.long.2.path"
         onfocus="ac.autocomplete(this)"
         ac:dependentFields="{foo:'firstname',bar:'lastname',id:'id'}" /&gt;
  ...
  &lt;input type="hidden"
         name="some.very.3.long.2.id" /&gt;</pre>

</li>
</ul>

    </div>
  </div>

    </div>
  </div>
  <div class="TN_node" id="METHODS">
    <h2 class="TN_label">METHODS</h2>
    <div class="TN_content">
        <div class="TN_node" id="autocomplete_inputField_">
    <h3 class="TN_label">autocomplete(inputField)</h3>
    <div class="TN_content">
      <p>Returns an event handler to be bound to the <code>onfocus</code> event on
an input field, i.e.</p>
<pre>  &lt;input name="someInput" onfocus="myAutoCompleter.complete(this)"&gt;</pre>

<p>The autocompleter will automatically register 
<code>onblur</code>, <code>onclick</code> and <code>onkeydown</code> handlers on the same field, so avoid
setting your own, which may cause unpredictable interactions.
However the autocompleter has its own event model 
to which you can bind your handling code
(see the <i>EVENTS</i> section below).</p>

    </div>
  </div>
  <div class="TN_node" id="detach_inputField_">
    <h3 class="TN_label">detach(inputField)</h3>
    <div class="TN_content">
      <p>Permanently detaches the input field from the autocompleter object
(i.e. removes <code>onblur</code> and <code>onkeypress</code> handlers
that were previously set by the first invocation of the 
<code>autocomplete</code> method).</p>

    </div>
  </div>
  <div class="TN_node" id="displayMessage_messageText_">
    <h3 class="TN_label">displayMessage(messageText)</h3>
    <div class="TN_content">



( run in 0.668 second using v1.01-cache-2.11-cpan-70e19b8f4f1 )