public Collection<FileUpload> getUploads() { return uploadField.getConvertedInput(); } }
public Collection<FileUpload> getUploads() { return uploadField.getConvertedInput(); } }
/** * @see org.apache.wicket.markup.html.form.FormComponent#updateModel() */ @Override public void updateModel() { final Collection<FileUpload> collection = getModelObject(); // figure out if there is an existing model object collection for us to // reuse if (collection == null) { // no existing collection, push the one we created setDefaultModelObject(getConvertedInput()); } else { // refresh the existing collection collection.clear(); if (getConvertedInput() != null) { collection.addAll(getConvertedInput()); } // push the collection in case the model is listening to // setobject calls setDefaultModelObject(collection); } }
setModelObject(getConvertedInput()); if (getConvertedInput() != null) collection.addAll((Collection)getConvertedInput());
/** * @see org.apache.wicket.Component#onDetach() */ protected void onDetach() { // cleanup any opened filestreams Collection uploads = (Collection)getConvertedInput(); if (uploads != null) { Iterator it = uploads.iterator(); while (it.hasNext()) { final FileUpload upload = (FileUpload)it.next(); upload.closeStreams(); } } // cleanup any caches inputArrayCache = null; // clean up the model because we don't want FileUpload objects in session Object modelObject = getModelObject(); if (modelObject != null && (modelObject instanceof Collection)) { ((Collection)modelObject).clear(); } super.onDetach(); }
/** * @see org.apache.wicket.Component#onDetach() */ @Override protected void onDetach() { // cleanup any opened filestreams Collection<FileUpload> uploads = getConvertedInput(); if (uploads != null) { Iterator<FileUpload> it = uploads.iterator(); while (it.hasNext()) { final FileUpload upload = it.next(); upload.closeStreams(); } } // cleanup any caches inputArrayCache = null; // clean up the model because we don't want FileUpload objects in session Collection<FileUpload> modelObject = getModelObject(); if (modelObject != null) { modelObject.clear(); } super.onDetach(); }
@Override protected void onDetach() { if (forceCloseStreamsOnDetach()) { // cleanup any opened filestreams Collection<FileUpload> uploads = getConvertedInput(); if (uploads != null) { for (FileUpload upload : uploads) { upload.closeStreams(); } } // cleanup any caches inputArrayCache = null; // clean up the model because we don't want FileUpload objects in session Collection<FileUpload> modelObject = getModelObject(); if (modelObject != null) { modelObject.clear(); } } super.onDetach(); }
@Override protected void onDetach() { if (forceCloseStreamsOnDetach()) { // cleanup any opened filestreams Collection<FileUpload> uploads = getConvertedInput(); if (uploads != null) { for (FileUpload upload : uploads) { upload.closeStreams(); } } // cleanup any caches inputArrayCache = null; // clean up the model because we don't want FileUpload objects in session Collection<FileUpload> modelObject = getModelObject(); if (modelObject != null) { modelObject.clear(); } } super.onDetach(); }