Example usage for org.apache.wicket.markup.html.form.upload FileUploadField FileUploadField

List of usage examples for org.apache.wicket.markup.html.form.upload FileUploadField FileUploadField

Introduction

In this page you can find the example usage for org.apache.wicket.markup.html.form.upload FileUploadField FileUploadField.

Prototype

public FileUploadField(final String id) 

Source Link

Usage

From source file:au.org.theark.core.web.component.customfieldupload.CustomFieldUploadStep1.java

License:Open Source License

public void initialiseDetailForm() {
    // Set up field on form here

    // progress bar for upload
    // uploadProgressBar = new UploadProgressBar("progress",
    // ajaxSimpleUploadForm);

    // fileUpload for payload
    fileUploadField = new FileUploadField(Constants.UPLOADVO_UPLOAD_FILENAME);

    // Initialise Drop Down Choices
    initialiseDropDownChoices();/*from  w w w. ja v  a 2 s .  c o  m*/

    attachValidators();
    addComponents();
}

From source file:au.org.theark.lims.web.component.biospecimenupload.form.DetailForm.java

License:Open Source License

public void initialiseDetailForm() {
    // Do not allow delete for upload - see TODO in onDeleteConfirmed(..)
    deleteButton.setVisible(false);/*from w  w  w  .j  av a  2  s . co  m*/

    // Set up field on form here
    uploadIdTxtFld = new TextField<String>(Constants.UPLOADVO_UPLOAD_ID);
    // uploadFilenameTxtFld = new TextField<String>(au.org.theark.study.web.Constants.UPLOADVO_UPLOAD_FILENAME);
    fileUploadField = new FileUploadField(Constants.UPLOADVO_UPLOAD_FILENAME);
    fileUploadField.add(new ArkDefaultFormFocusBehavior());

    // Initialise Drop Down Choices
    initialiseDropDownChoices();

    attachValidators();
    addDetailFormComponents();
}

From source file:au.org.theark.lims.web.component.bioupload.BioUploadStep1.java

License:Open Source License

public void initialiseDetailForm() {
    fileUploadField = new FileUploadField(au.org.theark.lims.web.Constants.UPLOADVO_UPLOAD_FILENAME);
    initialiseDropDownChoices();/*ww  w .  ja v  a2  s. c o  m*/
    attachValidators();
    addComponents();
}

From source file:au.org.theark.phenotypic.web.component.phenodataupload.form.DetailForm.java

License:Open Source License

public void initialiseDetailForm() {
    // Do not allow delete for upload - see to do in onDeleteConfirmed(..)
    deleteButton.setVisible(false);/*from ww  w .  j ava2s  . co  m*/

    // Set up field on form here
    uploadIdTxtFld = new TextField<String>(au.org.theark.phenotypic.web.Constants.UPLOADVO_UPLOAD_ID);

    // fileUpload for payload
    fileUploadField = new FileUploadField(au.org.theark.phenotypic.web.Constants.UPLOADVO_UPLOAD_FILENAME);
    fileUploadField.add(new ArkDefaultFormFocusBehavior());

    // Initialise Drop Down Choices
    initialiseDropDownChoices();

    attachValidators();
    addDetailFormComponents();
}

From source file:au.org.theark.phenotypic.web.component.phenodataupload.PhenoDataUploadStep1.java

License:Open Source License

public void initialiseDetailForm() {
    fileUploadField = new FileUploadField(au.org.theark.phenotypic.web.Constants.UPLOADVO_UPLOAD_FILENAME);
    phenoCollectionDescription = new TextField<String>(
            au.org.theark.phenotypic.web.Constants.PHENOCOLLECTION_DESCRIPTION);
    initialiseDropDownChoices();//from  w  w  w  .j  av  a  2 s.c om
    initQuestionnaireDdc();
    initTemplatePanel();
    initDownloadButton(PHENO_TEMPLATE_CELLS, "");
    overwriteExistingCheckBox = new CheckBox("updateChkBox");
    attachValidators();
    addComponents();
}

From source file:au.org.theark.phenotypic.web.component.phenofielduploader.PhenoDataSetCategoryFieldUploadStep1.java

License:Open Source License

public void initialiseDetailForm() {
    // fileUpload for payload
    fileUploadField = new FileUploadField(Constants.UPLOADVO_UPLOAD_FILENAME);
    // Initialise Drop Down Choices
    initialiseDropDownChoices();/*from   www . j  a  v a 2 s . co  m*/
    attachValidators();
    addComponents();
}

