title: setting a value in a form with a default value in primefaces
body: <p>I am working with Primefaces 5.1, I have a form in which there are columns with values <code>#{circuitController.newCircuit.project}</code>. </p>
  
  <p>For this column, I want to set a default value from <code>#{projectController.selectedProject}</code> without asking the user to write a text.</p>
  
  <p>How can I do that ?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;h:form id="newUserForm"&gt;
      
    &lt;p:panelGrid id="displayNewUser" columns="2" cellpadding="4"
   style="margin:0 auto;"&gt;
   &lt;f:facet name="header"&gt;
       selected project : #{projectController.selectedProject.designation}
      &lt;/f:facet&gt;
   &lt;h:outputText value="Designation :" styleClass="title-text" /&gt;
   &lt;p:inputText id="newCircuitDesignation"
     value="#{circuitController.newCircuit.designation}" required="true" /&gt;
        
   &lt;h:outputText value="Description :" styleClass="title-text" /&gt;
   &lt;p:inputText id="newCircuitDescription"
     value="#{circuitController.newCircuit.description}" required="true" /&gt;
        
       
   &lt;h:outputText value="Start date :"
     styleClass="title-text" /&gt;
   &lt;p:calendar id="newCircuitend"
     value="#{circuitController.newCircuit.date_deb}"
    enableManualInput="true" /&gt;
  
   &lt;h:outputText value="End Date:" styleClass="title-text" /&gt;
   &lt;p:calendar id="newCircuitstart"
     value="#{circuitController.newCircuit.date_fin}"
     enableManualInput="true" /&gt;
    
   &lt;h:outputText value="Circuit designer:" /&gt;
   &lt;p:selectOneMenu  id="user" required="true" effect="fold"
     editable="true" value="#{circuitController.newCircuit.user}"  var="user"
     itemValue="#{user}" 
         converter="project.management.converter.UserConverter"&gt;
     &lt;f:attribute name="collectionType" value="java.util.ArrayList" /&gt;
     &lt;f:selectItems value="#{designersSelectItems.values}" /&gt;
  
      &lt;p:column&gt;
       &lt;h:outputText value="#{user.identity}" rendered="true"
            styleClass="data-text" /&gt;
     &lt;/p:column&gt;
   &lt;/p:selectOneMenu&gt;
        
   &lt;h:outputText value="project :" /&gt;
   &lt;p:inputText id="newCircuitpro"
     value="#{circuitController.newCircuit.project}" var="project" converter="project.management.converter.ProjectConverter"/&gt;
  
   &lt;f:facet name="footer"&gt;
   &lt;p:commandButton value="Submit" update=":form1:circuit1, :growl"
     oncomplete=" handleSubmitRequest(xhr, status, args, 'newUserDlg','newUserForm');"
     actionListener="#{circuitController.addCircuit()}" icon="ui-save" /&gt;
     &lt;p:commandButton type="reset" value="Reset" icon="ui-reset"&gt;
        &lt;/p:commandButton&gt;
     &lt;/f:facet&gt;
   &lt;/p:panelGrid&gt;
  &lt;/h:form&gt;</code></pre>
  </div>
  </div>
  </p>