title: Windows 8.1: WinJS: appbar won't open/show by default?
body: <p>I'm working on a Windows 8.1 app and on a data input page I would like the appBar to be open or visible by default as it contains the option to save the data.</p>
  
  <p><a href="http://msdn.microsoft.com/en-us/library/windows/apps/br229676.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/windows/apps/br229676.aspx</a></p>
  
  <p>I've looked at the link above and tried the show method in the following way:</p>
  
  <p>Markup:</p>
  
  <pre><code>&lt;div id="appbarCommands" data-win-control="WinJS.UI.AppBar" data-win-options="{sticky: 'true'}"&gt;
      &lt;button data-win-control="WinJS.UI.AppBarCommand"
              data-win-options="{id:'cmdSaveCustomer', icon:'save', section:'global'}"
              data-win-res="{winControl: {label:'CRM_contactHistory_appBar_SaveLabel', tooltip:'CRM_contactHisory_appBar_SaveToolTip'}}"&gt;&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>JS Code:</p>
  
  <pre><code>(function () {
          "use strict";
  
      WinJS.UI.Pages.define("/pages/CRM/customerDetails/contacts/contactHistory/contactHistory.html", {
  
          ready: function (element, options) {
  
              WinJS.UI.processAll().done(function () {
  
                  setAppBarState(document.getElementById("appbarCommands"));
  
              });
              WinJS.Resources.processAll()            
          }
      });
  })();
  
  function setAppBarState(appBar) {
  
      appBar.winControl.show();
  
  }
  </code></pre>
  
  <p>For whatever reason, the appBar doesn't launch. I've tested it in the appBar sample code and it works fine on there, but it doesn't work in the actual solution.</p>
  
  <p>I wondered if someone could perhaps shed some light on the problem? Or perhaps knows of a reason that would prevent the appbar being shown when the page loads?</p>
  
  <p>Many thanks</p>
  
  <p>Chris</p>