DataTable - Dynamic Columns

UI Components for JSF
Post Reply
Olly
Posts: 1
Joined: 13 Oct 2015, 09:31

13 Oct 2015, 11:04

Hi,
we create columns of a database dynamically in a DataTable.
If we read columns from on table it works. But we have follow construct and than it dosn't work.

We have a table PERSON with CONSTRAINT to a table ADRESSE. When we read the PERSON from the database (JPA) we get the object ADRESSE in the bean.

In the ManagedBean we define the columns for the DataTable:
private String[] columnPersAdr = {"nachname", "vorname", "email", "geburtsDatum", "handynummer", "dtoAdresse.wohnort"};

In the page we define the columns:

<p:columns value="#{partnerBeanDyn.columns}" var="column"
columnIndexVar="colIndex" sortBy="#{partners[column.property]}"
filterBy="#{partners[column.property]}">
<f:facet name="header">
<h:outputText value="#{column.header}" />
</f:facet>
<h:outputText value="#{partners[column.property]}">
</h:outputText>

</p:columns>


And now we get follow error:
The class 'de.wwk.partnerverwaltung.common.dto.PartnerDTO' does not have the property 'dtoAdresse.wohnort'.
But in the dtoAdresse there is a property "wohnort".


Can somebody tell me, how we can use properties from an object in an object?

Thanks
Olly

rick.souzaa
Posts: 2
Joined: 17 Sep 2015, 01:56

13 Oct 2015, 21:23

I have the same problem!

Rafaelfr1
Posts: 32
Joined: 09 Mar 2015, 16:03

22 Jul 2017, 14:42

Optimus Prime,

I have problems, I have tried in several ways and still can not solve.

Any answers to this problem? Is it possible to solve it?

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 30 guests