0 Replies Latest reply on Jun 16, 2008 2:31 PM by anjana patel

    Richfaces calendar render does not update new value

    anjana patel Newbie

      We are using richfaces calendar component our requirement is to derive at start and end date based on date filter so the field layout is

      <a4j:region renderRegionOnly="true">
      <h:panelGrid columns="3" columnClasses="gCol1,gCol2,gCol3" styleClass="textSearchPanelGrid"> <h:outputText styleClass="groupLabel criteriaTopMargin" value="Date range:" />
      <rich:spacer styleClass="criteriaTopMargin"/>
      <h:selectOneMenu id="dateRange" valueChangeListener="#{searchAssetMgdBean.processDateRangeSelection}" styleClass="serchAssetSelectOneMenu criteriaTopMargin" value="#{searchAssetMgdBean.textSearchCriteria.selDateRange}">
      <a4j:support event="onchange" reRender="fromDate,toDate" ajaxSingle="true"/>
      <f:selectItem itemValue=""/>
      <f:selectItem itemValue="Next Hour"/>
      <f:selectItem itemValue="Last Hour"/>
      <f:selectItem </h:selectOneMenu>
      <h:outputText styleClass="groupLabel criteriaTopMargin" value="From date:" />
      <rich:spacer styleClass="criteriaTopMargin"/>
      <rich:calendar id="fromDate" mode="ajax" datePattern="MMM dd yyyy, HH:mm a" direction="top-right" inputClass="SearchAssetDateField criteriaTopMargin" buttonClass="calButton" value="#{searchAssetMgdBean.textSearchCriteria.fromDate}"/>
      <h:outputText styleClass="groupLabel criteriaTopMargin" value="To date:" />
      <rich:spacer styleClass="criteriaTopMargin"/>
      <rich:calendar id="toDate" mode="ajax" datePattern="MMM dd yyyy, HH:mm a" direction="top-right" inputClass="SearchAssetDateField criteriaTopMargin" buttonClass="calButton" value="#{searchAssetMgdBean.textSearchCriteria.toDate}"/>
      </h:panelGrid>
      </a4j:region>

      As noted above there is a combo box with date filter on change based on the filter type the date are calculated. we use a4j:region so that other fields in the form are not in this process. issue is first time when date filter is specified the start and end date are displayed fine however again when date filter is changed the start and end date are not updated with new values.
      seem we are missing some sort of cleanup before processing on change for date filter.
      Appreciate if anyone please guide us on the same we are unable to find good reference of richfaces calendar usuage.

      Thanks