01: package ru.emdev.EmForge.web.bean;
02:
03: import java.io.IOException;
04:
05: import org.richfaces.event.UploadEvent;
06: import org.richfaces.model.UploadItem;
07:
08: /** Common upload form, used in placed, there we need to upload some file with some extra data
09: *
10: * File should be uploaded into this form, extra data will be commited with form "Submit" button
11: * into required backing bean. During processing Submit backing bean will get required file from this controller
12: *
13: * It should be session-scoped
14: *
15: */
16: public class UploadForm {
17: private UploadItem uploadItem;
18:
19: public void upload(UploadEvent event) throws IOException {
20: uploadItem = event.getUploadItem();
21: }
22:
23: public UploadItem getUploadItem() {
24: return uploadItem;
25: }
26:
27: public void reset() {
28: uploadItem = null;
29: }
30: }
|