I have a page that is using a liveData
macro that is displaying data from a liveTable
source in which one one of the columns has not been populated for a row. This is being displayed like
Is there a way to do this with the liveData macro?
I have a page that is using a liveData
macro that is displaying data from a liveTable
source in which one one of the columns has not been populated for a row. This is being displayed like
Is there a way to do this with the liveData macro?
Hello @bbergquist0930,
Can you share the liveData
macro configuration?
I’m sure there is an easy way around.
Though, there is probably an improvement to do on our side to provide a default placeholder (e.g., -
) when no valid translation can be found.
The app was build using Application In Minutes, so the source looks like
{{velocity}}
#set ($columnsProperties = {
'bannerList': {},
'name': {},
'role': {},
'phone': {},
'email': {},
'doc.date': {},
'doc.author': {"link":"author"},
'_actions': {"sortable":false,"filterable":false,"html":true,"actions":["edit","delete"]}
})
#set ($options = {
'className': 'Banners.Banner Contacts App.Code.Banner Contacts AppClass',
'translationPrefix': 'banner contacts app.livetable.',
'tagCloud': true,
'rowCount': 15,
'maxPages': 10,
'selectedColumn': 'bannerList',
'defaultOrder': 'asc'
})
#set ($columns = ['bannerList', 'name', 'role', 'phone', 'email', 'doc.date', 'doc.author', '_actions'])
#livetable('banner contacts app' $columns $columnsProperties $options)
{{/velocity}}
and the use of this using liveData
looks like
(((
{{liveData id="contact" properties="bannerList,name,role,phone,email" showPageSizeDropdown="false" source="liveTable" sourceParameters="className=Banners.Banner Contacts App.Code.Banner Contacts AppClass&bannerList=FL"}}
{
"meta": {
"propertyDescriptors": [
{
"id": "bannerList",
"visible": false,
"sortable": false,
"filterable": false
}
]
}
}
{{/liveData}}
)))
The app displays this in the original app with the liveTable
looks like
I think you are just missing translationPrefix=banner contacts app.livetable.
in the sourceParameters
of your Live Data.
That was the solution, but can you point me towards the translationPrefix
documentation link so that I can become less ignorant?
https://extensions.xwiki.org/xwiki/bin/view/Extension/Live%20Data%20Macro/#HLiveDataSources points to https://extensions.xwiki.org/xwiki/bin/view/Extension/Livetable%20Macro.
As the liveTable
source is a bridge to Live Table results, all Livetable parameters can be used in the sourceParameters
(as source parameters are parameters specific to a given source), including translationPrefix
.
Hope that helps.
Hello,
Sorry to dig out this older thread but I have the same issue.
I simply want to show objects of my manually created class (with the class editor) with the cool LiveData macro but by default empty values are filled with the ugly ${request.transprefix}emptyvalue
I don’t understand from the documentation how to disable the default translationPrefix parameter? Do I really have to create a custom LiveTable Page for my class just so I can filter out that ugly empty value?
My Live Data code is:
{{liveData limit="25" properties="dueDate,doc.title,Status,Beschreibung,Menge,NettopreisProdukt,GesamtNetto,Ansprechpartner,doc.location,doc.date, _actions" showPageSizeDropdown="false" sort="doc.title:asc" source="liveTable" sourceParameters="className=Anpassungen.Macro-Beschaffungsbedarfe.BeschaffungsbedarfeClass"}}
{
"meta": {
"propertyDescriptors": [
{
"id": "doc.title",
"name" : "Was?"
},
{
"id": "doc.creationDate",
"name" : "Erstellt am"
},
{
"id": "doc.date",
"name" : "geändert am"
},
{
"id": "doc.location",
"displayer": "html",
"sortable": false,
"filterable": false,
"visible": false
},
{
"id": "_actions",
"name": "Aktionen",
"sortable": false,
"filterable": false
}
]
}
}
{{/liveData}}
Screenshot:
What I achieved so far was to add &translationPrefix=
to the source of the Live Data not it only looks like this:
But is there an easy way to make empty values truly simply empty?