what is the setting of your resultPage parameter of the tableOptions array?
I found while debugging my application that sometimes its something silly
like the JSON should be returning "true" instead of true (without quotes).
if the JSON is returning spaces in heading names, that will throw it off
too.
-----Original Message-----
From: Gerritjan Koekkoek
Sent: Tuesday, August 16, 2016 2:30 AM
To: XWiki Users
Subject: Re: [xwiki-users] LIvetable macro display objects on same page
Im on 6.4.7 (no things like terminal pages, but thanks, important as we will
migrate)
I think the key question is:
Is there any dependancies between what is put in the parameters of the
livable macro and the resulting JSON
These are the parameters I submit to the macro.
[personKey, observationType, measureNominal, withmilestone, byRole,
withtopic]
{personKey={type=hidden, filterable=false, sortable=false},
observationType={type=hidden, filterable=false, sortable=false},
measureNominal={type=number, filterable=false, sortable=false, size=5},
withmilestone={type=text, filterable=false, sortable=false, size=5},
byRole={type=text, filterable=false, sortable=false, size=5},
withtopic={type=hidden, filterable=false, sortable=false, size=10}}
{className=WaihonaCode.observationClass,
resultPage=Sandbox.testLivetableJSONGenerator,
translationPrefix=waihonapedia.scorecards.growth.weight., rowCount=10,
extraParams=&personkey=RaiKoekkoek&observationtype=weight&observationdoc=RaiKoekkoek_growthfeeding}
This is the generated JSON
{"totalrows": 2,"matchingtags" : {},"tags" :
[],"reqNo" :
1,"returned rows": 2,"offset": 1,
"rows": [{"doc_viewable" : true, "personKey" :
"RaiKoekkoek","measureNominal" :
"2","withmilestone" : "birth","withtopic" :
"growthfeeding","observationType" :
"weight","byRole" :
"dd"},{"doc_viewable" : true, "personKey" :
"RaiKoekkoek","measureNominal" :
"3","withmilestone" : "","withtopic" :
"growthfeeding","observationType" :
"weight","byRole" : "dd"}]
}
The live tabel does display the total rows and returned rows, but no data
Gerritjan Koekkoek
Vader van Rai Koekkoek (cdls) en voorzitter vereniging CdLS
Visit our website<http://www.cdlsworld.org>
Facebook<https://www.facebook.com/gerritjan.koekkoek>
email<gerritjan(a)cdlsworld.org>
________________________________
From: users <users-bounces(a)xwiki.org> on behalf of Daniel Ullfig
<dan.u(a)grmcompany.com>
Sent: 15 August 2016 17:51:04
To: XWiki Users
Subject: Re: [xwiki-users] LIvetable macro display objects on same page
is the page that creates the JSON marked as terminal (no children)? you
might have to add "WebHome" to the name of the page.
Dan
-----Original Message-----
From: Gerritjan Koekkoek
Sent: Saturday, August 13, 2016 12:56 AM
To: XWiki Users
Subject: Re: [xwiki-users] LIvetable macro display objects on same page
Thanks,
Understand the part of the Array. Think I have that working
When I call the JSON directly it generates the following:
{
"totalrows": 2,
"matchingtags" : {},
"tags" : [],
"reqNo" : "$numbertool.integer($request.reqNo)",
"returned rows": 2,
"offset": 1,
"rows": [{"doc_viewable" : true,
"personKey" : "RaiKoekkoek","odatetimestart" : "Tue Nov
02 11:00:44 CET
1999","odatetimeend" : "Fri Jul 15 11:03:11 CEST
2016","oyears" :
"","omonths" : "","measureInterval" :
"","measureNominal" :
"2","measureOrdinal" : "","measureRatio" :
"","withmilestone" :
"birth","withtopic" :
"growthfeeding","observationType" :
"weight","byRole"
: "dd",
"object_id" : "1",
"document_count" : "1",
"document_ref" :
"waihonapediaPrivat.RaiKoekkoek_growthfeeding"},{"doc_viewable" :
true,
"personKey" : "RaiKoekkoek","odatetimestart" : "Fri Dec
31 03:09:07 CET
1999","odatetimeend" : "","oyears" :
"","omonths" : "","measureInterval" :
"","measureNominal" : "3","measureOrdinal" :
"","measureRatio" :
"","withmilestone" : "","withtopic" :
"growthfeeding","observationType" :
"weight","byRole" : "dd",
"object_id" : "2",
"document_count" : "1",
"document_ref" : "waihonapediaPrivat.RaiKoekkoek_growthfeeding"}]
}
Which is good as the page holding the objects holds 2 objects that match
criteria and 2 other objects that do not match criteria.
Problem is that the table shows the Total rows but the records (table-rows)
are not showing
Is the JSON in the right format, what about doc_viewable?
Gerritjan Koekkoek
Vader van Rai Koekkoek (cdls) en voorzitter vereniging CdLS
Visit our website<http://www.cdlsworld.org>
Facebook<https://www.facebook.com/gerritjan.koekkoek>
email<gerritjan(a)cdlsworld.org>
________________________________
From: users <users-bounces(a)xwiki.org> on behalf of Daniel Ullfig
<dan.u(a)grmcompany.com>
Sent: 12 August 2016 22:43:40
To: XWiki Users
Subject: Re: [xwiki-users] LIvetable macro display objects on same page
you won't be able to use HQL because it will return a list of pages, all
pointing to the same page. A good starting point is the example given in the
Livetable Macro documentation. I used that as a starting point. You need to
read all the objects into an array using $doc.getObjects( 'myClass' ), where
myClass is the name of your xwiki object class.
Dan
-----Original Message-----
From: Gerritjan Koekkoek
Sent: Friday, August 12, 2016 8:47 AM
To: XWiki Users
Subject: Re: [xwiki-users] LIvetable macro display objects on same page
Yes, that's correct, thank you...
Is there a convenient way to generate the json for a set of objects of one
class on one page?
Gerritjan Koekkoek
Vader van Rai Koekkoek (cdls) en voorzitter vereniging CdLS
Visit our website<http://www.cdlsworld.org>
Facebook<https://www.facebook.com/gerritjan.koekkoek>
email<gerritjan(a)cdlsworld.org>
________________________________
From: users <users-bounces(a)xwiki.org> on behalf of Daniel Ullfig
<dan.u(a)grmcompany.com>
Sent: 12 August 2016 17:34:34
To: XWiki Users
Subject: Re: [xwiki-users] LIvetable macro display objects on same page
Are you attaching several objects of the same type to the page? In that
case, the standard livetable will not work. you will have to implement a
JSON page to return the data for the livetable.
Dan
-----Original Message-----
From: Gerritjan Koekkoek
Sent: Friday, August 12, 2016 5:32 AM
To: XWiki Users
Subject: [xwiki-users] LIvetable macro display objects on same page
Can the livable macro display objects that are on the same page ?
my use case looks to show the right number of records, but all the rows show
the data of the first object on the page.
{{velocity wiki=false}}
#set($myColumns = ["personKey","observationType", "doc.name"
,
"odatetimestart","measureNominal", "withmilestone",
"byRole", "withtopic",
"_actions"])
#set($myTableOptions = {
"className":"WaihonaCode.observationClass",
"translationPrefix" : "waihonapedia.scorecards.growth.",
"rowCount": 10,
"extraParams" :
"&personKey=RaiKoekkoek&observationType=weight&doc.name=RaiKoekkoek_growthfeeding"
} )
#set($columnsProperties = {
"personKey" : { "type" : "hidden",
"filterable":"false"},
"observationType" : { "type" : "hidden",
"filterable":"false"},
"doc.name" :{"type":"hidden",
"filterable":"false"},
"odatetimestart" : { "type" : "date",
"sortable":"false" ,
"filterable":"false", "size" : 5},
"measureNominal" : { "type" : "number" ,
"filterable":"false", "size" :
5},
"withmilestone" : {"type" : "text",
"filterable":"false" , "size" : 5},
"byRole" : { "type" : "text",
"filterable":"false" , "size" : 5},
"withtopic" : { "type" : "text",
"filterable":"false" , "size" : 10}
})
#livetable('growthTable' $myColumns $columnsProperties $myTableOptions)
{{/velocity}}
Gerritjan Koekkoek
Vader van Rai Koekkoek (cdls) en voorzitter vereniging CdLS
Visit our website<http://www.cdlsworld.org>
Facebook<https://www.facebook.com/gerritjan.koekkoek>
email<gerritjan(a)cdlsworld.org>
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users