List of usage examples for org.apache.wicket.markup.html.form.upload MultiFileUploadField MultiFileUploadField
public MultiFileUploadField(String id, IModel<? extends Collection<FileUpload>> model, int max)
From source file:org.devproof.portal.module.uploadcenter.panel.UploadFilePanel.java
License:Apache License
private MultiFileUploadField createMultiFileUploadField() { return new MultiFileUploadField("fileInput", uploadModel, configurationService.findAsInteger(UploadCenterConstants.CONF_UPLOADCENTER_MAXFILES)); }
From source file:org.sakaiproject.profile2.tool.pages.MyPictures.java
License:Educational Community License
private void createAddPictureForm(final String userUuid) { addPictureUploadFolder = new Folder(System.getProperty("java.io.tmpdir"), "addPicturesUploadFolder"); addPictureUploadFolder.mkdirs();//from w ww .ja v a2s.com //file feedback will be redirected here final FeedbackPanel fileFeedback = new FeedbackPanel("fileFeedback"); fileFeedback.setOutputMarkupId(true); Form addPictureForm = new FileUploadForm("form", userUuid, fileFeedback); addPictureForm.add(fileFeedback); addPictureForm.setOutputMarkupId(true); add(addPictureForm); Label invalidFileTypeMessageLabel = new Label("invalidFileTypeMessage", new ResourceModel("pictures.filetypewarning")); invalidFileTypeMessageLabel.setMarkupId("invalidFileTypeMessage"); invalidFileTypeMessageLabel.setOutputMarkupId(true); addPictureForm.add(invalidFileTypeMessageLabel); WebMarkupContainer addPictureContainer = new WebMarkupContainer("addPictureContainer"); addPictureContainer.add(new Label("addPictureLabel", new ResourceModel("pictures.addpicture"))); addPictureContainer.add(new MultiFileUploadField("choosePicture", new PropertyModel<Collection<FileUpload>>(addPictureForm, "uploads"), ProfileConstants.MAX_GALLERY_FILE_UPLOADS)); IndicatingAjaxButton submitButton = new IndicatingAjaxButton("submitPicture", new ResourceModel("button.gallery.upload")) { private static final long serialVersionUID = 1L; @Override protected void onSubmit(AjaxRequestTarget target, Form<?> form) { target.add(fileFeedback); } protected void onError(AjaxRequestTarget target, Form form) { log.debug("MyPictures.onSubmit validation failed."); target.add(fileFeedback); } }; addPictureContainer.add(submitButton); addPictureContainer.add(new IconWithClueTip("galleryImageUploadToolTip", ProfileConstants.INFO_IMAGE, new StringResourceModel("text.gallery.upload.tooltip", null, new Object[] { sakaiProxy.getMaxProfilePictureSize() * ProfileConstants.MAX_GALLERY_FILE_UPLOADS }))); addPictureForm.add(addPictureContainer); addPictureFiles.addAll(Arrays.asList(addPictureUploadFolder.listFiles())); addPictureListView = new FileListView("fileList", addPictureFiles); addPictureForm.add(addPictureListView); }