Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jsf p:rowExpansion不显示来自同一p:datatable的值_Jsf_Primefaces_Datatable_Rowexpansion - Fatal编程技术网

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

Jsf p:rowExpansion不显示来自同一p:datatable的值,jsf,primefaces,datatable,rowexpansion,Jsf,Primefaces,Datatable,Rowexpansion,我已在此内部创建了一个datatable&rowExpansion,rowExpansion不显示同一p:datatable中的一个列值 我需要从dataTable到rowExpansion的面板网格中获取一个特定的commentId,并将commentId和textArea的输入保存在数据库中,但行展开时panelGrid中的commentId为0。如果数据显示在dataTable中,那么为什么不显示在panelGrid中呢 下面是代码 <h:form id="commentList"&

我已在此内部创建了一个
datatable
&
rowExpansion
rowExpansion
不显示同一
p:datatable
中的一个列值

我需要从
dataTable
rowExpansion
的面板网格中获取一个特定的
commentId
,并将
commentId
textArea
的输入保存在数据库中,但行展开时
panelGrid
中的
commentId
为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>


您正在嵌套表单…您无法在网页中将表单放入另一个表单中。即使删除了内部表单标记,我也无法在rowExpansion部分获取commentId。仍然显示0。。。