I'm trying to filter a column using backing bean function.
<p:dataTable id="cars"
var="car"
value="#{manageAllCoursesBean.courses}"
filteredValue="#{manageAllCoursesBean.filteredCourse1}">
<f:facet name="header">
<p:outputPanel>
<p:inputText id="globalFilter"
onkeyup="PF('carsTable1').filter()"
style="width:250px"
placeholder="Entrer un mot clé"/>
</p:outputPanel>
</f:facet>
<p:column headerText="Name"
filterBy="#{car.name}"
sortBy="#{car.name}"
style="color: #400040; font-size: 10px; width: 150px; text-align:center">
<h:outputText value="#{car.name}" />
</p:column>
<p:column headerText="Teacher"
filteredBy="#{manageAllCoursesBean.findTeacherByIdCourse(car.id)}"
sortBy="#{manageAllCoursesBean.findTeacherByIdCourse(car.id)}"
style="color: #400040; font-size: 10px; width: 175px; text-align:center">
<h:outputText value="#{manageAllCoursesBean.findTeacherByIdCourse(car.id)}" />
</p:column>
</p:dataTable>
the backing bean method is:
public String findTeacherByIdCourse(String courseId) throws IOException
{
return serviceManager.findTeacherByCourseId(courseId);
}
the filter with Name is working as well. However, is not the case with Teacher.
Have you please any idea about solving that ?. Big thanks.
filterBy="#{car.name}"
. However can't work withfilteredBy="#{manageAllCoursesBean.findTeacherByIdCourse(car.id)}"
- misseoui nahlafilteredBy="#{manageAllCoursesBean.findTeacherByIdCourse(car.id)}"
to work? Where did you read it should? And "can't work" is not really a good description a developer would give... is the method called? And there still is no version info, not a minimal reproducible example not any indication what you tried searching/reading etc... Please improve the question - Kukeltje