File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Problem with view datas in h:dataTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Problem with view datas in h:dataTable" Watch "Problem with view datas in h:dataTable" New topic
Author

Problem with view datas in h:dataTable

Charles Conneley
Greenhorn

Joined: Aug 13, 2010
Posts: 3
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.
Charles Conneley
Greenhorn

Joined: Aug 13, 2010
Posts: 3
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with view datas in h:dataTable