2

I use the same query both the first and the second time.I see that complete method get called the first time but after it computes the results they aren't send on the UI.Did anyone encountered this problem ? Do you have any ideas on how to solve this ?

<p:autoComplete id="filterByMachine" value="#{notificationListViewLazyModel.selectedMachine}"  scrollHeight="500" 
                                completeMethod="#{notificationListViewLazyModel.complete}" converter="#{notificationListViewLazyModel.converter}" 
                                var="p" itemLabel="#{p.platformName} #{p.serial} #{p.sitename}"  
                                itemValue="#{p}" forceSelection="true" size="48" >
Viocartman
  • 153
  • 3
  • 14

3 Answers3

1

I'm not certain this issue is related, but this same scenario just happened to us. After tracing the problem down to the database level, we found out what was going on.

Somehow the autoComplete component adds two leading white spaces to the query string the first time the user enters text.

Trimming the query string solved the problem for us.

Cenobyte321
  • 469
  • 1
  • 8
  • 26
0

your itemValue is an Object, therefore you would need to implement a converter (implement converter).

The itemValue is the items value, which is passed to the server as a request parameter, but the value is a value binding expression that points to a SelectItem instance (ref).

Community
  • 1
  • 1
Oscar Castiblanco
  • 1,626
  • 14
  • 31
  • I have a convertor implemented but still why does it work the second time ? I checked with firebug and the 2 responses i get from the backend are the same , or almost since only the second time i see the list of suggestions. – Viocartman May 10 '12 at 11:34
-1

I also had the same problem. when i click the field it doesnt work but when i tab to the field and started to write somethings it auto completes.

there are white space characters also in value field between expressions(Before second and third # character);

    itemLabel="#{p.platformName} #{p.serial} #{p.sitename}" 

when i click the field it remains. but when i tab the field it is auto selected ans while writing selected area replaced my writing. so it works ;)

example;

    itemLabel="#{p.platformName}#{p.serial}#{p.sitename}" 
Fatih
  • 1
  • 1