p:rowExpansion不显示来自相同p:datatable的值

时间:2015-01-13 06:17:10

标签: jsf primefaces datatable rowexpansion

我创建了datatable& rowExpansion在其中rowWxpansion不会显示来自同一p:dataTable的其中一个列值。

我需要从commentIddataTable&的面板网格,点击要展开的特定rowExpansion。保存数据库中的commentIdtextArea输入,但展开行时commentId中的panelGrid为0 {0}。如果数据显示在dataTable中,那么为什么它不会进入panelGrid

以下是代码

<h:form id="commentList">
  <p:dataTable id="commentTable" paginator="true" rows="10" var="comment" value="#{commentAction.list(uID)}" class="table table-striped table-bordered table-hover commentTable" widgetVar="commentListTable">
    <p:column>  
      <p:rowToggler/>  
    </p:column>
    <p:column filterBy="#{comment.commentId}" footerText="" headerText="Comment Id" filterMatchMode="contains" sortBy="#{comment.commentId}">
    <h:outputText value="#{comment.commentId}" id="commentId"/>
    </p:column>
    <p:column filterBy="#{comment.selectedText}" headerText="Selected Text" sortBy="#{comment.selectedText}">
      <h:outputText value="#{comment.selectedText}" id="selectedText"/>
    </p:column>
    <p:column filterBy="#{comment.commentText}" headerText="Comment" sortBy="#{comment.commentText}">
      <h:outputText value="#{comment.commentText}" id="commentText" escape="false"/>
    </p:column>
    <p:column filterBy="" headerText="Comment From" sortBy="">
      <h:outputText value="" id="commentFrom"/>
    </p:column>
    <p:column filterBy="#{comment.insertedOn}" headerText="Date/Time" sortBy="#{comment.insertedOn}">
      <h:outputText value="#{comment.insertedOn}" id="insertedOn"/>
    </p:column>
    <p:column filterBy="#{comment.commentStatus}" headerText="Comment Status" sortBy="#{comment.commentStatus}">
      <h:inputHidden value="#comment.commentId" id="commId"/>
      <h:selectOneMenu value="#{comment.commentStatus}" id="commentStatus" class="commentSelectBox">
        <f:selectItem itemLabel="#{comment.commentStatus}" itemValue="#{comment.commentStatus}" itemDisabled="true"/>
        <f:selectItem itemValue="Open" itemLabel="Open"/>
        <f:selectItem itemValue="Close" itemLabel="Close"/>
        <f:selectItem itemValue="Cancel" itemLabel="Cancel"/>
        <f:ajax event="change" listener="#{commentAction.updateCommentStatus}" execute="commId commentStatus"/>
      </h:selectOneMenu>
    </p:column>
    <p:rowExpansion>
      <h:panelGrid id="display" columns="1" cellpadding="4" style="width:100%" styleClass="replyBox" > 
       <h:form class="commentDescriptionDiv commentDesing">
         <h:outputText value="#{comment.commentId}"/>
         <h:inputTextarea value="#{commentAction.replyText}"/>
         <h:commandLink value="Reply" action="#{commentAction.saveReply(commentId)}"/>
       </h:form>
    </h:panelGrid>  
  </p:rowExpansion> 
</p:dataTable>

0 个答案:

没有答案