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
          Ken Fyten added a comment - - edited

          Note that this issue doesn't seem to occur when "renderAsPopup=true" and the same types of date or time selections are made in the popup calendar, with the exception that in Chrome if you select a date it still loses focus, but not if yo select a time.

          Show
          Ken Fyten added a comment - - edited Note that this issue doesn't seem to occur when "renderAsPopup=true" and the same types of date or time selections are made in the popup calendar, with the exception that in Chrome if you select a date it still loses focus, but not if yo select a time.
          Hide
          yip.ng added a comment - - edited

          In popup, submit occurs only when OK button is clicked. Nothing else is done by us when a date is selected. The date select event is all handled by YUI calendar.

          Show
          yip.ng added a comment - - edited In popup, submit occurs only when OK button is clicked. Nothing else is done by us when a date is selected. The date select event is all handled by YUI calendar.
          Hide
          yip.ng added a comment -

          Single submit doesn't seem to work anymore?

          Show
          yip.ng added a comment - Single submit doesn't seem to work anymore?
          Hide
          yip.ng added a comment -

          Single submit working again after svn update.

          Show
          yip.ng added a comment - Single submit working again after svn update.
          Hide
          yip.ng added a comment -

          After setting single submit to false, selecting a date still loses focus, but in a different way. (Tabbing seems to set focus at a random link within calendar, instead of going outside calendar.) Selecting a time field doesn't lose focus anymore.

          Show
          yip.ng added a comment - After setting single submit to false, selecting a date still loses focus, but in a different way. (Tabbing seems to set focus at a random link within calendar, instead of going outside calendar.) Selecting a time field doesn't lose focus anymore.
          Hide
          yip.ng added a comment -

          Same with ARIA disabled.

          Show
          yip.ng added a comment - Same with ARIA disabled.
          Hide
          yip.ng added a comment -

          Same problem in the YUI calendar quick start tutorial, therefore it may be a problem in the YUI calendar itself.

          http://developer.yahoo.com/yui/examples/calendar/quickstart.html

          Show
          yip.ng added a comment - Same problem in the YUI calendar quick start tutorial, therefore it may be a problem in the YUI calendar itself. http://developer.yahoo.com/yui/examples/calendar/quickstart.html
          Hide
          yip.ng added a comment - - edited

          It's not a bug; it's a feature. Deep inside the date select event handler is this code:

          if (link)

          { link.blur(); }

          The result of blur() is also browser dependent? Need to override this behavior.

          Show
          yip.ng added a comment - - edited It's not a bug; it's a feature. Deep inside the date select event handler is this code: if (link) { link.blur(); } The result of blur() is also browser dependent? Need to override this behavior.
          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: