title: Primefaces: Input Text / Overlay panel / Retain focus
body: <p>We have a <code>p:inputText</code> element that should display an overlay panel for various options. (Its a global search, so you can tick categories to search in)</p>
  
  <p><em>Users usually click in the textbox, start typing and THEN look at the screen again</em></p>
  
  <p>The Problem is: As soon as the overlay panel is shown, the textbox looses its focus.</p>
  
  <pre><code>&lt;p:inputText id="searchItem"&gt;&lt;/p:inputText&gt;
  &lt;p:overlayPanel id="gsOverlay" for="searchItem" my="left top" 
   at="left bottom" dynamic="true" 
   onShow="resizeGSOverlay();"&gt;
  </code></pre>
  
  <p>So i tried to fix this, by immediately focusing back on the "search" <code>inputtext</code> using</p>
  
  <pre><code>&lt;p:overlayPanel id="gsOverlay" for="searchItem" my="left top" 
   at="left bottom" dynamic="true" 
   onShow="PrimeFaces.focus('globalSearchForm:searchItem'); resizeGSOverlay();"&gt;
  </code></pre>
  
  <p>However, there is a split second, where the inputfield lost focus, leading to searches missing the first charater.</p>
  
  <p>Can i display the overlay panel, without having the inputtext loosing its focus? (Each component inside the overlay panel will focus back after clicking, that's fast enough - just the initial focus-back is to slow)</p>