I am working on JSF and Hibernate integration, where i have a dataTable , which contains records from multiple table records.
I just want, When i click a row the row values should be assigned to respective pojo class .
I identified that we can do it using
setPropertyActionListenerI have the following methods.
1.
HQL Query=select a from Personal as aCode:
<p:dataTable var="leavereq" value="#{leaverequest.requestlist}" >
<p:column headerText="Name" >
<h:outputText value="#{leavereq.ename}" />
</p:column>
<p:column headerText="Action">
<p:commandButton id="selectButton" >
<f:setPropertyActionListener value="#{leavereq}" target="#{leaverequest.lrb}" />
</p:commandButton>
</p:column>
</p:dataTable>
Target class: Personal lrb;
This is working fine...!!
2.
HQL Query='select a.name,b.eid from Personal as a,Official as b';Code:
<p:dataTable var="leavereq" value="#{leaverequest.requestlist}" >
<p:column headerText="Name" >
<h:outputText value="#{leavereq.ename}" />
</p:column>
<p:column headerText="Id" >
<h:outputText value="#{leavereq.eid}" />
</p:column>
<p:column headerText="Action">
<p:commandButton id="selectButton" >
<f:setPropertyActionListener value="#{leavereq}" target="#{leaverequest.lrb}" />
</p:commandButton>
</p:column>
</p:dataTable>
Here the value will be depend on two tables
Target classes:
Personal lrb;Official official;
This is not working !!How cal i set the values in two pojo classes using
setPropertyActionListener ?