title: JSF and Primefaces graphicImage rendered attribute changes but nothing happens
body: <p>I've a problem that I can't find any solutions for. I'm using <code>JSF 2.1</code> and <code>primefaces</code>, and I have a bean that contains a boolean variable with a getter and setter. I use <code>p:ajax</code> to call a method that updates the boolean value when <code>p:graphicImage</code> is updated.</p>
  
  <p>During debugging this work correctly; <code>p:graphicImage</code> has the attribute rendered set to the boolean variable of the bean. When the image is updated by ajax however, the getter is called and returns the correct value, true, but image is not rendered!</p>
  
  <p>This is my code: </p>
  
  <pre><code>&lt;p:panel&gt;
      &lt;p:panelGrid columns="3" cellpadding="5"&gt;
          &lt;p:row&gt;
              &lt;p:column&gt;
                  &lt;p:outputLabel value="#{msg.username}"&gt;&lt;/p:outputLabel&gt;
              &lt;/p:column&gt;
              &lt;p:column&gt;
                  &lt;h:inputText id="username" value="#{user.userName}"&gt;
                      &lt;p:ajax listener="#{registationController.checkUserName}" event="blur" update="imgControl"/&gt;
                  &lt;/h:inputText&gt;
              &lt;/p:column&gt;
              &lt;p:column id="imgControl"&gt;
                  &lt;p:graphicImage 
                          value="/resources/images/#{registationController.userNameAvailable}"
                          height="24px"  rendered="#{registationController.imgShow}"/&gt;
  
              &lt;/p:column&gt;
              &lt;p:message for="username" id="msgUsername" severity="info"&gt;&lt;/p:message&gt;
          &lt;/p:row&gt;
      &lt;/p:panelGrid&gt;
  &lt;/p:panel&gt;
  </code></pre>
  
  <p>And this is the bean: </p>
  
  <pre><code>@ManagedBean(name="registationController")
  public class RegistrationController implements Serializable{
  
  private static final long serialVersionUID = 1086976296682850824L;
  @ManagedProperty(value="#{user}")
  private User usr;
  private MyLogger log;
  private String userNameAvailable=null;
  private boolean imgShow=false;
  
  public void checkUserName(AjaxBehaviorEvent event){
      User tempUser=null;
  
      UserDAOImpl userDAOImpl=new UserDAOImpl();
      if(usr.getUserName()!="" &amp;&amp; usr.getUserName()!=null){
          tempUser=userDAOImpl.selectUserByUsername(usr.getUserName());
          imgShow=true;
      } else {
          imgShow=false;
      }
      if(tempUser!=null){
          userNameAvailable="no.png";
  
      } else{
          userNameAvailable= "yes.png";
      }
  }
  public boolean isImgShow() {
      return imgShow;
  }
  others methods...
  }
  </code></pre>
  
  <p>Any ideas why this doesn't works?</p>
  
  <p>Thanks,
  John</p>