我有一个包含文件信息的数据表,首先用户上传文件,然后将文件添加到数据库中,并且文件信息出现在数据表中,这是我的代码:
<p:fileUpload fileUploadListener="#{projectTestManagementMB.handleFileUpload}"
oncomplete="projectTestManagementMB.loadFamilyAttachemtsList()"
update="familyAttachmentDt" />
<p:dataTable id="familyAttachmentDt" var="familyAttachment" value="#
{projectTestManagementMB.familyAttachmentsList}">
<p:column headerText="Name">
<h:outputText value="#{familyAttachment.name}"
/>
</p:column>
<p:column headerText="Size">
<h:outputText value="#
{familyAttachment.size}" />
</p:column>
<p:column headerText="Creation Date">
<h:outputText value="#
{familyAttachment.date}" />
</p:column>
<p:column headerText="Options">
</p:column>
</p:dataTable>
我想刷新数据表,所以我使用指向数据表的更新属性和 oncomplete 属性来调用 loadFamilyAttachemtsList() 方法:
public void loadFamilyAttachemtsList(){
System.out.println("loadFamilyAttachemtsList");
Family family= (Family) selectedNode.getData();
DataModel.setCurrentFamily(family);
familyAttachmentList=DataModel.initSelectedFamilyAttachements(family);
}
但是这个方法永远不会被调用
任何 ida 将不胜感激