Render Pivot4J model in Primefaces

71 views
Skip to first unread message

Andy C

unread,
Jun 10, 2016, 7:51:58 AM6/10/16
to pivot4j-list
Hi

Have looked at the documentation which gives brief details on how to build a quick static cube and then renders to HTML for display - http://www.pivot4j.org/usage.html.

I have also looked at the Pivot4J Analytics application but that is quite some work to debug.

What I would like is a simple example of how you render the model to a PrimeFaces component - dataTable or Panelgrid (not sure which is best)??

Thanks

Andrew

Xavier Cho

unread,
Jun 13, 2016, 5:05:15 AM6/13/16
to pivot4j-list
Hi,

If you intend to integrate Pivot4J with PrimeFaces, I think the Analytics project is still the best reference to look for. The most important part of the project is PivotComponentBuilder class, which is an implementation of TableRenderCallback, so it could be the best start point.

In fact, the concept of the TableRenderCallback is very simple and that is something like "I'll tell you when a new row, or a cell, etc is needed, and you'll build them in whatever way you want".

So, once you get familiar with the concept, I believe it would be a trivial matter to adapt it to render the data in either a dataTable or panelGrid component. As you can see from PivotComponentBuilder example. all you have to do is instantiate a new row or a cell inside each callback and add it to the component using PrimeFaces/JSF's API.

If you need help in writing your own renderer, please give me some specifics about your code and I'll try to help as best as I could.

Cheers,
Xavier

2016년 6월 10일 금요일 오후 8시 51분 58초 UTC+9, CraterFiles 님의 말:
Reply all
Reply to author
Forward
0 new messages