This content has been marked as final.
Show 6 replies
-
1. Re: How to change the current date in calendar control from
sergeysmirnov Aug 26, 2007 12:05 PM (in response to akira_ag)See spec at: http://anonsvn.jboss.org/repos/richfaces/trunk/ui/calendar/design/funcspec/, section #6. JavaScript API
-
2. Re: How to change the current date in calendar control from
akira_ag Aug 27, 2007 5:00 AM (in response to akira_ag)"SergeySmirnov" wrote:
See spec at: http://anonsvn.jboss.org/repos/richfaces/trunk/ui/calendar/design/funcspec/, section #6. JavaScript API
Thanks for fast reply!
I analyze this document and found the needed functions, but the calendar control generates the following HTML:<div id="MyForm:calendarDate" style="z-index:3; "> new Calendar('MyForm:calendarDate', { ... currentDate: new Date(2007,7,27), selectedDate: new Date(2007,7,27), datePattern: 'MMM d, yyyy', jointPoint: 'bottom-left', direction: 'bottom-right', toolTipMode:'batch', boundaryDatesMode:'inactive', popup: false, ... minDaysInFirstWeek: 1}).load() </div>
As you see this code is creating an unnamed anonymous instance of class Calendar, and I can't to actuate for this instance. -
3. Re: How to change the current date in calendar control from
ilya_shaikovsky Aug 27, 2007 7:12 AM (in response to akira_ag)<a4j:form id="form"> <h:panelGroup id="test" columns="2" style="width: 300px"> <h:selectBooleanCheckbox value="#{bean.check}"> <a4j:support event="onchange" reRender="test" /> <f:selectItem itemValue="true" itemLabel="Show" /> <f:selectItem itemValue="false" itemLabel="Hide" /> </h:selectBooleanCheckbox> <rich:calendar popup="true" rendered="#{!bean.check}" value="#{bean.date}" id="c"/> <a onclick="$('form:c').component.doExpand()" href="#">Show</a> </h:panelGroup> </a4j:form>
This is the example of the component popup showing from the external link. -
4. Re: How to change the current date in calendar control from
akira_ag Aug 27, 2007 9:00 AM (in response to akira_ag)
This is the example of the component popup showing from the external link.
Very big thanks! I'll try this. -
5. Re: How to change the current date in calendar control from
anandramv Aug 21, 2008 10:27 AM (in response to akira_ag)hi,
Can you please give an example to use any one of the following javascript API, for the Rich Faces Calendar component.
disableDate(date)
enableDates(date[])
disableDates(date[])
i tried several possibilites of using this method, but it didn't work.disableDate(event,new Date(2008,7,19))
disableDate(new Date(2008,7,19))
CODE REFERENCE :<f:view> <h:form id="formID" > <rich:calendar id="calendarID" value="#{patientMedicalReportsPageBean.selectedDate}" locale="#{patientMedicalReportsPageBean.locale}" popup="#{patientMedicalReportsPageBean.popup}" datePattern="#{patientMedicalReportsPageBean.datePattern}" cellWidth="24px" cellHeight="22px" style="width:200px" isDayEnabled="enabledate()" onexpand="$('formID:calendarID').component.disableDate(new Date(2008,7,20))" /> <a4j:commandLink onclick="$('formID:calendarID').component.doExpand(event);alert(new Date(2008,7,20));$('formID:calendarID').component.disableDate(event,new Date(2008,7,15))" value="Expand"/> </h:form> </f:view>
Thank you in advance,
Anand -
6. Re: How to change the current date in calendar control from
shadowcreeper Aug 21, 2008 3:05 PM (in response to akira_ag)I did it by creating a CalendarDataModel with CalendarDataModelItems but this only works if calendar is not controlled by the client. :(