title: SAPUI5 - header, sidebar and navigation
body: <p>I am new to SAPUI5 and I have some problems with navigation, sidebar and header.
  I want to develop an application with a header and a sidebar. I use a “ToolPage” for this. Every page contains the toolpage and looks like this:</p>
  
  <pre><code>&lt;mvc:View &gt;
      &lt;tnt:ToolPage id="toolPageId"&gt;
          &lt;tnt:header&gt;
              &lt;core:Fragment ...&gt; &lt;/core:Fragment&gt;    
          &lt;/tnt:header&gt;
          &lt;tnt:sideContent id="SideContentId"&gt;
              &lt;core:Fragment ...&gt; &lt;/core:Fragment&gt;
          &lt;/tnt:sideContent&gt;
          &lt;tnt:mainContents&gt;
              &lt;NavContainer id="pageContainerId" width="100%"&gt;
                  &lt;Page ...&gt;
                      &lt;content&gt;
                           ...
                           ...
                      &lt;/content&gt;
                  &lt;/Page&gt;
               &lt;/NavContainer&gt;
          &lt;/tnt:mainContents&gt;
      &lt;/tnt:ToolPage&gt;
  &lt;/mvc:View&gt;
  </code></pre>
  
  <p>They all are similar to this, just have different code in the content tag.</p>
  
  <p>With this I achieve the layout I want and I navigate with routes in the manifest.json. I have a controller for every page and navigate with:</p>
  
  <pre><code>onNavToBeTask: function(oEvent) {
          this.getRouter().navTo("pageTasklist");
  }
  </code></pre>
  
  <p>I now have the problem that every time I navigate, the header and sidebar will be loaded again and the wrong fields in the sidebar will be highlighted.</p>
  
  <p>I've found an example, but here is all the code in an .xml and a .js file included which would be very unclear
  <a href="https://sapui5.netweaver.ondemand.com/sdk/explored.html#/sample/sap.tnt.sample.ToolPage/code" rel="nofollow noreferrer">https://sapui5.netweaver.ondemand.com/sdk/explored.html#/sample/sap.tnt.sample.ToolPage/code</a></p>
  
  <p>My Questions are:</p>
  
  <ul>
  <li>What is in general the best way to navigate with an sidebar and header?</li>
  <li>Would it be better to have a "masterpage" with the header and sidebar and just add the content to the content tag?</li>
  <li>Or should I just select the right field in the sidebar with an function which is called when I navigate to the page?</li>
  </ul>
  
  <p>Edit: </p>
  
  <p><a href="https://i.stack.imgur.com/Kqi6U.png" rel="nofollow noreferrer">Sample screenshot, what I would like to achieve</a></p>