Forums Register Login

Problem with view datas in h:dataTable

+Pie Number of slices to send: Send
Hi All,
I have small problem with view datas in h:dataTable item. I have native query which is working properly in database and in java:



The method in EJB returns a List of elements. This method looks like this:



I want to show result of this query in dataTableItem, but I don`t know how to get to this values. I tried to do something like this (FCP is the method in JSF ManagedBean that returns mentioned list):



but this shows me only references as the result in table.

FCP method in JSF ManagedBean looks like this:



This solution is working properly when I have a query like this:

, with one SUM element.

Then correct datas are in the table and there is no problem. My question is: how to get datas, no references from the result list when I have two or more SUM elements in a query?

I tried use code like this:



but then I have an EJB exception: there is no properties like first_class_price and second_class_price.
I tried to change the query for this:



and then in JSF I used a code like this:



but I have the same EJB exception tkat properties p1 and p2 doesn`t exists .

I am new in Java EE and I can`t handle with this. Maybe there is another way to solve my problem? Maybe I shouldn`t use h:dataTableItem?

Thanks for your replies.
+Pie Number of slices to send: Send
Hi again, I have just solved my problem. Maybe it will be helpfull for somebody:

Code from SessionBean:



Code from JSF ManagedBean:



Code from JSF page:


Greetings.
If you want to look young and thin, hang around old, fat people. Or this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1960 times.
Similar Threads
dataTable in JSF
JSF datatable doubt
Input row select on data table does not get called
How to pass JSF inputText & outputText value into javascript code ?
Setting up a JSF project with data tables
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 15, 2024 23:53:36.