primefaces autocomplete event itemSelect listener value null in ManagedBean
10,611
The reason is you didn't provide itemValue
attribute in p:autoComplete
component.
Comments
-
Jacob almost 2 years
I am using Primefaces 3.4.2 Autocomplete.
In ManagedBean when I select a row as I type characters in autocomplete, I am not able to get the value in method
handleSelect(SelectEvent event)
{What could be the reason for this? Ideally I would like to fill or populate other columns in jsf page when I select a row from 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);