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。。。