1 2 Previous Next 24 Replies Latest reply on Aug 3, 2017 7:15 AM by Robert Šajina Go to original post
      • 15. Re: Set Focus on CreateINsert row in ADF Table
        Timo Hahn

        Muhammad.Rizwan have you tried this with the sample application? Did this work?

         

        Timo

        • 16. Re: Set Focus on CreateINsert row in ADF Table
          Muhammad.Rizwan

          Hi Timo,

           

          No, I haven't tried this but had similar issues in the past and one of the work arounds did the trick for me.

          • 17. Re: Set Focus on CreateINsert row in ADF Table
            Jonas de Graaff (CACI)

            Umer,

             

            I ran into the same issue. The fact that your TAB-key is not working anymore is caused by the fact that the table is not in 'Action mode'. Since 12c, there is a whole new keyboard and focus management that is based in the accessibility requirements from the WAG 2.0 guidelines. Please read the 'editmode' section of the following documentation to understand how it should work according to Oracle:

             

            http://jdevadf.oracle.com/adf-richclient-demo/docs/tagdoc/af_table.html

             

            This leaves the functional requirement that you want to place the cursor in the new row automatically. I've filed a SR with this question and I'm currently waiting for the answer.

             

            Regards,

             

            Jonas

            • 18. Re: Set Focus on CreateINsert row in ADF Table
              Om Pathak

              Hi Jonas,

               

              We too are facing the similar issue as reported in this thread.

              Did you get a reply for the Oracle SR?

               

              Regards,

              Om

              • 19. Re: Set Focus on CreateINsert row in ADF Table
                Gijith

                Dea Umer and , Muhammad.Rizwan Timo Hahn managed BEAN

                 

                 

                I am also facing the same problem with Jdeveloper Version 12.2.1.1.0. This problem i am facing from version 11gR1 & 11gR2. Now its in 12C also.

                 

                Did you get any solution or SR for this issue. ?

                 

                I think this a birth defect of ADF table. Because i am adding an additional point here. That is even though you are not using any custom Java script in adf table this issue of TAB out will happen if any column in the table have component with autosubmit=true.

                 

                Autosubmit is a property of all ADF component. So by setting it to true why ADF table TAB out behaves strange? It should work properly right ? But till now there is no solution or workaround for this. That is why i mentioned it as a birth defect of ADF Table. The same mistake may be propagating to every version of ADF and Oracle may be unaware or still standing surprised upon this in all these years..

                 

                All Gruru's in this forum have no solution for this yet.  All are telling to use Editable form instead of ADF table. Then why they provided Editable Table component ?. Just for seeing in component list ? So, i think ADF Era is gonna end.

                 

                If any Guru's have contradiction then just say us the solution.

                 

                Just for an example . You can download a sample application from https://technology.amis.nl/2016/03/15/navigating-adf-editable-table-arrow-keys/  ( This is the blog just i got with a sample now) or you can create a simple page with ADF table . And then give auto submit to any of the column and see what i said.

                 

                Enjoy.

                 

                Regards,

                Gijith.

                • 20. Re: Set Focus on CreateINsert row in ADF Table
                  Umer Farooq

                  Hi John,

                   

                  Did you got the reply.

                  • 21. Re: Set Focus on CreateINsert row in ADF Table
                    William Perez Soto-Oracle

                    As Jonas indicated, TAB key navigation in 12c changed. Behavior change to meet WCAG 2.0 and now navigating within the table cells by TAB constitute a trap, hence is disabled by default.

                     

                    Workaround in 12c is to set the focus on the cell, then end-user press F2 or ENTER key, this causes the table to enter Actionable Mode and focus moves from the cell to the input field, and while in Actionable Mode when user press TAB, now the focus will move to the next input field.

                    • 22. Re: Set Focus on CreateINsert row in ADF Table
                      Robert Šajina

                      Hi,
                      So the solution is pretty simple

                      The procedure is the same as explained here: Andrejus Baranovskis Blog: Improving ADF UI Table CRUD Functionality with Auto Focus

                      We have found that the solution is to expand the javascript code suggested by Andrejus, so the function for focusing row and field would look like:

                       

                      function setFocusByComponentId (id){
                            
                                  var input = AdfPage.PAGE.findComponentByAbsoluteId(id);
                                  var table = input.getParent();
                                
                                  input.focus();
                                
                                  setTimeout(function(){
                                      table.simulateSelectRows(table.getActiveRowKey().toString(),'');
                                   },0);        
                      }
                      
                      • 23. Re: Set Focus on CreateINsert row in ADF Table
                        Umer Farooq

                        Dear ,

                         

                        Thanks for reply but following javascript script throwing exception.

                         

                        TypeError: table.getActiveRowKey(...) is null

                         

                        Can u please check your browser version. I am using firefox. Thanks

                         

                        Umer Farooq

                        • 24. Re: Set Focus on CreateINsert row in ADF Table
                          Robert Šajina

                          The table is not getting the right row as active. You have to set active row in java, and than you would be able to set focus on current row.
                          It has nothing to do with Browser type.
                          In our application we are programmaticlly adding row and setting the current active row.
                          If you were using Andrejus sample application, there he is executing operation binding, so ADF is doing the insert.
                          So in order this to work you just need to add the following line in the for loop:

                           

                          table.setActiveRowKey(selectedRowKey);
                          

                           

                          So the function in GenericListener is next:

                           

                              public void genericActionListener(ActionEvent actionEvent) {
                                  UIComponent comp = actionEvent.getComponent();
                                  String actionName = (String)comp.getAttributes().get("actionName");
                                  
                                  OperationBinding ob = ADFUtils.findOperation(actionName);
                                  if (ob != null) {
                                      ob.execute();
                                  }
                                  
                                  RichTable table = this.getRichTableBinding(comp);
                                  if (table != null) {
                                      RowKeySet selection = table.getSelectedRowKeys();
                                      for (Object selectedRowKey : selection) {
                                          String focusComponentTarget = (String)comp.getAttributes().get("focusComponentTarget");
                          
                                          table.setActiveRowKey(selectedRowKey);//this is added to make selection
                          
                                          FacesContext context = FacesContext.getCurrentInstance();
                                          String rowId = table.getClientRowKeyManager().getClientRowKey(context, table, selectedRowKey);
                                          String tableClientId = table.getClientId(context);
                                          String focusId = tableClientId + ":" + rowId + ":" + focusComponentTarget;
                                          
                                          LOGGER.finest("Focus ID: " + focusId);
                                          
                                          ExtendedRenderKitService erks = Service.getService(context.getRenderKit(), ExtendedRenderKitService.class);
                                          erks.addScript(context, "setFocusByComponentId('" + focusId + "')");
                                      }
                                  }
                              }
                              
                          
                          

                           

                           

                          For us, this works flawlessly with clickToEdit property on table(editingMode). But it should be working on editAll, although its now fully tested.

                          1 2 Previous Next