Fórum

Autocomplete Street 1 on users_admin/addresses.jsp

thumbnail
Sarah L Farley, modificado 11 Anos atrás.

Autocomplete Street 1 on users_admin/addresses.jsp

Junior Member Postagens: 37 Data de Entrada: 06/05/09 Postagens Recentes
Hi,

I am writing a hook for the portlet users_admin which will allow the user to start typing a building name and the field will autocomplete.

I would like to assign this field to the autocomplete field
                                    <aui:input fieldParam="<%= &quot;addressStreet1_&quot; + addressesIndex %>" id="<%= &quot;addressStreet1_&quot; + addressesIndex %>" name="street1" />


I have the following javascript code:

AUI().ready('aui-autocomplete', function(A) { 
        var building = [ <!-- insert my building list -->];
        var autoComplete = new A.AutoComplete( { contentBox: '#<portlet:namespace />addressStreet1_0', dataSource: building, matchKey: 'name', typeAhead: true, schema: { resultFields: ['key', 'name', 'description'] } } ) .render(); });
//--&gt;


Howerever, it seems to only display the field if I have the div tag in place
     
" &gt;


Even then, when I submit the form, it says Street 1 is invalid.

Any suggestions?
thumbnail
Sarah L Farley, modificado 11 Anos atrás.

RE: Autocomplete Street 1 on users_admin/addresses.jsp

Junior Member Postagens: 37 Data de Entrada: 06/05/09 Postagens Recentes
My full code for the div tag is this:

   <div id="<portlet:namespace /><%= " addressstreet1_" + addressesindex %>" &gt;
                
                                    <aui:input fieldParam="<%= &quot;addressStreet1_&quot; + addressesIndex %>" id="<%= &quot;addressStreet1_&quot; + addressesIndex %>" name="street1" />
                
            </div>