Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Rakesh Goswami
Ajax call on alloy UI auto complete.? ajax call on direct selection?
May 11, 2012 1:25 AM
Answer

Rakesh Goswami

Rank: New Member

Posts: 15

Join Date: February 20, 2012

Recent Posts

Hi,
I am using alloy UI auto complete and calling ajax on it. Following is my code. Ajax call works fine when user enter data on text box but when user selects option using drop down ajax call is not working at that time. Any solution for this problem. What i need to change in my code for that?
And ajax call are only working with firefox. It is not working with Chrome and IE.
1<div id="<portlet:namespace/>myAutoComplete">
2    <aui:input name="rfpId" id="_sname" label="RFP Name:" onChange="Rfps();" ></aui:input>
3</div>

 1
 2<script type="text/javascript" charset="utf-8">
 3AUI().use('aui-autocomplete', function(A) {
 4   
 5      var availableTags=new Array();
 6      
 7          availableTags=[<%
 8              for(int i=0;i<rfps.size();i++)
 9              {
10                  if(i+1==rfps.size())
11                  out.print("'"+rfps.get(i).getRfpName()+"'");
12                  else
13                  out.print("'"+rfps.get(i).getRfpName()+"',");   
14              }
15             
16              %>
17              ];
18
19    window.AC = new A.AutoComplete(
20        {
21            dataSource: availableTags,
22            schema: {
23                resultFields: ['id','name']
24            },
25            matchKey: 'name',
26            typeAhead: true,
27            input:'#<portlet:namespace />_sname',
28            contentBox: '#<portlet:namespace />myAutoComplete'
29            
30        }
31    );
32
33    AC.render();
34});
35</script>
Priyanka Dhingra
RE: Ajax call on alloy UI auto complete.? ajax call on direct selection?
May 11, 2012 8:26 PM
Answer

Priyanka Dhingra

Rank: Liferay Master

Posts: 501

Join Date: December 19, 2011

Recent Posts

Hi Rakesh,

Can you share your "select" code
Rakesh Goswami
RE: Ajax call on alloy UI auto complete.? ajax call on direct selection?
May 11, 2012 11:38 PM
Answer

Rakesh Goswami

Rank: New Member

Posts: 15

Join Date: February 20, 2012

Recent Posts

Hi Priyanka,
With alloy UI auto complete there is no select. What i need for auto complete is just one div where i need to specify div id and then use that div id in javascript code.
I have coded as shown in this demo..
http://www.liferay.com/community/liferay-projects/alloy-ui/demo?title=community-liferay-projects-alloy-ui-demos-autocomplete
so there is no select in it.