2013-06-06 5 views
0

나는 다음과 같은 것을 시도하고 있습니다. 값 목록에있는 코드 조각이 있습니다.<p:dataTable> 각 열을 고유하게 식별해야합니다.

<h:panelGroup id="table-wrapper"> 
    <p:dataTable value="#{searchBean.listUser}" var="user" rendered="#{not empty searchBean.listUser}" style="width: 10%;"> 
     <p:column headerText="Trigram"> 
      <h:outputText value="#{user.strUserid}"/> 
     </p:column> 
     <p:column headerText="First Name"> 
      <h:outputText value="#{user.strFirstname}"/> 
     </p:column> 
     <p:column headerText="Last Name"> 
      <h:outputText value="#{user.strLastname}"/> 
     </p:column> 
     <p:column headerText="Insert PL"> 
      <p:commandLink actionListener="#{searchBean.getRowDetails}" id="plValue" process="@this" title="Insert Leave"> 
       <h:graphicImage url="resources/images/button.png" style="height: 10px;width:10px"/> 
       <f:attribute name="tri" value="#{user.strUserid}"/> 
       <f:attribute name="fname" value="#{user.strFirstname}"/> 
       <f:attribute name="lname" value="#{user.strLastname}"/> 
      </p:commandLink>            
     </p:column> 
    </p:dataTable> 
</h:panelGroup> 

여기에서 버튼을 클릭하면 actionListener이 실행되지 않습니까? 코드는 <h:form> 태그 안에 있습니다.

JDK6.0 | Jboss As 7.1.1 최종 | JSF2.0 | PrimeFaces 3.4.2

+0

에서 대화 상자를 표시하는'하지 않습니다 './insertLeave.xhtml' 페이지를 열어도 이상하게 actionListener가 실행되지 않습니까? – NDeveloper

+0

완료했습니다 .. 고마워요 :) – NDeveloper

답변

0

즉석 행 선택의 Primefaces 쇼케이스에서 선택한 행이 대화 상자에 표시되는 예제를 사용하지 않는 이유는 무엇입니까? 당신이 정말로 버튼이 필요하면, 당신은 백업 빈에서의 selectedItem을 설정할 수있는 명령을 사용할 수 있습니다 및 onComplete를은`사용하여 같은 방법으로

http://www.primefaces.org/showcase/ui/datatableRowSelectionInstant.jsf

관련 문제