title: Setters are called twice in JSF managed bean
body: <p>I'm having an issue applying dates to my managedBean since I added jquerys datePicker to an application.</p>
  
  <p>I attach the datepicker to the two date fields and it is working fine(It pops up and allow selection of  dates, the input field changes to reflect date selections correctly).</p>
  
  <p><br>
  myBean.java</p>
  
  <pre><code>public class MyBean {
  
      private Date startDate;
      private Date endDate;
  
      public MyBean()
      {
          ...
      }
  
      public void filterList()
      {
          ...
      }
  
      public Date getStartDate()
      {
          return startDate;
      }
  
      public void setStartDate(Date startDate)
      {
          this.startDate = startDate;
      }
  
      public Date getEndDate()
      {
          return endDate;
      }
  
      public void setEndDate(Date startDate)
      {
          this.endDate = endDate;
      }
  
  }
  </code></pre>
  
  <p><br>
  myPage.xhtml:</p>
  
  <pre><code>&lt;h:form id="my_requests_pending"&gt;
      &lt;rich:panel id="filter_panel"&gt;
          &lt;h:panelGrid rendered="#{myBean.filter}"&gt;
              &lt;h:panelGrid&gt;
                  &lt;h:outputText id="startDateLbl" value="#{messages['MyBeanMessages.startDate']}" /&gt;
                  &lt;h:panelGrid&gt;                       
                      &lt;h:inputText id="startDate" value="#{mysBean.startDate}"&gt;
                          &lt;f:convertDateTime pattern="E, d MMM, yyyy" timeZone="#{localeBean.timeZone}" /&gt;
                      &lt;/h:inputText&gt;
                  &lt;/h:panelGrid&gt;
              &lt;/h:panelGrid&gt;
              &lt;h:panelGrid&gt;
                  &lt;h:outputText value="#{messages['MyBeanMessages.endDate']}" /&gt;
                  &lt;h:panelGrid&gt; 
                      &lt;h:inputText id="endDate" value="#{myBean.endDate}"&gt;
                          &lt;f:convertDateTime pattern="E, d MMM, yyyy" timeZone="#{localeBean.timeZone}" /&gt;
                      &lt;/h:inputText&gt;
                  &lt;/h:panelGrid&gt;
              &lt;/h:panelGrid&gt;
          &lt;h:panelGrid columns="1"&gt;
              &lt;h:commandButton id="myReqSubmitBtn" value="#{messages['MyBeanMessages.submit']}" action="#{myBean.filterList}" /&gt;
          &lt;/h:panelGrid&gt;
          &lt;/h:panelGrid&gt;
      &lt;/rich:panel&gt;
  &lt;/h:form&gt;
  </code></pre>
  
  <p><br>
  myCalendar.js</p>
  
  <pre><code>jQuery('startDate,endDate').datepicker.({
          showOn : 'both',
          changeMonth : true,
          changeYear : true,
          showOtherMonths : true,
          selectOtherMonths : true,
          showButtonPanel : true,
          dateFormat : "D, d M, yy",
          showAnim : "slideDown"
      });
  </code></pre>
  
  <p><br>
  A problem occurs when I <strong>submit</strong> my form. <br><br>
  The setStartDate/setEndDate methods are getting called twice (I can see this in debug mode).<br>
  The first time sets the date correctly to the new changed date and the second call is resetting it back to the origional date.
  <br></p>
  
  <p>Is their something going on with the JSF lifecycle that I'm not aware of?<br>
  Any help appreciated.
  <br><br></p>
  
  <h2>UPDATE</h2>
  
  <p>The problem seems to be on the 'Update Model' JSF phase.
  It outputs the following debug code:</p>
  
  <pre><code>09-Nov-2011 16:02:26 org.exadel.jsf.PhaseTracker beforePhase
  INFO: BEFORE UPDATE_MODEL_VALUES 4
  </code></pre>
  
  <ul>
  <li>It then hits the breakpoint in setStartDate() method and updates the startDate property correctly.</li>
  <li>When it leaves the setStartDate() Method it then make numerous calls to jsf libraries, etc...and returns again to my breakpoint in setStartDate()!</li>
  <li>I then step out of the method and following debug code appears.</li>
  </ul>
  
  <blockquote>
  <pre><code>09-Nov-2011 17:06:21 org.exadel.jsf.PhaseTracker afterPhase
  INFO: AFTER UPDATE_MODEL_VALUES 4
  09-Nov-2011 17:06:21 org.exadel.jsf.PhaseTracker beforePhase
  INFO: BEFORE INVOKE_APPLICATION 5
  </code></pre>
  </blockquote>