0
votes

I am trying to show a dataTable inside a tabView.

Currently my code in my xhtml looks as the following:

    <p:tabView id="tabView" value="#{volumeController.shownSeries}" var="serie" cache="false">
        <p:tab title="#{serie.name}">
            <p:dataTable value="#{volumeController.findVolumesForSeries(serie.id)}" var="volume">
                    <p:column>
                        <h:outputText value="#{volume.volumeNumber}"/>
                    </p:column>
                </p:dataTable>
            </p:tab>
        </p:tabView>

So, now my problem is, that I get the following error:

javax.el.PropertyNotFoundException: /Volume/list.xhtml @22,89 value="#{volume.volumeNumber}": The class 'at.kirin.entity.Series' does not have the property 'volumeNumber'.

The problem is, that this is my method in my volumeController:

public List<Volume> findVolumesForSeries(long id) {
    List<Volume> v = volumeFacade.getVolumesForSeries(id);
    return v;
}

So I return a list of volumes in my controller, but Glassfish interprets it as an list of series. I tried to show the values with the .toString() but it only shows the results of the .toString() of my series.

My Volume-Entity has a field "VolumeNumber" and the method in the controller gets called for every tab.

Where did I go wrong or is it a bug in primefaces? (I am using 4.0)

Greetings Kirin

1

1 Answers

0
votes

So, finally I found my error.

In my JPA-Query I returned the whole list as a List. Somehow it slipped through all of the assignments in my methods (see above 'findVolumesForSeries') and just threw the error in the userinterface.

This was the strangest error I have ever seen, but for everyone else who finds this problem: Check if your methods all return the right datatype - somehow Java messes up here.