camiloqp
camiloqp

Reputation: 1140

p: datatable general question

I am trying to show on a webpage different tables corresponding to different entity records. Say record types X,Y and Z. According to a search perfomed on the webpage the tables to be shown should be displayed accordingly and each of them have their own particular columns. Therefore I am trying the following as a simplified code snippet:

<p:dataTable id="recordTable"
             binding="#{searchBean.resultTable}"
             value="#{searchBean.resultListx}"
             var="currentRecord"
             paginator="true"
             rows="10"/>

Value corresponds to the list of records (X,Y or Z) and Binding corresponds to a pre-made DataTable I make on my backing bean which assembles columns accordingly to the type of record (X,Y or Z)

Question: Is this the correct way to do it? If not, can anyone light me up with an idea to make this exercise, the example is simplified to 3 types of entities, however on my practical case I can end up with the case of having to show up to 20 different tables of different types of records.

Most appreciated any tips, observations and feedback.

Thanks

Upvotes: 1

Views: 579

Answers (1)

BalusC
BalusC

Reputation: 1109635

Use <p:columns>.

Upvotes: 1

Related Questions