yuuvis® RAD Q&A

0 votes
by (400 points)

We have a structure tree that should be standard plus one subfolder based on the document type. We currently have this designed as in the image on the left. Unfortunately, the structure tree disappears in parts when there is not a single object in this folder (right side of the first image).
How can I stop this?
When trying to realize this via the showempty or hideempty attribute, I got errors or results that did not bring me to my goal.

If I leave JSON-Definition empty then the empty folders are displayed correctly - see second image:

Our code is as follows:

[

{

"key":"documents",
"title":"Documents",
"title_locales": 
  {
  "en":"Supplier documents",
  "de":"Lieferantendokumente",
  "zh":"供应商文件"
  },

"expanded":true,
			  
"folder":
[
  {
    "key":"creditorfiles",
	"type":"creditorfile",
    "title":"Document by type",
    "title_locales": {
      "en":"General supplier documents",
      "de":"Allgemeine Lieferantendokumente",
      "zh":"一般供应商文件"
	},
    "field": "file.abdocumenttype",
    "expanded":true
  },
  {
    "title":"Creditor Contacts",
	"title_locales": {
      "en":"Supplier contacts",
      "de":"Lieferantenkontakte",
      "zh":"供应商联系"
	},
    "key":"creditorcontacts",
    "type": "creditorcontact",
	"expanded":true
  },
  {
    "title":"Creditor E-Mails",
	"title_locales": {
      "en":"Supplier E-Mails",
      "de":"Lieferanten-E-Mails",
      "zh":"供应商电子邮件"
	},
    "key":"creditoremails",
    "type": "creditoremail",
	"expanded":true,
	"hideempty":false,
	"showempty": true
  },
  {
    "title":"Invoices",
	"title_locales": {
      "en":"Invoices",
      "de":"Rechnungen",
      "zh":"发票"
	},
    "key":"invoices",
    "type": "cfivdocument",
	"expanded":true,
	"hideempty":false,
	"showempty": true
  }
]

},
{

"title":"Edited by me",
"title_locales" : {
   "en":"Modified by me",

"de":"Von mir bearbeitet",

   "zh":"由我修改的"
},
"key" : "ModifiedByMe",
"condition" : "modifier=#CURRENTUSER#"

},
{

"title": "Editors",
"title_locales" : {
  "en":"Edited by",
  "de":"Geändert von",
  "zh":"修改的是"
},
"key": "Modifier",
"field": "modifiertitle"

},
{

"title" : "Modification range",
"title_locales" : {
  "en":"Modification range",
  "de":"Bearbeitungszeitraum",
  "zh":"修改范围"
},
"key" : "ModifiedRange",
"method" : "daterange",
"field" : "modified"

}
]

1 Answer

0 votes
ago by (3.3k points)

Hello,
The "showempty" property works only if your also provide a field property, to let the system know what to provide as child nodes for the data, that is not returned by the search. If the field is a catalogue - all catalogue entries from the system definition are included. If the field is a string - you can provide your own list - if the field is type, the system types are given out.

This sadly doesn't work for folders, like your 'documents' folder, that are view separation only folders that don't provide a type, field, or condition. So if the child folder elements are empty, they get hidden.

Currently the only workaround I can suggest, is to move the folder up one level and don't use the view separation folder 'documents'. Like in this example:

[
  {
      "key": "foto",
      "type": "passfoto",
      "title": "Passfoto",
      "expanded": true
  },
  {
      "key": "vertragsunterlagen",
      "type": "vertragsunterlagen",
      "title": "Vertragsunterlagen",
      "field": "vertragsunterlagen.typ",
      "expanded": true,
      "showempty": true
  },
  {
      "key":"others",
      "title" : "Andere dokumente",
      "condition":"type!='vertragsunterlagen' AND type!='passfoto'"
  }
]

Hope this helps.
br
Frank Klingebiel

...