ICEfaces
  1. ICEfaces
  2. ICE-6340

ice.se causes focus to be lost

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-Beta2
    • Fix Version/s: 2.0.0
    • Component/s: None
    • Labels:
      None
    • Environment:
      ICEfaces

      Description


      ice.se (singleSubmitExecuteThis) causes focus to be lost when used with compat and h: components.

      Using the singleSubmit variant of component-showcase:

      icefaces2/branches/ice-6178/

      Choose the selection demo. Observe that focus is lost when any of the "select" items are selected.

        Activity

        Hide
        Ted Goddard added a comment -

        Modifying application.js to use the following allows focus to be retained in component-showcase:

        jsf.ajax.request(element, event,

        {execute: element.id, render: "@all"}

        );
        // ice.se(e, element);

        The root cause of loss of focus appears to be the following in submit.js:

        //move element from its original place into the single submit form
        form.appendChild(element);

        Moving the element that is currently focused by the user is likely the source of the problem. Using innerHtml may be an option for cloning the element if DOM APIs are not suitable.

        Show
        Ted Goddard added a comment - Modifying application.js to use the following allows focus to be retained in component-showcase: jsf.ajax.request(element, event, {execute: element.id, render: "@all"} ); // ice.se(e, element); The root cause of loss of focus appears to be the following in submit.js: //move element from its original place into the single submit form form.appendChild(element); Moving the element that is currently focused by the user is likely the source of the problem. Using innerHtml may be an option for cloning the element if DOM APIs are not suitable.
        Hide
        Ted Goddard added a comment -

        namespace.enableSingleSubmit also contains

        ice.setFocus(null);

        in an attempt to prevent the focus from being changed by the server when the page updates are received. (The user may already have changed focus by this time.) Removing this line results in focus retention on unintended elements.

        Show
        Ted Goddard added a comment - namespace.enableSingleSubmit also contains ice.setFocus(null); in an attempt to prevent the focus from being changed by the server when the page updates are received. (The user may already have changed focus by this time.) Removing this line results in focus retention on unintended elements.
        Hide
        Mircea Toma added a comment -

        Using innerHTML is not an option because the entire element (with its attribute) not only its content needs to be copied into the hidden form.

        Show
        Mircea Toma added a comment - Using innerHTML is not an option because the entire element (with its attribute) not only its content needs to be copied into the hidden form.
        Hide
        Mircea Toma added a comment -

        Changed the single submit code to clone the submitting node into the hidden form instead of moving it in temporarely. Also, while cloning, the element specific state (for checkboxes, radio buttons and selects) is copied programatically to fix IE's cloning issues (see reference in ICE-5731 ).

        Show
        Mircea Toma added a comment - Changed the single submit code to clone the submitting node into the hidden form instead of moving it in temporarely. Also, while cloning, the element specific state (for checkboxes, radio buttons and selects) is copied programatically to fix IE's cloning issues (see reference in ICE-5731 ).
        Hide
        Mircea Toma added a comment - - edited

        Used 'Date Time Entry' in ace-showcase for testing since all the components included in the page use ice.se for submitting the data.

        Show
        Mircea Toma added a comment - - edited Used 'Date Time Entry' in ace-showcase for testing since all the components included in the page use ice.se for submitting the data.
        Hide
        Ted Goddard added a comment -

        Multiple selections and checkboxes are not being submitted with all values.

        Show
        Ted Goddard added a comment - Multiple selections and checkboxes are not being submitted with all values.

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Ted Goddard
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: