Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    blur issue when clearing errors()

    Hi,

    Using SmartClient version 8 GA, I have the following setup:

    2 DynamicForm components connected to the same underlying ValuesManager and DataSource instances.

    The 1st DynamicForm (userInputForm) is used to display the actual fields for the user to input data. On this
    first form, errors are configured to display beside each field (showInlineErrors=true).

    The 2nd DynamicForm (feedbackSinkForm) is used solely to report other types of validation errors which we
    have rendered at the top (showInlineErrors=false). It doesn't display actual fields per say, only potential
    validation/error messages.

    At some point, we call feedbackSinkForm.clearErrors(true). This in turn initiates the following call sequence:

    Code:
    DynamicForm::clearErrors(show);
    DynamicForm::setErrors({}, show);
    DynamicForm::showErrors(this.errors, hiddenErrors);
    ...
    When there's a field containing an error (for example a date field containing an invalid date value), we
    get an "Unspecified Error" element.blur() at line 9,622 @ blurItem() @ FormItem.js. This happens
    only in IE (FF works fine).

    The call stack when the error occurs is as follows:

    Code:
    isc_FormItem_blurItem
    isc_DynamicForm__blurItem
    isc_DynamicForm__blurFocusItemWithoutHandler
    isc_DynamicForm_redraw
    isc_c_Canvas_clearRedrawQueue
    isc_c_Class_fireCallback
    isc_c_Timer__fireTimeout
    JScript - anonymous function
    To overcome the problem, we've overridden the showErrors() method in feedbackSinkForm's definition
    to be as follows :

    Code:
       showErrors : function (errors, hiddenErrors, suppressAutoFocus)
       {
          // when suppressAutoFocus isn't specified, set to TRUE. Prevents blur() issue with Internet Explorer
    
          if (suppressAutoFocus == undefined)
             this.invokeSuper(DynamicForm, 'showErrors', errors, hiddenErrors, true);
          else
             this.Super('showErrors', arguments);
       }
    Using the code above prevents the "Unexpected Error" from happening under IE and doesn't seem
    to be breaking anything else ...

    Unfortunately, I haven't been able to setup a reproducible example using purely Isomorphic code.

    Obviously, my fix is a bit patchy. I was wondering if you had any insight on what this problem could
    be and how it should be fixed in a cleaner way ?

    Thanks for our help,

    #2
    Anyone has any idea?

    Thanks!

    Comment


      #3
      Hi Yan
      We have seen the "unspecified error" in IE during certain manipulations to do with focus manipulation or accessing the native "activeElement" and clearing / drawing elements in the DOM in the same browser thread.
      We've already resolved every case we've come across directly in our code.

      Clearly you're hitting a sequence of events that still triggers this same issue.
      If you do manage to get a standalone case that we can run on our end to see the issue that would be ideal. Without that it's difficult to resolve on our end - the page structure and sequence of events is likely to be quite specific to hit the issue and from your description it sounds like simply putting the DynamicForm that causes the problem into a separate page and running the logic to clear and reset errors doesn't trip it.

      Your workaround of disabling autoFocus when showing errors should not cause any ill effects in this case. If you can live with this for now and work on coming up with a reproducible case for us that might be the best way to proceed.

      Comment


        #4
        Actually there's a specific further test that would help: if you enable the log category "nativeFocus", do you see a log "about to call element blur..." right before this crash, and if so, can you post the complete log?

        Comment


          #5
          Thanks for your reply,

          Here's the console output, as requested. Let me know if you figure
          out anything or if I can provide further details.

          Kind regards,

          Code:
          08:50:24.235:BLR7:DEBUG:nativeFocus:onblur fired on: [GridBody ID:isc_MeiListGrid_1_body], activeElement: DIV
          08:50:26.909:FCS2:DEBUG:nativeFocus:onfocus fired on: [GridBody ID:isc_MeiListGrid_1_body], activeElement: TD
          08:50:26.919:BLR3:DEBUG:nativeFocus:onblur fired on: [GridBody ID:isc_MeiListGrid_1_body], activeElement: TD
          08:50:27.109:MUP9:INFO:nativeFocus:isc_TextItem_5:about to call element.focus() , activeElement: TD
          08:50:27.450:IFCS1:DEBUG:nativeFocus:onfocus fired on: [TextItem ID:isc_TextItem_5 name:dateTextField], activeElement: INPUT
          08:50:31.876:IBLR0:DEBUG:nativeFocus:onblur fired on: [TextItem ID:isc_TextItem_5 name:dateTextField], activeElement: TD
          08:50:31.876:cFCS2:INFO:nativeFocus:isc_IButton_0_label:about to call native focus()
          08:50:31.886:FCS3:DEBUG:nativeFocus:onfocus fired on: [Label ID:isc_IButton_0_label], activeElement: DIV
          08:50:31.886:FCS3:INFO:nativeFocus:isc_IButton_0:about to call native focus()
          08:50:31.896:BLR4:DEBUG:nativeFocus:onblur fired on: [Label ID:isc_IButton_0_label], activeElement: DIV
          08:50:31.906:FCS5:DEBUG:nativeFocus:onfocus fired on: [IButton ID:isc_IButton_0], activeElement: DIV
          08:50:32.026:MUP6:INFO:nativeFocus:isc_TextItem_5:about to call element.focus() , activeElement: DIV
          08:50:32.056:BLR9:DEBUG:nativeFocus:onblur fired on: [IButton ID:isc_IButton_0], activeElement: INPUT
          08:50:32.056:IFCS0:DEBUG:nativeFocus:onfocus fired on: [TextItem ID:isc_TextItem_5 name:dateTextField], activeElement: INPUT
          08:50:32.096:RDQ2:INFO:nativeFocus:isc_TextItem_5:about to call element blur, activeElement: INPUT
          08:50:32.106:selectionchange3[E]:INFO:nativeFocus:isc_TextItem_5:about to call element blur, activeElement: INPUT
          08:50:32.227:WARN:Log:Error:
          	'Unspecified error.'
          	in http://172.16.1.157:8080/MeiTpm/isomorphic/system/modules/ISC_Forms.js?meiTpmVersion=${meitpm.build.version.full}
          	at line 1450
              FormItem.blurItem()
              DynamicForm.$11r(_1=>[TextItem ID:isc_TextItem_5 name:dateTextField])
              DynamicForm.$106()
              DynamicForm.redraw(false)
              [c]Canvas.clearRedrawQueue()
              [c]Class.fireCallback(_1=>Obj, _2=>undef, _3=>Array[0], _4=>[Class Canvas], _5=>true) on [Class Timer]
              [c]Timer.$in(_1=>"$ir595")
              anonymous()
                  "isc.Timer.$in('$ir595')"
          
          08:50:32.237:IFCS5:DEBUG:nativeFocus:onfocus fired on: [TextItem ID:isc_TextItem_5 name:dateTextField], activeElement: INPUT
          08:50:32.287:TMR1:INFO:nativeFocus:isc_TextItem_5:element already focused, not focus()ing
          08:50:32.287:TMR2:INFO:nativeFocus:isc_TextItem_5:element already focused, not focus()ing
          08:50:41.840:IBLR7:DEBUG:nativeFocus:onblur fired on: [TextItem ID:isc_TextItem_5 name:dateTextField], activeElement: INPUT

          Comment


            #6
            Hi Yan
            Based on your stack trace and other information we've added a theoretical fix that is likely to resolve this issue. Please feel free to give it a try (the fix will be present in nightly builds from this point forward) and let us know if you continue to see this "Unspecified Error" reported in IE

            Thanks

            Comment


              #7
              Hi,

              Thanks for delving further into this issue. Unfortunately (or should I say fortunately),
              this issue is no longer reproducible on our side. We've modified our feedbackSink
              layout and its properties and that issue is no longer visible on our end.

              Kind regards,

              Comment

              Working...
              X