How to Set Initial Focus in a View?

后端 未结 2 592
我在风中等你
我在风中等你 2020-12-02 01:20

I have a Detail view in an SAPUI5 app which contains a single input field with ID \"bestellmenge_tu\". Whenever this view is called, the focus should be on that

2条回答
  •  执笔经年
    2020-12-02 01:48

    The NavContainer has a property autoFocus. App is a descendant of NavContainer so it has that property too. The help (as linked above) states the following:

    Determines whether the initial focus is set automatically on first rendering and after navigating to a new page. This is useful when on touch devices the keyboard pops out due to the focus being automatically set on an input field. If necessary the "afterShow" event can be used to focus another element.

    Default value is true.

提交回复
热议问题