Created
November 20, 2012 16:49
-
-
Save mudgen/4119188 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.inductiveautomation.gemsecs.webpages; | |
| import java.util.List; | |
| import org.apache.wicket.Component; | |
| import org.apache.wicket.markup.html.form.upload.FileUploadField; | |
| import org.apache.wicket.model.IModel; | |
| import simpleorm.dataset.SRecordInstance; | |
| import com.inductiveautomation.gemsecs.EquipmentRecord; | |
| import com.inductiveautomation.ignition.gateway.localdb.persistence.FormMeta; | |
| import com.inductiveautomation.ignition.gateway.web.components.ConfigPanel; | |
| import com.inductiveautomation.ignition.gateway.web.components.RecordEditForm; | |
| import com.inductiveautomation.ignition.gateway.web.components.RecordEditMode; | |
| import com.inductiveautomation.ignition.gateway.web.components.editors.AbstractFormComponentEditor; | |
| import com.inductiveautomation.ignition.gateway.web.pages.IConfigPage; | |
| public class FileUploadRecordEditForm extends RecordEditForm { | |
| FileUploadField uploadField = null; | |
| public FileUploadRecordEditForm(IConfigPage configPage, | |
| ConfigPanel destinationPanel, IModel<String> titleModel, | |
| EquipmentRecord record) { | |
| super(configPage, destinationPanel, titleModel, record); | |
| // TODO Auto-generated constructor stub | |
| } | |
| @Override | |
| protected Component newEditorComponent(String id, FormMeta formMeta, RecordEditMode mode,SRecordInstance record) { | |
| Component comp = super.newEditorComponent(id, formMeta, mode, record); | |
| System.out.println(formMeta.getField()); | |
| if(formMeta.getField().equals(EquipmentRecord.SecsDefinitionFile)) { | |
| uploadField = (FileUploadField) ((AbstractFormComponentEditor<?>) comp).getFormComponent(); | |
| System.out.println("uploadField: "+uploadField); | |
| } | |
| return comp; | |
| } | |
| @Override | |
| protected void onSubmit(RecordEditMode mode, List<SRecordInstance> records) { | |
| System.out.println("upload:"+uploadField); | |
| super.onSubmit(mode,records); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment