Announcement

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

    Alternatives to autoFocus on forms

    Hello,

    I am implementing logic in our application to make sure that the focus is always set on the 1st tab-able field displayed on the panel.

    I have done this by setting autoFocus on the 1st (dynamic)form and for the most of our basic forms this is working as expected.

    A number of our pages though has additional logic hooked up in an 'after fetch' method to disable certain form items. It happens quite often that one of these disabled items has the focus set (by the autoFocus logic) after which it is disabled.

    Obviously this is an issue introduced by our flow, I was wondering if I could delay this 'autoFocus' logic with some built in function/setting?

    Alternatively, I was wondering if I could simulate this autoFocus behavior by simply calling 'focus' on the relevant form once all (our) processing has completed (and disabling the activation of the built in autoFocus functionality).

    Thanks for your advise.

    #2
    You can use dynamicForm.focusInItem() to place focus in the item of your choosing whenever the timing makes sense in your application.

    Comment


      #3
      This is working nicely, thanks!

      Comment

      Working...
      X