This week's book giveaway is in the Artificial Intelligence forum.
We're giving away four copies of Pragmatic AI and have Noah Gift on-line!
See this thread for details.
Win a copy of Pragmatic AI this week in the Artificial Intelligence 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

datatable get items from a external index  RSS feed

 
Ranch Hand
Posts: 50
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Folks.

I want to show in a Dialog an entry from a result set called table A. In this selected row is a foreign key for an other table called B.
now I want to show for the one row from A all results with the same ID from table B in the dialog.

when I used the join command in my SQL, then I get a lot of rows and this is not what i want!

There is a table with devices and a table reserved with a foreign key from devices.
In the devices is one entry and in the reserved 1 or more (dependet from the reserve) entry's.

Now i want to show ONE device in a Dialog and for this device i want to show all entrys from the reserved table for THIS device.


cheers chris
 
Bartender
Posts: 19673
92
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Before you get into dialogs, I recommend that you figure out how to do this on a regular webpage. Dialogs are not part of core JSF and the third-party JSF tag libraries tend to be a little tricky to work with when it comes to dialogs.

If you just want all the "part Bs" for a single row in "table A", a database join isn't required. Just get the "part B" key value and use it to do a simple table query of the "part B" table, then use the returned rows as a DataModel for the JSF dataTable control.
 
Chris Ernst
Ranch Hand
Posts: 50
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so I only need to recive in my bean the ID and get a select where id .... is.

then I have to search for the commandbutton Funktion to send the id to my bean from the JSF page
 
Chris Ernst
Ranch Hand
Posts: 50
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
haha tschaka ;)

problem solved :D

I called the method by the wrong values... now it works :)
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!