Details

    • Type: Bug Fix
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.5
    • Component/s: Development
    • Security Level: Public (Public: Anyone can view)
    • Labels:
      None
    • Rice Module:
      KRAD
    • KRAD Feature Area:
      UIF Component
    • Sprint:
      Core 2.5.0-m3 Sprint 2, Core 2.5.0-m4 Sprint 1, Core 2.5.0-m4 Sprint 2
    • KAI Review Status:
      Not Required
    • KTI Review Status:
      Not Required
    • Code Review Status:
      Not Required
    • Include in Release Notes?:
      Yes

      Description

      Focus on and jump to is not working correctly now, in addition, there are some config improvements we need to make.

      First if you set a focusId for an action component, focus is not set when a refresh occurs. I believe this is due to how the performFocusAndJumpTo method is being called from the page load event:

      <@krad.script value="jQuery(document).on(kradVariables.PAGE_LOAD_EVENT, function(){
      performFocusAndJumpTo($

      {KualiForm.view.currentPage.autoFocus?string}

      , true, true, '$

      {KualiForm.focusId!}

      ',
      '$

      {KualiForm.jumpToId!}

      ', '$

      {KualiForm.jumpToName!}

      ');
      });" component=KualiForm.view.currentPage/>

      Other problems include:

      1) Setting focus id could override focus set when there are errors

      I purpose we modify the implementation as follows:

      For view and page refreshes, add the focusId and jumpTo as data attribute of the page. Note this can be done in PageGroup and should only be done if there is a value in the form property. Also if autoFocus is true, add a data attribute to the page.

      For component refreshes, add focusId and jumpTo to the component wrapper div (look at uifRender.ftl).

      Another thing I have noticed. When the default jumpTo is the action, the scroll puts the action at the top of the viewport. It would be better if we can position the action at the bottom of the viewport I think.

      Create a new method for handling focus and jump. This should encapsulate all logic (of course can use helper methods), but should have logic for validation focusing and other cases. Invoke this method from document ready, page setup, and update component, passing in the data attributes (if found).

      Create demos for this functionality in General Features. Should test the various focus setting and jump settings.

        Attachments

          Activity

          Hide
          jkneal Jerry Neal (Inactive) added a comment -

          Sona,

          Are you currently working on this? If so, we should touch base sometime.

          Jerry

          Show
          jkneal Jerry Neal (Inactive) added a comment - Sona, Are you currently working on this? If so, we should touch base sometime. Jerry
          Hide
          jkneal Jerry Neal (Inactive) added a comment -

          We also want to review the defaults we are setting. Including defaulting of jump to on actions. Most of the time, this gives undesired results. We can remove the default, and require them to set the jump id when needed. Let's review all the options for focus and jump, and our defaults as part of this.

          Show
          jkneal Jerry Neal (Inactive) added a comment - We also want to review the defaults we are setting. Including defaulting of jump to on actions. Most of the time, this gives undesired results. We can remove the default, and require them to set the jump id when needed. Let's review all the options for focus and jump, and our defaults as part of this.
          Hide
          sonam Sona Sona (Inactive) added a comment -

          Jerry
          I haven't yet started working on this jira. Hope to start looking into it later today. Let me know when you would like to talk more about it.

          Show
          sonam Sona Sona (Inactive) added a comment - Jerry I haven't yet started working on this jira. Hope to start looking into it later today. Let me know when you would like to talk more about it.
          Show
          sonam Sona Sona (Inactive) added a comment - https://docs.google.com/a/kuali.org/document/d/1w17SCMM4ZP8J2DSZAP8DHvrtq1uVH6r_jFCzfFfbun4/edit# Link to the current analysis document
          Hide
          sonam Sona Sona (Inactive) added a comment -

          Hi Jerry,
          I have made the changes for focus under various conditions and checked it in with examples in General Features. Now focusId and JumpTo are read as data attributes and we do not need to add the script in the ftls. I still have some questions on JumpTo

          1. In the Jira https://jira.kuali.org/browse/KULRICE-12549
          it mentions to focus the view port to the bottom when an action is clicked, while in the google doc you mention not to set jumpTo the action. What should I be doing?

          2. In case of focus if none is specified, the default is the FIRST_INPUT. I am assuming for jumpTo the default will be TOP. If this is the case then for item 1 for every action click we will just jump to the top of the page.

          3 In the jira it says, "Create a new method for handling focus and jump. This should encapsulate all logic (of course can use helper methods), but should have logic for validation focusing and other cases. Invoke this method from document ready, page setup, and update component, passing in the data attributes (if found)."

          I am not sure I understand what this means? I am assuming this is talking about a function in JS and I already see a function perfomFocusAndJumpTo which gets invoked by document ready, page setup and update component with values from data attributes. What validations need to be performed besides checking if the component to focus is present? Are you talking about server messages. If so I have added logic so that the focus is on the first validation summary link. If not could you elaborate a little bit more.

          Thanks,
          -Sona

          Hi Sona,

          Great! Would you mind to create a code review? Here are my responses to your questions (also copying Brian for his input):

          1) Not set jumpTo anymore for the action

          2) I believe the default focus for FIRST_INPUT should only be on initial view load. Did we state to set that as the default for all actions? I was thinking for actions the default was NEXT_INPUT, instead of collection line actions

          3) I think this was just a general comment to consolidate the logic (the validation message focusing was one piece). Once I see the new code I might have some further suggestions for organizing.

          Thanks!
          Jerry

          Show
          sonam Sona Sona (Inactive) added a comment - Hi Jerry, I have made the changes for focus under various conditions and checked it in with examples in General Features. Now focusId and JumpTo are read as data attributes and we do not need to add the script in the ftls. I still have some questions on JumpTo 1. In the Jira https://jira.kuali.org/browse/KULRICE-12549 it mentions to focus the view port to the bottom when an action is clicked, while in the google doc you mention not to set jumpTo the action. What should I be doing? 2. In case of focus if none is specified, the default is the FIRST_INPUT. I am assuming for jumpTo the default will be TOP. If this is the case then for item 1 for every action click we will just jump to the top of the page. 3 In the jira it says, "Create a new method for handling focus and jump. This should encapsulate all logic (of course can use helper methods), but should have logic for validation focusing and other cases. Invoke this method from document ready, page setup, and update component, passing in the data attributes (if found)." I am not sure I understand what this means? I am assuming this is talking about a function in JS and I already see a function perfomFocusAndJumpTo which gets invoked by document ready, page setup and update component with values from data attributes. What validations need to be performed besides checking if the component to focus is present? Are you talking about server messages. If so I have added logic so that the focus is on the first validation summary link. If not could you elaborate a little bit more. Thanks, -Sona Hi Sona, Great! Would you mind to create a code review? Here are my responses to your questions (also copying Brian for his input): 1) Not set jumpTo anymore for the action 2) I believe the default focus for FIRST_INPUT should only be on initial view load. Did we state to set that as the default for all actions? I was thinking for actions the default was NEXT_INPUT, instead of collection line actions 3) I think this was just a general comment to consolidate the logic (the validation message focusing was one piece). Once I see the new code I might have some further suggestions for organizing. Thanks! Jerry
          Hide
          kbtaylor Kristina Taylor (Inactive) added a comment -

          Sona has created https://fisheye.kuali.org/cru/rice-425 for this.

          Show
          kbtaylor Kristina Taylor (Inactive) added a comment - Sona has created https://fisheye.kuali.org/cru/rice-425 for this.

            People

            • Assignee:
              kbtaylor Kristina Taylor (Inactive)
              Reporter:
              jkneal Jerry Neal (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 3 days
                3d
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 days Time Not Required
                2d