title: Updating a component with binding (JSF2 + PrimeFaces 5.0.2)
body: <p>I have some trouble dealing with PrimeFaces 5.0 and a panelGroup with "binding". I know, "binding" sucks, but I'm working with a legacy system and believe me, it's truly hard to make it the right way, without "binding".</p>
  
  <p>So, when I click mi link, the getter of the "binding" property is called before the "action", then the action is called, and after all the "update". But, the component is not properly updated. </p>
  
  <p><strong>Even if I make it to run the "action" before the getter of the binding, and the getter is returning the right stuff, this particular component is not updated.</strong></p>
  
  <p>I have more components without binding which are updated properly, but not the one with "binding". </p>
  
  <hr>
  
  <p>UPDATE:</p>
  
  <p>Here is the rest of the code. flag starts with "false" value.</p>
  
  <p><strong>The page always print "READ ONLY".</strong></p>
  
  <p>Somepage.xhtml</p>
  
  <pre><code>&lt;h:form id="frm"&gt;
  
     &lt;p:commandLink value="#{messages.Guardar}" id="bt_Guardar" action="#{myBean.flagFalse}" update="someid" /&gt;
     &lt;p:commandLink value="#{messages.Editar}" id="bt_Editar" action="#{myBean.flagTrue}" update="someid" /&gt;
  
  
     &lt;h:panelGroup id="someid" layout="block"&gt;
        &lt;h:panelGroup id="panelCamposTD" layout="block" binding="#{myBean.someStuff}"  &gt;&lt;/h:panelGroup&gt;                            
     &lt;/h:panelGroup&gt;
  
  &lt;/h:form&gt;
  </code></pre>
  
  <p>And my myBean, wich is a <strong>SessionScoped</strong> bean (because it comes from a legacy system)</p>
  
  <pre><code>@ManagedBean(name="myBean")
  @SessionScoped
  public class MyBean implements Serializable{
  
  
     private static final long serialVersionUID = 7628440827777833854L;
  
     private boolean flag = false;
  
     public void flagFalse(){
        flag = false;
     }
  
     public void flagTrue(){
        flag = true;
     }
  
     public HtmlPanelGroup getSomeStuff(){
  
         HtmlPanelGroup pg = new HtmlPanelGroup();   
         HtmlOutputText t = new HtmlOutputText();
  
         if (flag){          
             t.setValue("EDITED");           
         }else{          
             t.setValue("READ ONLY");            
         }
         pg.getChildren().add(t);
  
         return pg;
     }   
  
     public void setSomeStuff(HtmlPanelGroup pg){
        return;
     }
  
  
     public boolean isFlag() {
        return flag;
     }
  
     public void setFlag(boolean flag) {
        this.flag = flag;
     }
  
  
  }
  </code></pre>