locked
Search charm: controlling application focus

    Question

  • In the Start menu, when activating the Search charm and typing something, the focus shifts to the result list as soon as the user presses the arrow down key.

    Is there any way to reproduce this behaviour in my own app? It's a Javascript application and even setting the currentItem of the search results list, using setActive() and/or focus(), I can't get it to work the same way as the explorer.

    Another difference between the Start menu search and application search seems to be that the Start Menu shows suggestions/search results in the main portion of the screen. Are normal applications supposed to do this, too? Or is it rather discouraged in favor of using appendResultSuggestion? 

    Monday, March 19, 2012 8:36 AM

All replies

  • Hi,

    >In the Start menu, when activating the Search charm and typing something, the focus shifts to the result list as soon as the user presses the arrow down key.

    Is there any way to reproduce this behaviour in my own app? It's a Javascript application and even setting the currentItem of the search results list, using setActive() and/or focus(), I can't get it to work the same way as the explorer.

    I seem cannot reproduce this issue. Are you referring to the latest Search sample in the SDK?

    >Another difference between the Start menu search and application search seems to be that the Start Menu shows suggestions/search results in the main portion of the screen. Are normal applications supposed to do this, too? Or is it rather discouraged in favor of using appendResultSuggestion?

    Not sure why you say this. The latest Search sample actually shows how to do so. You can do anything on the main page (change the source of a ListView, etc, to show the filtered items, etc) after you get the search result. In the sample it just shows text on the main page.

    If you haven't tried yet you can get it from:

    http://code.msdn.microsoft.com/windowsapps/Windows-8-Modern-Style-App-Samples

    You can find the sample under "Search sample" folder.


    Allen Chen [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.



    Tuesday, March 20, 2012 8:13 AM
  • Hi,

    >>In the Start menu, when activating the Search charm and typing something, the focus shifts to the result list as soon as the user presses the arrow down key.

    Is there any way to reproduce this behaviour in my own app? It's a Javascript application and even setting the currentItem of the search results list, using setActive() and/or focus(), I can't get it to work the same way as the explorer.

    >I seem cannot reproduce this issue. Are you referring to the latest Search sample in the SDK?

    I'm referring to the Windows/Explorer Start Menu search behaviour which is different from every other application because it moves focus out of the search text input to the search result list on the left side of the screen, inside the actual application.

    >>Another difference between the Start menu search and application search seems to be that the Start Menu shows suggestions/search results in the main portion of the screen. Are normal applications supposed to do this, too? Or is it rather discouraged in favor of using appendResultSuggestion?

    > Not sure why you say this. The latest Search sample actually shows how to do so. You can do anything on the main page (change the source of a ListView, etc, to show the filtered items, etc) after you get the search result. In the sample it just shows text on the main page.

    If you haven't tried yet you can get it from:

    http://code.msdn.microsoft.com/windowsapps/Windows-8-Modern-Style-App-Samples

    You can find the sample under "Search sample" folder.

    The question here is again more one of user experience and consistency across multiple applications. Since there is a functionality to append search result suggestions to the sidebar, when do you recommend to use this and when should the application do a "preview" of search results in its main application window?

    Thursday, March 22, 2012 4:40 PM