AUI Autocompletelist缓存问题

时间:2014-12-08 05:47:44

标签: liferay liferay-6 liferay-theme liferay-ide liferay-aui

我使用此脚本使用自动完成列表显示地址列表。所有内容似乎都正常工作。我的地址表只有3个条目,但它显示了一些以前的值。如何摆脱这个问题:

<aui:script>
AUI().use('autocomplete-list', 'aui-base', 'aui-io-request', 'autocomplete-filters', 'autocomplete-highlighters', function(A) {
A.io.request('<%=getAddress%>', {
    dataType: 'json',
    method: 'GET',
    on: {
        success: function() {
            continents = this.get('responseData');

            A.one('#<portlet:namespace/>addressNumberTosave').val(continents[0].addressNumber);

            A.one('#<portlet:namespace/>addressAutocomplete').val(continents[0].address);
            var address_ac = new A.AutoCompleteList({
                allowBrowserAutocomplete: 'false',
                enableCache: 'false',
                activateFirstItem: 'true',
                inputNode: '#<portlet:namespace/>addressAutocomplete',
                resultTextLocator: 'address',
                resultHighlighter: ['phraseMatch'],
                resultFilters: ['phraseMatch'],
                render: 'true',
                source: this.get('responseData'),
            });
            address_ac.on('select', function(e) {
                var selected_node = e.itemNode,
                    selected_data = e.result;

                A.one('#<portlet:namespace/>addressNumberTosave').val(e.result.raw.addressNumber);

            });
        }
    }
});
});
</aui:script>

我尝试过allowBrowserAutocomplete:&#39; false&#39 ;,enableCache:&#39; false&#39;属性,但没有用。如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

您必须使用重置方法来获取更新的地址列表

http://alloyui.com/versions/1.5.x/api/classes/Plugin.AutoComplete.html#method_reset