0

我在其中创建了一个datatable& rowExpansionrowWxpansion不显示来自相同的列值之一p:dataTable

我需要将一个特定commentId的,单击以进行扩展,从dataTable面板网格中保存并在数据库中rowExpansion保存commentId和输入textArea,但在扩展行时为commentId0 。panelGrid如果数据显示在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>
4

0 回答 0