ICEfaces
  1. ICEfaces
  2. ICE-6344

ACE: dateTimeEntry losing keyboard focus w/ "renderAsPopup=false" and "singleSubmit=true"

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0
    • Fix Version/s: 2.0.1
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      IF 2 Adv. Comps, ace-showcase sample app. FF 3.6 and Chrome 8

      Description

      When using the ace-showcase dateTimeEntry demo, with "renderAsPopup=false", the calendar loses the keyboard focus when any date or time selections are made. This occurs when singleSubmit=true (as it it hardcoded for this demo). The ice.se call seems to result in keyboard focus being lost.
       

        Issue Links

          Activity

          Hide
          yip.ng added a comment - - edited

          After overriding YUI calendar's link.blur() behavior AND commenting out ice.se(), keyboard focusing works as expected. See video at http://screencast.com/t/Fb2nwji7s.

          However, if we put ice.se() back in, focus is lost again. So ice.se() is the second source of the problem that needs to be fixed.

          Revision: 23742


          Modified : /icefaces2/trunk/icefaces/ace/component/resources/org.icefaces.component.datetimeentry/calendar.js

          Show
          yip.ng added a comment - - edited After overriding YUI calendar's link.blur() behavior AND commenting out ice.se(), keyboard focusing works as expected. See video at http://screencast.com/t/Fb2nwji7s . However, if we put ice.se() back in, focus is lost again. So ice.se() is the second source of the problem that needs to be fixed. Revision: 23742 Modified : /icefaces2/trunk/icefaces/ace/component/resources/org.icefaces.component.datetimeentry/calendar.js
          Hide
          Ken Fyten added a comment -

          Mircea, please review the latest code to see why the ice.se() call is losing focus in this case. If it's not an obvious fix we can discuss with Yip, etc.

          Show
          Ken Fyten added a comment - Mircea, please review the latest code to see why the ice.se() call is losing focus in this case. If it's not an obvious fix we can discuss with Yip, etc.
          Hide
          Mircea Toma added a comment - - edited

          After debugging the JS code I discovered that the call made to ice.component.calendar.updateProperties() function causes the focus to be lost. The function is called when the returned DOM update is applied, more precisely the script element containing the call to the function is evaluated.
          While debugging further I could see how the entire HTML table representing the calendar widget is removed/destroyed and the re-added to the document. The removal of the table containing the element owning the focus is obviously the cause of the problem. Commenting out the code that destroys the table seems to fix the issue (although I don't know with what implications):

          updateProperties: function(clientId, jsProps, jsfProps, events) {
          Event.onContentReady(clientId, function(){
          // console.log("jsProps =", JSON.stringify(jsProps, null, 4));
          // console.log("jsfProps =", JSON.stringify(jsfProps, null, 4));
          // logger.log("In updateProperties()");
          // logger.log("renderAsPopup = " + jsfProps.renderAsPopup);
          var context = ice.component.getJSContext(clientId);
          // if (context && context.isAttached()) {
          // var prevProps = lang.merge(context.getJSProps(), context.getJSFProps());
          // var currProps = lang.merge(jsProps, jsfProps);
          // for (var prop in currProps)

          { //// console.log(prop); // if (!lang.hasOwnProperty(currProps, prop)) continue; // if (currProps[prop] == prevProps[prop]) continue; // context.getComponent().destroy(); // document.getElementById(clientId)['JSContext'] = null; // JSContext[clientId] = null; // break; // }

          // }
          ice.component.updateProperties(clientId, jsProps, jsfProps, events, this);
          }, this, true);
          }

          Show
          Mircea Toma added a comment - - edited After debugging the JS code I discovered that the call made to ice.component.calendar.updateProperties() function causes the focus to be lost. The function is called when the returned DOM update is applied, more precisely the script element containing the call to the function is evaluated. While debugging further I could see how the entire HTML table representing the calendar widget is removed/destroyed and the re-added to the document. The removal of the table containing the element owning the focus is obviously the cause of the problem. Commenting out the code that destroys the table seems to fix the issue (although I don't know with what implications): updateProperties: function(clientId, jsProps, jsfProps, events) { Event.onContentReady(clientId, function(){ // console.log("jsProps =", JSON.stringify(jsProps, null, 4)); // console.log("jsfProps =", JSON.stringify(jsfProps, null, 4)); // logger.log("In updateProperties()"); // logger.log("renderAsPopup = " + jsfProps.renderAsPopup); var context = ice.component.getJSContext(clientId); // if (context && context.isAttached()) { // var prevProps = lang.merge(context.getJSProps(), context.getJSFProps()); // var currProps = lang.merge(jsProps, jsfProps); // for (var prop in currProps) { //// console.log(prop); // if (!lang.hasOwnProperty(currProps, prop)) continue; // if (currProps[prop] == prevProps[prop]) continue; // context.getComponent().destroy(); // document.getElementById(clientId)['JSContext'] = null; // JSContext[clientId] = null; // break; // } // } ice.component.updateProperties(clientId, jsProps, jsfProps, events, this); }, this, true); }
          Hide
          Mircea Toma added a comment - - edited

          The time selection works fine because in the DOM update received there's also an 'eval' command that applies focus back on the element submitting the time, namely the select element.

          Show
          Mircea Toma added a comment - - edited The time selection works fine because in the DOM update received there's also an 'eval' command that applies focus back on the element submitting the time, namely the select element.
          Hide
          yip.ng added a comment -

          See comments in ICE-6466.

          Revision: 23816


          Modified : /icefaces2/trunk/icefaces/ace/component/resources/org.icefaces.component.datetimeentry/calendar.js
          Modified : /icefaces2/trunk/icefaces/ace/component/src/org/icefaces/component/datetimeentry/DateTimeEntryRenderer.java

          Show
          yip.ng added a comment - See comments in ICE-6466 . Revision: 23816 Modified : /icefaces2/trunk/icefaces/ace/component/resources/org.icefaces.component.datetimeentry/calendar.js Modified : /icefaces2/trunk/icefaces/ace/component/src/org/icefaces/component/datetimeentry/DateTimeEntryRenderer.java

            People

            • Assignee:
              yip.ng
              Reporter:
              Ken Fyten
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: