Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Seems that there were a combination of two issues (i.e., as a jquery newby)...</strong></p> <p><strong>issue#1</strong>. A somewhat embarrassing oversight (ala, "<em>is your PC plugged in?</em>")... I was setting autocomplete function's "minLength" parameter value to 3, and not typing a minimum of 3 characters, so no list was being displayed when initially testing (I removed this parameter and am using the default minimum length of 1, for now)</p> <p><strong>issue#2</strong>. The primary issue, however, was that I did not understand the problems that the jquery selector has with the JSF colon (":") character. I solved this with by using one of two workarounds (after googling the info, etc):</p> <p>(note: in these snippets, "<strong><em>#{cc.attrs.idpref}</em></strong>" is the JSF "<strong><em>composite component</em></strong>" attribute is am using to specify element id... FWIW, in this case the value happens to be "<strong><em>aaa</em></strong>")</p> <p><em><strong>workaround#1</em></strong>:</p> <pre><code>//get the full id value of the element whose "id ends with" aaa... var id = jq('input[id$="' + "#{cc.attrs.idpref}" + '"]').attr("id"); //"escape" the colon character so that jquery will not be confused... id = id.replace(/:/g,"\\:"); //used escaped id value in the selector... jq("input#" + id).autocomplete({ source: list }); </code></pre> <p><em><strong>workaround#2</em></strong>:</p> <pre><code>//start with the **unprepended** id value specified in the composite component attribute... var id = "#{cc.attrs.idpref}"; // use the "id ends with" aaa selector with the autocomplete function... jq('input[id$="' + "#{cc.attrs.idpref}" + '"]').autocomplete({ source: list }); </code></pre> <p>Thanks for all your collective reponses!</p> <p>sd</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload