title: Update Target Unreachable, returned null
body: <p>'m experiencing problems while trying to use the object currentCenter and display its attributes on a dialog using Primefaces but it keeps showing this error</p>
  
  <p><strong>Error</strong></p>
  
  <pre><code>AVERTISSEMENT: /pages/centres.xhtml @151,196 value="#
   {centreMB.currentCentre.matricule}": Target Unreachable, 'currentCentre' returned null
   javax.el.PropertyNotFoundException: /pages/centres.xhtml @151,196 value="#
  {centreMB.currentCentre.matricule}": Target Unreachable, 'currentCentre' returned null
  at com.sun.faces.facelets.el.TagValueExpression.getType(TagValueExpression.java:100)
  at org.primefaces.renderkit.InputRenderer.findImplicitConverter(InputRenderer.java:170)
  at org.primefaces.renderkit.InputRenderer.findConverter(InputRenderer.java:190)
  at org.primefaces.renderkit.InputRenderer.getConvertedValue(InputRenderer.java:196)
  </code></pre>
  
  <p><strong>CentreManagedBean.java</strong></p>
  
  <pre><code> public void onSelectCentreForUpdate(Centre centre) {
      try {
          setCurrentCentre(centre);
          setIdcentreselected(centre.getIdcentre());
      } catch (Exception e) {
          System.out.println(e);
      }
  }
  
  /**
   * Modifier Médecin
   *
   * @return vide
   */
  public void updateCentre() {
      try {
          Centre c=getCentreService().getCentreById(getIdcentreselected());
          c.setMatricule(currentCentre.getMatricule());
          c.setAdresse(currentCentre.getAdresse());
          c.setUpdatedAt(new Date());
          getCentreService().updateCentre(c);
  
      } catch (DataAccessException e) {
          System.out.println(e);
      }
  }
  </code></pre>
  
  <p><strong>centre.xhtml</strong></p>
  
  <pre><code>   &lt;p:column style="width:0.5%"&gt; 
                                 &lt;p:commandButton icon="ui-icon-pencil" actionListener="#{centreMB.onSelectCentreForUpdate(centre)}" update=":editCentre:updatePanel" oncomplete="updateCentre.show()"/&gt;
  
                              &lt;/p:column&gt; 
  </code></pre>
  
  <p></p>
  
  <pre><code>            &lt;!-- Modification --&gt;
              &lt;p:dialog header="Modification du centre" widgetVar="updateCentre" resizable="false" id="editP" modal="true"&gt; 
                  &lt;p:messages id="msgs"/&gt;  
                  &lt;h:panelGrid columns="2" id="updatePanel"&gt;
  
                  &lt;h:outputLabel for="matricule" value="Matricule: *" /&gt;
                  &lt;p:inputText id="matricule" value="#{centreMB.currentCentre.matricule}" required="true" label="Matricule" style="width: 205px" requiredMessage="Matricule: Champ obligatoire"/&gt;                  
                  &lt;h:outputLabel for="nom" value="Nom: *" /&gt;  
                  &lt;p:inputText id="nom" value="#{centreMB.currentCentre.nom}" required="true" label="Firstname" style="width: 205px" requiredMessage="Nom: Champ obligatoire"/&gt;
                  &lt;h:outputLabel for="prenom" value="Adresse: " /&gt;  
                  &lt;p:inputTextarea id="prenom" value="#{centreMB.currentCentre.adresse}" label="Surname" required="false" style="width: 205px" /&gt;
  
                  &lt;/h:panelGrid&gt;  
                  &lt;p:separator/&gt;             
                  &lt;p:commandButton styleClass="ui-panel-titlebar-icon ui-corner-all ui-state-default" id="enregsitrer" value="Enregistrer" update="msgs" actionListener="#{centreMB.updateCentre}" ajax="true" style="width: 248px;" oncomplete="handleDialogSubmitUpdate(xhr, status, args)"/&gt;  
                  &lt;p:commandButton type="button" styleClass="ui-panel-titlebar-icon ui-corner-all ui-state-default" value="Annuler" ajax="true" onclick="updateCentre.hide()"/&gt;
  
              &lt;/p:dialog&gt;
  
          &lt;/h:form&gt;
  </code></pre>
  
  <p>thanks for your helps Regards</p>