ICEfaces
  1. ICEfaces
  2. ICE-4383

Javascript object 'this' does not work with onFocus event and ice:inputText

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8
    • Fix Version/s: 1.8.1
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      FF 3.0.8, IE7

      Description

       <ice:form>
                      <ice:inputText id="idWhereLocationTextBox" styleClass="inputTextBox width90"
                                     value="#{myBean.whereLocation}"
                                     onfocus="javascript:clearTxt(this.id);"
                                     onblur="javascript:getTxt(this.id);"/>
                  </ice:form

      and

       <script>
                      function clearTxt(varI){
                          alert('onFocus:' + varI);
                      }

                      function getTxt(varI) {
                            alert('onBlur:' + varI);
                      }
        </script>

      In Firefox 3.0.8, the alert will return "onFocus:undefined" and in IE7 "onFocus j_id11" which is the ID of the form tag.

        Activity

        Repository Revision Date User Message
        ICEsoft Public SVN Repository #18814 Tue Apr 28 15:58:00 MDT 2009 mircea.toma ICE-4383 Add comment.
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/bridge/src/focus.js
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #18813 Tue Apr 28 15:48:32 MDT 2009 mircea.toma ICE-4383 Execute previously registered listeners so that 'this' variable points to the right element instance.
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/bridge/src/focus.js

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Tyler Johnson
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: