• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with view datas in h:dataTable

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic