I got a p:dataTable which contains
<p:dataTable id="dataTable" widgetVar="dataTableCar" var="category"
value="#{CategoryBean.categories}" selection="#{CategoryBean.selectedCategory}"
selectionMode="single" rowKey="#{category}"
<p:column headerText="name">
<h:outputText value="#{category.name}" />
</p:column>
<p:column headerText="parent">
<p:autoComplete id="parentCategory" completeMethod="#{CategoryBean.categories}" maxResults="20" value="#{category.parent}" var="p" itemLabel="#{p.name}"
itemValue="#{p}" converter="#{categoryStringConverter}"
forceSelection="true">
<p:ajax event="itemSelect"
listener="#{CategoryBean.oncategorySelect}" />
</p:autoComplete>
</p:column>
I need to force a row selection in case the user clicks into the autocomplete. Maybe I should mention if the user clicks into a ui control (in this example it is the autocomplete) which is hosted by the p:column, there will be no row selected.
Is there a way to implement this? If I don't get the selected row, I can't process the parent category.