Object autocomplete event element. Select the receiver value null in the ManagedBean.

I am using Primefaces 3.4.2 Autocomplete.

In ManagedBean, when I select a line while typing characters in autocomplete, I cannot get the value in the handleSelect(SelectEvent event)

{

What could be causing this? Ideally, I would like to fill or fill other columns in the jsf page when I select a row from the autocomplete values.

JSF code for autocomplete

<p:autoComplete value="#{empMB.selectedEmployee}"
                            id="basicPojo" minQueryLength="3" 
                            completeMethod="#{myMB.complete}" var="p"
                            itemLabel="#{p.empName}" 
                             converter="#{employeeNameConverter}"
                            forceSelection="true" >                           
                            <p:ajax event="itemSelect" 
                            listener="#{myMB.handleSelect}" /> 

      

ManagedBean method

public void handleSelect(SelectEvent event) {
String value = (String) event.getObject();
System.out.println("selected "+value);

      

+3


source to share


1 answer


The reason is because you did not specify the attribute itemValue

in the component p:autoComplete

.



+2


source







All Articles