title: Make a p:calendar readonly
body: <p>I want to make <a href="http://www.primefaces.org/showcase/ui/input/calendar.xhtml" rel="nofollow noreferrer"><code>&lt;p:calendar&gt;</code></a> readonly so that users can only choose a date from the calendar because of <a href="https://code.google.com/p/primefaces/issues/detail?id=5626" rel="nofollow noreferrer">this</a> issue (this is not a solution though).</p>
  
  <p>For this to be so, I'm doing <code>readonly="#{facesContext.renderResponse}"</code> as mentioned by <a href="https://stackoverflow.com/a/10388648/1391249">this</a> answer like,</p>
  
  <pre><code>&lt;p:calendar id="calendarId" 
          value="#{bean.property}" 
          converter="#{jodaTimeConverter}" 
          pattern="dd-MMM-yyyy hh:mm:ss a" 
          showOn="button" 
          readonly="#{facesContext.renderResponse}" 
          effect="slideDown"
          required="true" 
          showButtonPanel="true" 
          navigator="true"/&gt;
  </code></pre>
  
  <p>This works but when the page is loaded (typing the URL in the address bar and then pressing the enter key), <code>facesContext.renderResponse</code> returns <code>false</code> and the calendar is no longer readonly. It evaluates to <code>true</code>, when I submit the form by pressing <code>&lt;p:commandButton&gt;</code>.</p>
  
  <p>So, how to make the calendar readonly, when the page is loaded?</p>
  
  <p>P.S : I'm using PrimeFaces 3.5 and Mojarra 2.1.9.</p>