Code: Select all
<h:form id="labels" enctype="multipart/form-data">
<h:inputHidden value="#{excursion_type.id}" id="id" />
<h:inputHidden value="1" id="thetype" />
<p:growl id="msg"></p:growl>
<p:fileUpload value="#{photos.main_photo}" mode="advanced" allowTypes="/(\.|\/)(gif|jpe?g|png)$/" auto="false"
fileUploadListener="#{photos.uploadMultiple}" update="msg,:theimages:alvs" />
</h:form>
<h:form id="theimages">
<h:inputHidden value="#{excursion_type.id}" id="id2" />
<h:inputHidden value="1" id="thetype2" />
<h:inputHidden value="#{excursion_type.id}" />
Click <h:commandButton action="#{photos.reload()}" value="Reload" /> to refresh the page after uploading multiple photos.
<h:panelGroup id="alvs">
<p:lightBox styleClass="imagebox" id="lighbox1">
<ui:repeat value="#{photos.getPhotos(1, excursion_type.id)}" var="thephoto" id="thephotoss">
<h:outputLink value="#{facesContext.externalContext.requestContextPath}/resources/PhotoGallery/#{thephoto.path}" title="#{excursion_type.title_en}">
<p:graphicImage name="PhotoGallery/#{thephoto.path}" style="height: 77px; width: 100px; margin-right: 5px;"
id="testt" />
<p:contextMenu for="testt">
<p:menuitem value="Delete" onclick="window.location='#{facesContext.externalContext.requestContextPath}/faces/deletephoto.xhtml?id=#{thephoto.id}'" icon="ui-icon-close" />
<p:menuitem value="Set main" onclick="window.location='#{facesContext.externalContext.requestContextPath}/faces/setmainphoto.xhtml?id=#{thephoto.id}'" icon="ui-icon-flag" />
</p:contextMenu>
</h:outputLink>
</ui:repeat>
</p:lightBox>
</h:panelGroup>
</h:form>
Can i do this or there is another way to do it?
Thank you