11 Replies Latest reply: Oct 22, 2006 2:25 PM by 153666 RSS

    JHS 10.1.3 Bugs when using several table-form on the same page as a form

    537426
      Hello,

      Let's say I have a form for the view object "persons" and on the same page I have a table-form "boss" which corresponds to a foreign key of the table "persons" also leading to table persons.

      When inserting or updating a row in "persons", everything is alright as long as I do not specifie a new value for the foreign key. When I specifie a new value for the foreign key (also when I delete the present value completely) and push the "save" button for the first time, the row is not saved but the table-form "boss" which lay on the same page is updated according to the new foreign key. Then, when I push the "save" button for the second time, the row is actualy saved to the database. So this is not too bad, because pushing two times "save" is a simple workaround. Jhs 10.1.2 had the same bahavior, except that an error message was visible on the oc4j console :

      java.lang.ArrayIndexOutOfBoundsException: 0
           at oracle.jbo.uicli.binding.JUCtrlRangeBinding$1.get(JUCtrlRangeBinding.java:155)
           at oracle.jheadstart.controller.strutsadf.action.JhsDataAction.processMultiRowUpdateModel(JhsDataAction.java:949)
           at oracle.jheadstart.controller.strutsadf.action.JhsStrutsUixLifecycle.processMultiRowUpdateModel(JhsStrutsUixLifecycle.java:180)
           at oracle.jheadstart.controller.strutsadf.action.JhsStrutsUixLifecycle.processUpdateModel(JhsStrutsUixLifecycle.java:147)
           at oracle.adf.controller.struts.actions.DataAction.processUpdateModel(DataAction.java:317)
           at oracle.jheadstart.controller.strutsadf.action.JhsDataAction.processUpdateModel(JhsDataAction.java:622)
           at oracle.adf.controller.struts.actions.DataAction.processUpdateModel(DataAction.java:508)
           at oracle.adf.controller.lifecycle.PageLifecycle.handleLifecycle(PageLifecycle.java:112)
           at oracle.adf.controller.struts.actions.StrutsUixLifecycle.handleLifecycle(StrutsUixLifecycle.java:70)
           at oracle.adf.controller.struts.actions.DataAction.handleLifecycle(DataAction.java:223)
           at oracle.jheadstart.controller.strutsadf.action.JhsDataAction.handleLifecycle(JhsDataAction.java:389)
           at oracle.adf.controller.struts.actions.DataAction.execute(DataAction.java:155)
           at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
           at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
           at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1485)
           at oracle.jheadstart.controller.strutsadf.JhsActionServlet.process(JhsActionServlet.java:127)
           at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:527)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
           at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
           at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
           at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
           at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:239)
           at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:20)
           at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:239)
           at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:20)
           at oracle.jheadstart.controller.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:172)
           at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:659)
           at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
           at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
           at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)
           at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)
           at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
           at java.lang.Thread.run(Thread.java:534)
      java.lang.ArrayIndexOutOfBoundsException: 0
           at oracle.jbo.uicli.binding.JUCtrlRangeBinding$1.get(JUCtrlRangeBinding.java:155)
           at oracle.jheadstart.controller.strutsadf.action.JhsDataAction.processMultiRowUpdateModel(JhsDataAction.java:949)
           at oracle.jheadstart.controller.strutsadf.action.JhsStrutsUixLifecycle.processMultiRowUpdateModel(JhsStrutsUixLifecycle.java:180)
           at oracle.jheadstart.controller.strutsadf.action.JhsStrutsUixLifecycle.processUpdateModel(JhsStrutsUixLifecycle.java:147)
           at oracle.adf.controller.struts.actions.DataAction.processUpdateModel(DataAction.java:317)
           at oracle.jheadstart.controller.strutsadf.action.JhsDataAction.processUpdateModel(JhsDataAction.java:622)
           at oracle.adf.controller.struts.actions.DataAction.processUpdateModel(DataAction.java:508)
           at oracle.adf.controller.lifecycle.PageLifecycle.handleLifecycle(PageLifecycle.java:112)
           at oracle.adf.controller.struts.actions.StrutsUixLifecycle.handleLifecycle(StrutsUixLifecycle.java:70)
           at oracle.adf.controller.struts.actions.DataAction.handleLifecycle(DataAction.java:223)
           at oracle.jheadstart.controller.strutsadf.action.JhsDataAction.handleLifecycle(JhsDataAction.java:389)
           at oracle.adf.controller.struts.actions.DataAction.execute(DataAction.java:155)
           at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
           at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
           at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1485)
           at oracle.jheadstart.controller.strutsadf.JhsActionServlet.process(JhsActionServlet.java:127)
           at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:527)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
           at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
           at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
           at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
           at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:239)
           at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:20)
           at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:239)
           at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:20)
           at oracle.jheadstart.controller.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:172)
           at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:659)
           at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
           at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
           at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)
           at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)
           at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
           at java.lang.Thread.run(Thread.java:534)


      This error does not occur when testing the bc4j alone.
        • 1. Re: JHS 10.1.3 Bugs when using several table-form on the same page as a for
          537426
          Another (little) bug is in the templates themself; let's say I have a table-form "telspersons" and another one "addressespersons" on the same page as my master form "persons".

          The tableFormHyperlinkItem templates looks like this :

          ...
          action="${JHS.facesConfigGenerator.addNavigationCase(${JHS.page.name}, "details", ${JHS.current.pageComponent.detailsPage.name})}"
          ...

          Which causes all the children table-form that are on the same page to fire the same action "details". It results in a strange behaviors : when pushing any children "details" button in the page, this always leads to the first child details page of the page.

          When replacing the previous row in the template by this one :

          action="${JHS.facesConfigGenerator.addNavigationCase(${JHS.page.name}, "details${JHS.current.pageComponent.detailsPage.name}", ${JHS.current.pageComponent.detailsPage.name})}"

          which makes all children to have their own "detailsNameOfChild" details action, then everything is fine.

          Hope it helps.

          Best regards,

          David
          • 2. Re: JHS 10.1.3 Bugs when using several table-form on the same page as a for
            Steven Davelaar-Oracle
            David,

            Thanks for reporting the error in the template for navigating to then detail page. We will fix this for the next release.

            Regarding your first issue, how did you generate this page? you have persons as master group, and boss as detail group, however the one-to-many is in the other direction, right? a boss can have one or more persons, and a a person has only one boss? If so, why do you have at able layout for boss when there is only ine boss? Or did I misunderstood your data model?

            Steven Davelaar,
            Jheadstart Team.
            • 3. Re: JHS 10.1.3 Bugs when using several table-form on the same page as a for
              537426
              Steven,

              The page was generated by JHeadstart, whith the child table-form "boss" having "same page" attribute set to true.

              You're right concerning the direction of the relationship. A person can only have one "boss". However, the reason why I am doing this is to have a very condensed report of who the boss is together with a link, on the same page as the base person. So that I can use the link if needed to edit the "boss", either by child details formular or by using DeepLink method to put the "boss" as the current person to edit. As I do not know by advance how many level of hierachie I will have, I did not want to have two forms on the same page and better was to have a link for the "boss". The simplest way of doing this with Jhs is to have a table-form as child group in the same page.

              Thanks for your interest in this issue,

              David
              • 4. Re: JHS 10.1.3 Bugs when using several table-form on the same page as a for
                153666
                David,

                You wrote:
                However, the reason why I am doing this is to have a very condensed report of who the boss is together with a link, on the same page as the base person. So that I can use the link if needed to edit the "boss".
                How about adding an "Edit Boss" link next to the field where the Boss can be changed for a person? Or, if the Boss field is read-only, changing that field into a link to edit the Boss?

                If you think that is a good idea, I can explain how to generate that.

                kind regards,
                Sandra
                • 5. Re: JHS 10.1.3 Bugs when using several table-form on the same page as a for
                  537426
                  Sandra,

                  Thanks for your reply. Unfortunately, the "boss id" in my master "persons" form page is not read only and that is part of the problem (because the issue arises when this particular value is updated).

                  There are two reasons why I prefer a table-form to a simple link : 1) with a table I can display some differentiated columns (for example name, lastname, town, country, ...) with their header for the boss and 2) more generally, the other children of my main form "persons" are also table-forms, so using one more table form keeps the right look-and-feel of the page and keeps things clearly separated.

                  Moreover, I don't know what will happen to a link if added to the form like you propose in case of the "boss id" value in the main form is updated. How to make the link be refreshed ? I think that is where the table-form solution should show its power, by handling the refresh. Ok, I know there is a "depends on" together with a "clear/refresh" options. But when I did try this, it looks like the dependant value was refreshed while typing the master value, which could lead to undesired behavior. I didn't try this in the case of a foreign key, although.

                  Anyway, if you have a working solution with a link for a foreign key, I am interested in learning more ... so don't hesitate.

                  David
                  • 6. Re: JHS 10.1.3 Bugs when using several table-form on the same page as a for
                    537426
                    Hello,

                    It seems I've a third bug when using several table-form on the same page as a form : two of the child table-form I use are VOs based on the same EO, just the WHERE clauses are mutually exclusive. When I insert a new row, the new row is systematically shown in both VOs even if it should not. Then when I query my page again, everything is fine.

                    NOTE: I did move this question to a new separated thread
                    • 7. Re: JHS 10.1.3 Bugs when using several table-form on the same page as a for
                      153666
                      David,

                      Please create a new thread in the forum for a new question.
                      Let's keep this thread for the issue of showing and editing the boss. I am working at that right now, and let you know when I have found something.

                      kind regards,
                      Sandra Muller
                      JHeadstart Team
                      Oracle Consulting
                      • 8. Re: JHS 10.1.3 Bugs when using several table-form on the same page as a for
                        153666
                        David,

                        On the JHeadstart Blog I posted an entry called Showing Parent Lookup Details with Edit Link, you can find it at http://blogs.oracle.com/jheadstart/2006/10/20#a94.

                        If you have a table with a composite primary key, you can apply the tips Steven gave in JHS 10.1.3 foreign key leading to the same table or no more rowkeystr to the solution proposed in the blog.

                        Hope this helps,
                        Sandra Muller
                        JHeadstart Team
                        Oracle Consulting
                        • 9. Re: JHS 10.1.3 Bugs when using several table-form on the same page as a for
                          153666
                          David,

                          I added a note at the end of the abovementioned post, to explain what alternative solution you have if the link goes to the same page.

                          kind regards, Sandra
                          • 10. Re: JHS 10.1.3 Bugs when using several table-form on the same page as a for
                            537426
                            Sandra,

                            Thanks a lot for your solution proposal and the for the nice blog article.

                            I tried your solution, but had few successes with it. Maybe it comes from my particular application.

                            Actually, I have some fields which I want to display for the manager that are calculated fields. When using outer join on the main query, even if those fields are set to "depends on" managerid, the calculated fields are not updated. Worse, when "depends on" is set and when I modifies the managerid (which is still visible and updatable in the main region of my form, whereas I can not see it in your example), I have the same bug as explain for the table-form solution, this is when I click the save button the first time, nothing is saved, and when I click the button for the second time the transaction finally commits.

                            It turns out that the only clean solution is to use a separated form on the same page instead of a table-form, with one of the fields (a calculated one in my case) using your useful formDeepLink custom template to display a link for editing the manager as the current employee.

                            Hope this will help other people. Now this part is working fine for me.

                            Best regards,

                            David
                            • 11. Re: JHS 10.1.3 Bugs when using several table-form on the same page as a for
                              153666
                              David,

                              One comment about your remark:
                              When using outer join on the main query, even if those fields are set to "depends on" managerid, the calculated fields are not updated.
                              This is standard ADF BC behavior. The "lookup attributes" are only refreshed because the ADF BC Entity Association automatically refreshes them from the lookup entity cache when the "foreign key" attribute is changed. This does not hold for calculated attributes, if you want to refresh those you have to explicitly program an executeQuery.

                              kind regards,
                              Sandra Muller
                              JHeadstart Team
                              Oracle Consulting