Announcement

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

    JS error in Smartclient code: shouldSelectOnFocus

    Hi,
    Afaics the latest nightly (25-9) of the 8.1 stream has a js error. This method is defined in TextItem:
    _shouldSelectOnFocus : function () {

    But it is called in 2 locations without the underscore in TextItem:
    var selectOnFocus = this.shouldSelectOnFocus();

    So seems a typo. If I can ask, is it possible to implement this method without the underscore? It makes overriding possible. I have a case where selectonfocus should happen also after a mouse event, I think a common case:
    I open a form after a mouse click on a row, the form field which gets the focus should be selected

    Currently this does not happen because the shouldSelectOnFocus sees that it is a mouseevent and does not do selectOnFocus. I can override this behavior by customizing the shouldSelectOnFocus method. So making it overridable really helps here.

    gr. Martin
    Last edited by martintaal; 26 Sep 2011, 02:56.

    #2
    Hi Martin
    We've fixed the JavaScript error.

    We were not currently planning to expose this method as an override point. In most cases developers could always call item.selectValue().
    However you have a point that for an autoFocus form with selectOnFocus set, the mouse event that triggered the form's being drawn or shown should not prevent auto-select. We'll look into getting this working

    Regards
    Isomorphic Software

    [EDIT]: Actually this should be working in most cases. Can you clarify exactly what your use case is (a code snippet or of course standalone test case would be helpful) - and don't forget to let us know what browser/OS you're using.
    Last edited by Isomorphic; 26 Sep 2011, 10:40.

    Comment


      #3
      Hi,
      Yes I solved it for now using a direct call to selectvalue, so that works fine for me now.

      The form/grid I implemented is quite extensive so getting a separate testcase is some work, as it works for me as it is, I am fine, thanks!

      gr. Martin

      Comment

      Working...
      X