基本上,我有一个primefaces数据网格组件,用于呈现上传的图像来自p:fileupload
multiple="true"
。
问题是当我将update
属性设置为数据网格(实际上是包含数据网格的表单)时,数据网格只显示一个图像,而不是所有图像。
这是我的代码:
p:fileupload
和:
<p:fileUpload
fileUploadListener="#{galleriesManagedBean.handleFileUpload}"
mode="advanced" multiple="true" sizeLimit="1000000"
allowTypes="/(\.|\/)(gif|jpe?g|png)$/" showButtons="true"
update=":formTabView" />
和附加的托管bean:
<p:dataGrid var="photo"
value="#{galleriesManagedBean.photos}" columns="4" rows="8"
paginator="true"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink}
{PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="8,16,24"
styleClass="ui-datagrid-content"
style="width:700px;table-layout: fixed;">
<p:panel style="text-align:center;width:155px;height:170px;">
<h:panelGrid columns="1" style="text-align:center;">
<p:graphicImage value="#{photo.image_thumbnail_url}" />
<p:commandLink update=":formPhotoDialog:photoDetail"
oncomplete="photoDialog.show()" title="Show Photo">
<h:outputText styleClass="ui-icon ui-icon-arrow-4-diag"
style="margin:0 auto;" />
<f:setPropertyActionListener value="#{photo}"
target="#{galleriesManagedBean.selectedPhoto}" />
</p:commandLink>
<p:commandLink update=":formTabView" title="Delete Photo"
action="#{galleriesManagedBean.deletePhoto}" >
<h:outputText styleClass="ui-icon ui-icon-trash"
style="margin:0 auto;" />
<f:setPropertyActionListener
target="#{galleriesManagedBean.selectedPhoto}" value="#{photo}" />
</p:commandLink>
</h:panelGrid>
</p:panel>
</p:dataGrid>