-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Set dataTable value in pojo using setPropertyActionListner ?
PostPosted: Mon Feb 24, 2014 2:48 am 
Newbie

Joined: Mon Feb 24, 2014 2:36 am
Posts: 1
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 setPropertyActionListener

I have the following methods.

1. HQL Query=select a from Personal as a
Code:
  <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 ?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.