ICEfaces
  1. ICEfaces
  2. ICE-8577

focus is lost on the form on the first update

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Won't Fix
    • Affects Version/s: 3.1, EE-3.0.0.GA_P01, 3.2.BETA1
    • Fix Version/s: 3.3
    • Component/s: Bridge, Framework
    • Labels:
      None
    • Environment:
      All
    • Assignee Priority:
      P2
    • Workaround Description:
      Hide
      As a workaround the web application can be configured to use an index JSP page that redirects the browser to the JSF page (where this issue occurs). During the redirect the browser will acquire the session tracking cookie. The request for the JSF page will then have this cookie thus prompting the server to generate URLs in the markup without the jsessionid parameter. Because URL format does not change anymore between requests the server will not generate large updates which cause the focus lost problem.
      Show
      As a workaround the web application can be configured to use an index JSP page that redirects the browser to the JSF page (where this issue occurs). During the redirect the browser will acquire the session tracking cookie. The request for the JSF page will then have this cookie thus prompting the server to generate URLs in the markup without the jsessionid parameter. Because URL format does not change anymore between requests the server will not generate large updates which cause the focus lost problem.

      Description


      On the first update of an input element (through singleSubmit or f:ajax) the focus is lost. Setting the tabindex doesn't have any impact on this. Once this first update is made the focus and tabing works without any issues.

      A few things I noticed:
       - This can only be seen when first loading the app in a fresh browser instance. If the tab is closed and then the page is accessed again in a new tab, this isn't an issue. To re-test this the browser needs to be closed and then re-opened between tests.
       - Once the page is displayed initially, if I refresh the page without doing an update, this issue isn't seen.

        Issue Links

          Activity

          Hide
          Arran Mccullough added a comment - - edited

          Attached test case that shows this issue.

          Steps:

          • In a new browser instance open welcomeICEfaces.jsf
          • Focus into the first input field, enter in some text.
          • Hit the Tab key, focus is lost when it should be on the next input field.
          Show
          Arran Mccullough added a comment - - edited Attached test case that shows this issue. Steps: In a new browser instance open welcomeICEfaces.jsf Focus into the first input field, enter in some text. Hit the Tab key, focus is lost when it should be on the next input field.
          Hide
          Mircea Toma added a comment - - edited

          There's a larger update generated because the URLs contained by the forms have appended the jsessionid path parameter during first page load but they are missing when the first update is generated.

          Show
          Mircea Toma added a comment - - edited There's a larger update generated because the URLs contained by the forms have appended the jsessionid path parameter during first page load but they are missing when the first update is generated.
          Hide
          Mircea Toma added a comment - - edited

          Use document.activeElement property (supported now by ie7, ie8, ie9, safari, opera and firefox) to check if the focus really needs to be applied to an element. When the focus is already on the element that needs to receive focus ice.applyFocus function call will just ignore the request.

          Show
          Mircea Toma added a comment - - edited Use document.activeElement property (supported now by ie7, ie8, ie9, safari, opera and firefox) to check if the focus really needs to be applied to an element. When the focus is already on the element that needs to receive focus ice.applyFocus function call will just ignore the request.
          Hide
          Ken Fyten added a comment - - edited

          Reverted commit for this as it is causing the following regression behavior:
          New Regression:
          Showcase (Firefox 16/Tomcat 7):
          Manual Test Results:
          dateTimeEntry - Ajax Submit, Label Position, Indicator Text: after selecting new date in the popup calendar, the calendar closes and opens up again (not a PartialStateSavings specific issue).

          Show
          Ken Fyten added a comment - - edited Reverted commit for this as it is causing the following regression behavior: New Regression: Showcase (Firefox 16/Tomcat 7): Manual Test Results: dateTimeEntry - Ajax Submit, Label Position, Indicator Text: after selecting new date in the popup calendar, the calendar closes and opens up again (not a PartialStateSavings specific issue).
          Hide
          Mircea Toma added a comment - - edited

          This issue can be fixed if the attribute update generation in the DOM diff is enabled. Hopefully this approach will finally work well in the newer version of Mojarra.

          Show
          Mircea Toma added a comment - - edited This issue can be fixed if the attribute update generation in the DOM diff is enabled. Hopefully this approach will finally work well in the newer version of Mojarra.
          Hide
          Mircea Toma added a comment -

          Unfortunately updating attributes in IE doesn't always work. For example in showcase the "class" attributes on navigation links are not changed correctly.

          Show
          Mircea Toma added a comment - Unfortunately updating attributes in IE doesn't always work. For example in showcase the "class" attributes on navigation links are not changed correctly.
          Hide
          Mircea Toma added a comment - - edited

          ICE-8430 is now fixed. Running an application with org.icefaces.diffConfig=att should alleviate any focus related problems.

          Show
          Mircea Toma added a comment - - edited ICE-8430 is now fixed. Running an application with org.icefaces.diffConfig=att should alleviate any focus related problems.

            People

            • Assignee:
              Mircea Toma
              Reporter:
              Arran Mccullough
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: