Autocomplete doesn't work first time

UI Components for JSF
Post Reply
Viocartman
Posts: 4
Joined: 23 Apr 2012, 11:00

11 May 2012, 16:22

Hello , i have a problem with the autocomplete component. When i want to search for something the first time , it doesn't show me the suggestion list (although it exists and it is retrieved from the server).

When i looked with firebug i saw that the list had inline style and the top attribute was set to -10000 px or something like that . When i modified that value i could see my list. So i am wondering if this could be a primefaces bug or i did something wrong in my project.

I mention that if i enter the same query the second time that suggestion list is shown.

This is the code for the autocomplete component :

Code: Select all

<p:autoComplete id="filterByMachine" value="#{notificationListViewLazyModel.selectedMachine}" queryDelay="700"  scrollHeight="150" 
                    				completeMethod="#{notificationListViewLazyModel.complete}" converter="#{notificationListViewLazyModel.converter}" 
                    				var="p" itemLabel="#{p.platformName} #{p.serial} #{p.sitename}"  
                    				itemValue="#{p}" forceSelection="true" size="48" >
                    				
                    				<p:ajax event="itemSelect" update="filterMenu notificationListDataTable" listener="#{notificationListViewLazyModel.showSelectedValues}"/>
                    		</p:autoComplete> 
The autocomplete method :

Code: Select all

public List<NotifFilterDTO> complete(String query){
		
		List<NotifFilterDTO> results = new ArrayList<NotifFilterDTO>();
		String queryLowerCase = query.toLowerCase();
		for (NotifFilterDTO filter : comboFilterList) {
			if((filter.getPlatformName().toLowerCase().indexOf(queryLowerCase) != -1) || (filter.getSerial().toString().toLowerCase().indexOf(queryLowerCase) != -1) || (filter.getSitename().toLowerCase().indexOf(queryLowerCase) != -1))
			{				
				results.add(filter);
			}
		}
		
		return results;
	} 


Best regards,Vio
PF 3.2 Mojarra 2.1.7 MS Sql Server 2008

wundzun
Posts: 33
Joined: 07 Mar 2012, 22:01

11 May 2012, 23:00

It's a bug. Fix was already checked in and will be available in PrimeFaces 3.3.
http://code.google.com/p/primefaces/iss ... il?id=3934
Using PrimeFaces 3.3, Mojarra 2.1.6, GlassFish 3.1.2

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 50 guests