From source file:au.org.theark.report.web.component.dataextraction.form.DetailForm.java

License:Open Source License

/**
 * //from  www  .j a v  a  2 s  .  com
 * @param id
 * @param feedBackPanel
 * @param arkCrudContainerVO
 * @param containerForm
 * @param modalWindow
 */
public DetailForm(String id, FeedbackPanel feedBackPanel, ArkCrudContainerVO arkCrudContainerVO,
        ContainerForm containerForm, AbstractDetailModalWindow modalWindow) {
    // super()
    super(id, feedBackPanel, containerForm, arkCrudContainerVO);
    this.feedBackPanel = feedBackPanel;
    this.modalWindow = modalWindow;

    subjectListFileUploadField = new FileUploadField("subjectFileUpload");
}

From source file:au.org.theark.study.web.component.attachments.form.DetailForm.java

License:Open Source License

public void initialiseDetailForm() {
    // Set up field on form here
    subjectFileIdTxtFld = new TextField<String>(au.org.theark.study.web.Constants.SUBJECT_FILE_ID);
    // fileSubjectFile for payload (attached to filename key)
    fileSubjectFileField = new FileUploadField(au.org.theark.study.web.Constants.SUBJECT_FILE_FILENAME);
    fileSubjectFileField.setRequired(true);
    fileSubjectFileField.add(new ArkDefaultFormFocusBehavior());

    // Initialise Drop Down Choices
    initialiseDropDownChoices();/*from w  w w  .j  a v  a 2 s .  c  om*/

    commentsTxtArea = new TextArea<String>(au.org.theark.study.web.Constants.SUBJECT_FILE_COMMENTS);

    attachValidators();
    addDetailFormComponents();
}

From source file:au.org.theark.study.web.component.consent.form.DetailForm.java

License:Open Source License

public void initialiseDetailForm() {
    consentedBy = new TextField<String>(Constants.CONSENT_CONSENTED_BY);

    wmcPlain = new WebMarkupContainer(Constants.WMC_PLAIN);
    wmcPlain.setOutputMarkupPlaceholderTag(true);
    wmcPlain.setVisible(true);/* www. j  a  v  a  2 s. co m*/

    wmcRequested = new WebMarkupContainer(Constants.WMC_REQUESTED);
    wmcRequested.setOutputMarkupPlaceholderTag(true);
    wmcRequested.setVisible(false);

    wmcRecieved = new WebMarkupContainer(Constants.WMC_RECIEVED);
    wmcRecieved.setOutputMarkupPlaceholderTag(true);
    wmcRecieved.setVisible(false);

    wmcCompleted = new WebMarkupContainer(Constants.WMC_COMPLETED);
    wmcCompleted.setOutputMarkupPlaceholderTag(true);
    wmcCompleted.setVisible(false);

    consentedDatePicker = new DateTextField(Constants.CONSENT_CONSENT_DATE,
            au.org.theark.core.Constants.DD_MM_YYYY);
    ArkDatePicker arkDatePicker = new ArkDatePicker();
    arkDatePicker.bind(consentedDatePicker);
    consentedDatePicker.add(arkDatePicker);

    consentRequestedDtf = new DateTextField(Constants.CONSENT_REQUESTED_DATE,
            au.org.theark.core.Constants.DD_MM_YYYY);
    ArkDatePicker requestedDatePicker = new ArkDatePicker();
    requestedDatePicker.bind(consentRequestedDtf);
    consentRequestedDtf.add(requestedDatePicker);
    wmcRequested.add(consentRequestedDtf);

    consentReceivedDtf = new DateTextField(Constants.CONSENT_RECEIVED_DATE,
            au.org.theark.core.Constants.DD_MM_YYYY);
    ArkDatePicker recievedDatePicker = new ArkDatePicker();
    recievedDatePicker.bind(consentReceivedDtf);
    consentReceivedDtf.add(recievedDatePicker);
    wmcRecieved.add(consentReceivedDtf);

    consentCompletedDtf = new DateTextField(Constants.CONSENT_COMPLETED_DATE,
            au.org.theark.core.Constants.DD_MM_YYYY);
    ArkDatePicker completedDatePicker = new ArkDatePicker();
    completedDatePicker.bind(consentCompletedDtf);
    consentCompletedDtf.add(completedDatePicker);
    wmcCompleted.add(consentCompletedDtf);

    commentTxtArea = new TextArea<String>(Constants.CONSENT_CONSENT_COMMENT);

    // fileSubjectFile for consent file payload (attached to filename key)
    fileUploadField = new FileUploadField(au.org.theark.study.web.Constants.SUBJECT_FILE_FILENAME);
    clearButton = new AjaxButton("clearButton") {
        @Override
        protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
            fileUploadField.clearInput();
            target.add(fileUploadField);
        }

        @Override
        protected void onError(AjaxRequestTarget target, Form<?> form) {
            fileUploadField.clearInput();
            target.add(fileUploadField);
        }
    };
    clearButton.add(new AttributeModifier("title", new Model<String>("Clear Attachment")));

    initStudyComponentChoice();
    initConsentTypeChoice();
    initConsentStatusChoice();
    initStudyComponentStatusChoice();
    initConsentDownloadChoice();
    initConsentHistoryPanel();

    addDetailFormComponents();
    attachValidators();

    historyButtonPanel = new HistoryButtonPanel(containerForm, arkCrudContainerVO.getEditButtonContainer(),
            arkCrudContainerVO.getDetailPanelFormContainer());
}

