title: Update a value pased as a parameter in a composite component
body: <p>I use <a href="https://stackoverflow.com/questions/6358066/how-to-implement-a-dynamic-list-with-a-jsf-2-0-composite-component">this</a> questions to create a composite component with the behaviour of a time selector.</p>
  
  <p>This is my composite xhtml</p>
  
  <pre><code>&lt;ui:composition xmlns:f="http://java.sun.com/jsf/core"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:cc="http://java.sun.com/jsf/composite"
  xmlns:rich="http://richfaces.org/rich"&gt;
  &lt;cc:interface componentType="customTimeBean"&gt;
      &lt;cc:attribute name="date" type="java.util.Date" required="true" /&gt;
  &lt;/cc:interface&gt;
  &lt;cc:implementation&gt;
      &lt;rich:inputNumberSpinner value="#{cc.hours}" minValue="0"
          maxValue="23" /&gt;
      &lt;h:outputLabel value=":" /&gt;
      &lt;rich:inputNumberSpinner value="#{cc.minutes}" minValue="0"
          maxValue="59" /&gt;
  &lt;/cc:implementation&gt;
  &lt;/ui:composition&gt;
  </code></pre>
  
  <p>This is my Faces Component</p>
  
  <pre><code>@FacesComponent(value = "customTimeBean")
  public class CustomTimeBean extends UINamingContainer {
  
      private Date getDate() {
  
          Date d = (Date) getAttributes().get("date");
          if (d == null) {
              //throw new RuntimeException("Date no debe ser nulo");
              d = new date();
          }
          return d;
      }
  
      public void setMinutes(int value) {
  
          getDate().setMinutes(value);
      }
  
      public void setHours(int value) {
  
          getDate().setHours(value);
      }
  
      public int getMinutes() {
  
          return getDate().getMinutes();
      }
  
      public int getHours() {
  
          return getDate().getHours();
      }
  
      public void setSeconds(int value) {
  
          getDate().setHours(value);
      }
  
      public int getSeconds() {
  
          return getDate().getSeconds();
      }
  
  }
  </code></pre>
  
  <p>And the usage</p>
  
  <pre><code>&lt;sigh:time date="#{bean.date}" hasSeconds="false"/&gt;
  </code></pre>
  
  <p>My test case:</p>
  
  <pre><code>&lt;h:outputLabel value="#{controller.date}" id="date" /&gt;
  &lt;sigh:time date="#{controller.date}" /&gt;
  &lt;a4j:commandButton render="date" /&gt;
  </code></pre>
  
  <p>The "controller":</p>
  
  <pre><code>@ManagedBean
  public class Controller  {
  
      Date date;
  
      public Date getDate() {
  
          return date;
      }
  
      public void setDate(Date date) {
  
          this.date = date;
      }
  }     
  </code></pre>
  
  <p>This works well, but, this doesn't work when I pass a null Date as attribute, how can I update the value in the Bean (controller.date)?</p>
  
  <p>In my test case, when I press the a4j:commandButton and date in the controller is null, the outputlabel dont show nothing (date is null), when the date is not null, the date is update everytime I click the Button.</p>
  
  <p>Sorry for my bad english.</p>
  
  <p>Thanks!</p>