Hi, I am planning to convert html select list to moo tools
autocomplete. I read about the moo tools Autcomplete.Local script, it
appears the nice one for me. However in the example, all the data
elements to display was hardcoded(var tokens).
My question is

1. when i load my jsp page, how do i get the tokens data dynamically?.
I am using struts2, I have list of Objects in an arraylist in the
ation class. how to convert that java ArrayList objects to java script
array element?.

2. In select option, if i select an option from the list, it submits
the option value to the form(behind the screen). How to achieve this
using autocomplete. Please help me.


ocument.addEvent('domready', function() {

        // Test source, list of tags from http://del.icio.us/tag/
        var tokens = ['.net', '2008', '3d', 'advertising', 'wiki', 'windows',
'wordpress', 'work', 'writing', 'youtube'];

        // Our instance for the element with id "demo-local"
        new Autocompleter.Local('demo-local', tokens, {
                'minLength': 1, // We need at least 1 character
                'selectMode': 'type-ahead', // Instant completion
                'multiple': true // Tag support, by default comma separated
        });

        // Our instance for the element with id "demo-local-2", the textarea
        new Autocompleter.Local('demo-local-2', tokens, {
                'minLength': 1, // We need at least 1 character
                'selectMode': 'type-ahead', // Instant completion
                'multiple': true // Tag support, by default comma separated
        });

});

Reply via email to