0 Replies Latest reply on Jul 18, 2009 2:29 AM by Raphael Pierron

    s:selectItems and f:convertDateTime

    Raphael Pierron Newbie

      I am trying to display a drop-down containing a list of dates, however I have issues using s:selectItems and f:convertDateTime together. referralDetailsBean.selectedCallbackToHour is an ArrayList of Date objects.


      I tried :






      <h:selectOneMenu id="CallBackToBoxId" value="#{referralDetailsBean.selectedCallbackToHour}">
           <s:selectItems var="_callbackHour" value="#{referralDetailsBean.displayedCallbackHours}" noSelectionLabel="(None)" itemValue="#{_callbackHour}"/>
           <f:convertDateTime pattern="hh:mm aa"/>
      </h:selectOneMenu>



      The only way to do it seems to use the f:selectItem tag, and iterate on it with the bad c:foreach tag, but this not acceptable for me. The code below works fine




      <h:selectOneMenu id="CallBackToBoxId" value="#{referralDetailsBean.selectedCallbackToHour}">
           <c:forEach var="_callbackHour" items="#{referralDetailsBean.displayedCallbackHours}">
                <f:selectItem itemValue="#{_callbackHour}"/>
           </c:forEach>
           <f:convertDateTime pattern="hh:mm aa"/>
      </h:selectOneMenu>



      Any idea ?