Suppose top have one class Student. My problem is that when I run the code in debug and I put some breackpoints in my method onRowSelect
but when I select the row, the code doesn't go to breakpoints and it show me the dialog but whitout value.
search.xhtml:
<h:form id="form">
<p:dataTable id="resultStudent" var="student" lazy="true" value="#{studentBean.listStudents}" selectionMode="single" selection="#{studentBean.selectedStudent}" rows="10"
paginator="true"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="2,5,10,15" rowKey="#{student.idStudent}">
<!-- This is the problem -->
<p:ajax event="rowSelect" listener="#{studentBean.onRowSelect}" update=":form:StrudentDetail" oncomplete="PF('studentDialog').show()" process="resultStudent"/>
....
</p:dataTable>
<!-- The dialog is -->
<p:dialog header="Detaails Student" widgetVar="studentDialog" modal="true" showEffect="fade" hideEffect="fade" resizable="false">
<p:outputPanel id="StudentDetail" style="text-align:center;">
<p:panelGrid columns="2" rendered="#{not empty studentBean.selectedStudent}" columnClasses="label,value">
<f:facet name="header">
<!-- <p:graphicImage name="demo/images/car/#{dtLazyView.selectedCar.brand}-big.gif"/>-->
</f:facet>
The class StudentBean is:
@ManagedBean(name = "studentBean")
@ViewScoped
public class StudentBean {
... AAL method get and set
private Student selectedStudent;
@PostConstruct
public void init() {...
}
public void onRowSelect(SelectEvent event) {
//THis I put the debug and the code doesn't seem execute here
int id=(Student)event.getObject()).getIdStudent());
FacesMessage msg = new FacesMessage("Student Selected");
FacesContext.getCurrentInstance().addMessage(null, msg);
}
Anyone can help me?