12 Replies Latest reply on Jul 1, 2013 8:33 PM by DanielFFM

    View in JSF


      Hey all,


      I created an View that makes a join on 2 diffrent tables.

      How I can add such an View as a DataControl? Or what is the normal way to provice the view information on a jsf page?


      Thanks and best Regards,


        • 1. Re: View in JSF
          Timo Hahn

          User, please tell us your jdev version.


          You created the View in the db or using adfbc? Anyway if the view is defined in the db you can add the view as ViewObject to the application module. If you defined the View as ViewObject in the application module its OK too. After you expose the view to the application modules data model it's accessible from the data control as any other view.



          • 2. Re: View in JSF

            I didnt mean any Database View. Isn't a view object needed to access several tables using joins from adf?


            Iam using jdev

            • 3. Re: View in JSF
              Timo Hahn

              It's on solution, however you can use a (materialized) view on the db too.


              As you've build the view object already you only need to add the view object to the application module data model. This make the view accessible from the data control.



              • 4. Re: View in JSF

                How i can do this? Right Click on my View?


                Just dropping my view to the DataControls leads me to an Application Error: "AdrPlzView is not a valid soruce for a data control". Does I need anything else expect my View?


                Is the view also useable for editing / adding data to a specific table?

                • 5. Re: View in JSF
                  Timo Hahn

                  Open the model project, open the application module you created there, select the data model tab on the left side of the dialog. On the left side you should see packages where one of them contains your VO, select it and shuffle it to the right side. This is it.

                  rebuild the model project and refresh the data control. There you should see the VO now.



                  • 6. Re: View in JSF

                    IDE screenshot:





                    How can i shuffle it to the right side? What I have to open on the right side?




                    • 7. Re: View in JSF
                      Timo Hahn

                      Daniel, your model project does not contain an application module. You only have entities, view objects and links.

                      To create an application module select the model folder, right click on it and select new. From the list select application module and follow the wizard.

                      The application module ids the holds the transaction and represents the data model, the VOs you expose to the client. From the application model you build the data control.

                      As you are new to adf I recommend that you check some tutorials which show how to build the model part of the application. The easiest way is to use the 'business components from tables' wizard, which allows you to create a compete model project from existing tables of a db. This model you extend with your business logic to implement your use cases.



                      • 8. Re: View in JSF

                        Does it make sense to make several ApplicationModules? For Example one for: Adresses, Empolyees, .. ?

                        • 9. Re: View in JSF
                          Timo Hahn

                          No, it's not that simple but you definitely don't need an application module for each entity. I recommend that you take the time and watch the video http://www.youtube.com/watch?v=toEuQvp73h8 this will help you understand.



                          • 10. Re: View in JSF

                            I will check that video out.


                            I accidently deleted my Project. (too fast clicking..) is there any solution to recover?

                            • 11. Re: View in JSF
                              Timo Hahn

                              This depends, check the file system if any of your files are still there. Jdev removes file only from it's memory (the project or workspace) so chances are that the files are still there. If not your only hope are operating system functions like recycle bin or undelete. Even better if you have used a source control software, which I doubt you did



                              • 12. Re: View in JSF

                                I didnt use source code control because currently it was just testing..


                                Well, I think i will recreate it after watching your video. I just added some menus..