From source file:au.org.theark.study.web.component.correspondence.form.DetailForm.java

License:Open Source License

public void initialiseDetailForm() {
    initialiseOperatorDropDown();/* w w  w  .  j a v  a 2 s. c om*/
    // create new DateTextField and assign date format
    dateFld = new DateTextField("correspondence.date", au.org.theark.core.Constants.DD_MM_YYYY);
    ArkDatePicker datePicker = new ArkDatePicker();
    datePicker.bind(dateFld);
    dateFld.add(datePicker);

    timeTxtFld = new TextField<String>("correspondence.time");
    initialiseModeTypeDropDown();
    initialiseDirectionTypeDropDown();
    initialiseOutcomeTypeDropDown();
    reasonTxtArea = new TextArea<String>("correspondence.reason");
    detailsTxtArea = new TextArea<String>("correspondence.details");
    commentsTxtArea = new TextArea<String>("correspondence.comments");

    billableItemLbl = new Label("billableItemDescription");
    billableItemLbl.setOutputMarkupId(true);
    billableItemLbl.setVisible(true);

    studyNameLbl = new Label("studyName");
    studyNameLbl.setOutputMarkupId(true);
    studyNameLbl.setVisible(true);

    // fileUploadField = new FileUploadField("correspondence.attachmentFilename", new Model<List<FileUpload>>());
    fileUploadField = new FileUploadField("file");
    setMaxSize(Bytes.kilobytes(2048));

    fileNameLbl = new Label("correspondence.attachmentFilename");
    fileNameLbl.setOutputMarkupId(true);

    clearButton = new AjaxButton("clearButton") {
        @Override
        protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
            fileUploadField.clearInput();
            target.add(fileUploadField);
        }

        @Override
        protected void onError(AjaxRequestTarget target, Form<?> form) {
            fileUploadField.clearInput();
            target.add(fileUploadField);
        }
    };
    clearButton.add(new AttributeModifier("title", new Model<String>("Clear Attachment")));

    deleteButton = new AjaxButton("deleteButton") {
        private static final long serialVersionUID = 1L;

        @Override
        protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
            containerForm.getModelObject().getCorrespondence().setAttachmentPayload(null);
            containerForm.getModelObject().getCorrespondence().setAttachmentFilename(null);
            this.setVisible(false);
            target.add(fileNameLbl);
            target.add(this);
        }

        @Override
        protected void onError(AjaxRequestTarget target, Form<?> form) {
            containerForm.getModelObject().getCorrespondence().setAttachmentPayload(null);
            containerForm.getModelObject().getCorrespondence().setAttachmentFilename(null);
            this.setVisible(false);
            target.add(fileNameLbl);
            target.add(this);
        }

        @Override
        public boolean isVisible() {
            return (containerForm.getModelObject().getCorrespondence().getAttachmentFilename() != null)
                    && !containerForm.getModelObject().getCorrespondence().getAttachmentFilename().isEmpty();
        }
    };
    deleteButton.add(new AttributeModifier("title", new Model<String>("Delete Attachment")));
    deleteButton.setOutputMarkupId(true);

    workTrackingContainer = new WebMarkupContainer("worktrackingcontainer");
    workTrackingContainer.setVisible(false);

    initBillableItemTypeDropDown();
    initWorkRequestDropDown();

    addDetailFormComponents();
    attachValidators();

    historyButtonPanel = new HistoryButtonPanel(containerForm, arkCrudContainerVO.getEditButtonContainer(),
            arkCrudContainerVO.getDetailPanelFormContainer());
}