Skip to content
Snippets Groups Projects
Commit 387c37a4 authored by Markus Escher's avatar Markus Escher
Browse files

#1030644 add new ViewTemplate (ActionList) to Document_context

parent bf328020
No related branches found
No related tags found
No related merge requests found
......@@ -72,19 +72,16 @@
<entityParameter>
<name>AssignmentTable_param</name>
<expose v="true" />
<triggerRecalculation v="false" />
<description>PARAMETER</description>
</entityParameter>
<entityParameter>
<name>AssignmentName_param</name>
<expose v="true" />
<triggerRecalculation v="false" />
<description>PARAMETER</description>
</entityParameter>
<entityParameter>
<name>AssignmentRowId_param</name>
<expose v="true" />
<triggerRecalculation v="false" />
<description>PARAMETER</description>
</entityParameter>
<entityIncomingField>
......@@ -234,6 +231,11 @@
</entityDependency>
</dependencies>
</entityIncomingField>
<entityActionField>
<name>downloadEntryAction</name>
<fieldType>ACTION</fieldType>
<onActionProcess>%aditoprj%/entity/Document_entity/entityfields/downloadentryaction/onActionProcess.js</onActionProcess>
</entityActionField>
</entityFields>
<recordContainers>
<jDitoRecordContainer>
......
......@@ -9,13 +9,13 @@
</drawerLayout>
</layout>
<children>
<treetableViewTemplate>
<name>DocumentTreeList_view</name>
<actionListViewTemplate>
<name>ActionList_template</name>
<titleField>NAME</titleField>
<descriptionField>DESCRIPTION</descriptionField>
<iconField>ICON</iconField>
<hideActions v="true" />
<entryAction>downloadEntryAction</entryAction>
<entityField>#ENTITY</entityField>
</treetableViewTemplate>
</actionListViewTemplate>
</children>
</neonView>
......@@ -23,7 +23,8 @@ DocumentUtil.downloadSelectedDocuments = function() {
var alias = db.getCurrentAlias();
// Download selected files (=not opened)
if(vars.exists("$local.uids") && vars.get("$local.rows") != '') {
if(vars.exists("$local.uids") && vars.exists("$local.rows")
&& vars.get("$local.rows") != '') {
var rows = JSON.parse(vars.get("$local.rows"));
var uids = JSON.parse(vars.get("$local.uids"));
var binaryContents = db.getBinaryContents(uids, alias);
......@@ -37,11 +38,21 @@ DocumentUtil.downloadSelectedDocuments = function() {
neon.download(binaryContents[0], rows[0]["NAME"]);
}
}
// Download open file
else if(vars.exists("$field.UID") && vars.get("$field.UID") != '') {
var id = vars.get("$field.UID");
var name = vars.get("$field.NAME");
var binaryContent = db.getBinaryContent(id, alias);
else {
var id;
var name;
if(vars.exists("$local.uid")) {
// Download single file (=not opened)
id = JSON.parse(vars.get("$local.uid"));
name = vars.get("$local.value");
} else {
// Download open file
id = vars.get("$field.UID");
name = vars.get("$field.NAME");
}
var binaryContent = db.getBinaryContent(id, alias);
if(binaryContent != null && binaryContent != '')
neon.download(binaryContent, name);
}
......
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