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
DataTable - Dynamic Columns
-
- Information
-
Who is online
Users browsing this forum: No registered users and 30 guests