This content has been marked as final.
Show 5 replies
-
1. Re: Calendar control linked to drop downs for date selection
nbelaevski Mar 5, 2009 9:24 PM (in response to david.spark)Hello,
You can try to add "action" to a4j:support that will modify selected date. -
2. Re: Calendar control linked to drop downs for date selection
david.spark Mar 6, 2009 6:34 AM (in response to david.spark)Hi, thanks for the suggestion. It's now working (with one quirk mentioned below) with the following code:
<a:region renderRegionOnly="true"> <h:panelGroup id="eventDates"> <h:selectOneMenu value="#{bookingManager.dateDay}" id="eventDay"> <f:selectItem itemValue="1" itemLabel="1"/> ... <f:selectItem itemValue="31" itemLabel="31"/> <f:convertNumber/> <a:support event="onchange" ajaxSingle="true" reRender="eventDates"/> </h:selectOneMenu> <h:selectOneMenu value="#{bookingManager.dateMonth}" id="eventMonth"> <f:selectItem itemValue="0" itemLabel="Jan"/> ... <f:selectItem itemValue="11" itemLabel="Dec"/> <f:convertNumber/> <a:support event="onchange" ajaxSingle="true" reRender="eventDates"/> </h:selectOneMenu> <rich:calendar id="eventDate" value="#{currentEvent._Start}" required="true" datePattern="MMM d, yyyy" inputClass="textboxarea" showWeeksBar="false" showFooter="false"> <a:support event="ondateselected" ajaxSingle="true" reRender="eventDates"> <a:actionparam value="$('bookingForm:eventDate').component.getSelectedDateString('MM/dd/yy')" assignTo="#{bookingManager.updateDate}" noEscape="true"/> </a:support> <f:facet name="header"> <h:panelGrid columns="3" width="100%" columnClasses="rich-calendar-tool"> <h:outputText value="{previousMonthControl}" style="font-weight:bold;"/> <h:outputText value="{currentMonthControl}" style="font-weight:bold;"/> <h:outputText value="{nextMonthControl}" style="font-weight:bold;"/> </h:panelGrid> </f:facet> </rich:calendar> <h:message for="eventDate"/> </h:panelGroup> </a:region>
The only slight problem is that the very first time the page is loaded when I click on the calendar icon the popup calender appears and then closes straight away. Subsequent clicks are fine and it opens and stays open. Obviously this is a bit annoying for end users so I was wondering if there's anything obvious that I'm doing wrong? -
3. Re: Calendar control linked to drop downs for date selection
nbelaevski Mar 6, 2009 7:20 AM (in response to david.spark)In what browser does that reproduce?
-
4. Re: Calendar control linked to drop downs for date selection
david.spark Mar 6, 2009 7:38 AM (in response to david.spark)It happens in both IE7 and Firefox 3. It doesn't happen if I surround the rich:calendar with:
<a:region renderRegionOnly="true"> ... </a:region>
but that doesn't work as a solution because then the re-rendering of the drop downs doesn't happen as they are outside the region. -
5. Re: Calendar control linked to drop downs for date selection
david.spark Mar 6, 2009 7:51 AM (in response to david.spark)OK, I seem to have solved it by changing the a:support event from ondateselected to oncollapse
Hopefully that is it all working now :-)
Thanks for you help!