Skip to content
Snippets Groups Projects
Commit 20293a55 authored by buczekp's avatar buczekp
Browse files

fixed attachments in sample edition

SVN: 11559
parent f56d14b4
No related branches found
No related tags found
No related merge requests found
...@@ -25,7 +25,7 @@ import java.util.List; ...@@ -25,7 +25,7 @@ import java.util.List;
import com.extjs.gxt.ui.client.Events; import com.extjs.gxt.ui.client.Events;
import com.extjs.gxt.ui.client.event.ButtonEvent; import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.SelectionListener; import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.widget.form.FileUploadField; import com.extjs.gxt.ui.client.widget.form.FormPanel;
import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback;
...@@ -150,7 +150,6 @@ public final class GenericSampleEditForm extends ...@@ -150,7 +150,6 @@ public final class GenericSampleEditForm extends
return editor; return editor;
} }
@SuppressWarnings("unchecked")
@Override @Override
protected List<DatabaseModificationAwareField<?>> getEntitySpecificFormFields() protected List<DatabaseModificationAwareField<?>> getEntitySpecificFormFields()
{ {
...@@ -160,13 +159,23 @@ public final class GenericSampleEditForm extends ...@@ -160,13 +159,23 @@ public final class GenericSampleEditForm extends
{ {
fields.add(wrapUnaware(experimentFieldOrNull.getField())); fields.add(wrapUnaware(experimentFieldOrNull.getField()));
} }
for (FileUploadField f : attachmentsManager.getFields())
{
fields.add(DatabaseModificationAwareField.wrapUnaware(f));
}
return fields; return fields;
} }
@Override
protected void addFormFieldsToPanel(FormPanel panel)
{
super.addFormFieldsToPanel(panel);
attachmentsManager.addAttachmentFieldSetsToPanel(panel);
}
@Override
protected void resetPanel()
{
super.resetPanel();
attachmentsManager.resetAttachmentFieldSetsInPanel(formPanel);
}
private static boolean canAttachToExperiment(Sample sample) private static boolean canAttachToExperiment(Sample sample)
{ {
return sample.getGroup() != null; return sample.getGroup() != null;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment