• Post Reply Bookmark Topic Watch Topic
  • New Topic

datatable get items from a external index

 
Chris Ernst
Greenhorn
Posts: 28
MySQL Database Netbeans IDE Tomcat Server
  • 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
 
Tim Holloway
Bartender
Posts: 18408
58
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
Greenhorn
Posts: 28
MySQL Database Netbeans IDE Tomcat Server
  • 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
Greenhorn
Posts: 28
MySQL Database Netbeans IDE Tomcat Server
  • 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 :)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!