Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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.
 
Don't touch me. And dont' touch this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic