I am using primeface in this project. I have a database with orders, order details and customers. The index page displays the order details and I click on one of the orders I want the customer details of that order to be displayed. But right now when I click on an order the dialog box that appears is empty. I'm not sure if the problem is with the jsf for the customer class.
You should integrate logging into your application, which can be turned on or off at runtime, or set to different Logger level, depending on what you want to see. For example, you should output to log the result set from your ResultSet rs = stmt.executeQuery("Select * from customers"); call. At this point, you do not know if you are getting any rows returned at all, or if there is an SQLErrorCode.
Karen Wilson wrote:yes the query select * from customers works, i was able to display the customer information on a different page. so problem must be with jsf code
what is the difference between value and target? I have them set to the same thing. Could that be a problem?
Logging the database call was just one example. You would also log the returns from all the rs.getStrings and new Customers etc. BTW - you'll notice substantial memory leaks if you leave the code like this. If you don't like logging, try the debugger.
Dialog boxes in JSF are constructed - and initialized - as invisible objects when the page is first rendered. To populate them with data for a specific row edit, you need an AJAX method that will update the properties of your orderDialog bean with the values that you want to edit as part of the "show()" logic. The exact sequence, then is:
1. Call AJAX listener action method on click of the editing button
2. . Determine the row that you want the dialog to edit (you can use the currentRow DataModel method to get that easily).
3. . Copy the data row values to the orderDialog bean (Model)
4. . Return from the AJAX listener
5. render the updated dialog based on the updated Model
6. show the actual dialog UI
Sometimes the only way things ever got fixed is because people became uncomfortable.
I am not updating anything in the database. I just want to display the customer details from the order that was selected.
I know the problem isn't with the sql query because i tested that in the sql manager and it worked so problem is in jsf page