0

Focus on a first element

Hi,

is there any way to make focus always appear on a first view element? first_element.focus() in updateView() works, but not always, if you have a grid and buttons below, grid.focusCell(0) works only if the focus should have been on one of the grid elements, if it should have been on one of the buttons, it remains there.

7 Replies
  • QUOTE (hriuki @ Nov 30 2009, 09:37 AM) <{POST_SNAPBACK}>
    Hi,

    is there any way to make focus always appear on a first view element? first_element.focus() in updateView() works, but not always, if you have a grid and buttons below, grid.focusCell(0) works only if the focus should have been on one of the grid elements, if it should have been on one of the buttons, it remains there.

    Have you tried overriding the focusView method in your view, and setting focus to the first element there? See pg 178 of the dev guide.
    0
  • QUOTE (Steve @ Nov 30 2009, 09:42 AM) <{POST_SNAPBACK}>
    Have you tried overriding the focusView method in your view, and setting focus to the first element there? See pg 178 of the dev guide.


    Yes, thanks, that works, but only if the view has already been created. If the view is opened for the first time, the focus is still on the back button. Is there any way to override that?
    0
  • QUOTE (hriuki @ Dec 1 2009, 02:47 AM) <{POST_SNAPBACK}>
    Yes, thanks, that works, but only if the view has already been created. If the view is opened for the first time, the focus is still on the back button. Is there any way to override that?

    Try overriding the setInitialFocus method.
    0
  • focusView is called even for first focus. It is always the last thing to be called when focus is coming into the widget from outside. Can you please give me some sample code so I can help you figure out what's wrong?

    -Jeremy
    0
  • QUOTE (Jeremy Johnstone @ Dec 2 2009, 04:29 PM) <{POST_SNAPBACK}>
    focusView is called even for first focus. It is always the last thing to be called when focus is coming into the widget from outside. Can you please give me some sample code so I can help you figure out what's wrong?

    -Jeremy


    Yes, sure.

    CODE
    focusView: function() {
    this.controls.what_is_button.focus();
    }


    This code works fine only when the view has been already created, but when it it opened for the first time, the focus is on the back button.

    Thanks,
    Tim
    0
  • Sounds like a bug. I'll investigate. Please provide me the following versions:

    Ubuntu
    Framework
    WDK
    0
  • I&#39;m having the same problem. Was there a solution?<br><br><div class="quote "><div class="quotetop ">QUOTE<cite>(Jeremy Johnstone @ 16 Dec 2009 5:02 PM)</cite><blockquote class="quotemain">Sounds like a bug. I&#39;ll investigate. Please provide me the following versions:<br><br>Ubuntu<br>Framework<br>WDK</blockquote></div></div>
    0

Recent Posts

in General - Yahoo! TV Widgets