-
1. Re: how can I get the updated date in my rich:calendar?
chamika Jul 7, 2008 12:53 AM (in response to markrich)Actually U can do this from client side. Using java script timer.
form.cal_value.value = $('calenderID').component.getSelectedDate();
-
2. Re: how can I get the updated date in my rich:calendar?
ilya_shaikovsky Jul 7, 2008 3:49 AM (in response to markrich)use onchanged instead of ondateselected. this change was described in our docs.
-
3. Re: how can I get the updated date in my rich:calendar?
markrich Jul 7, 2008 10:04 AM (in response to markrich)Thx your advise, ilya_shaikovsky.
it's okay now. -
4. Re: how can I get the updated date in my rich:calendar?
lenyas66 May 14, 2010 1:14 PM (in response to ilya_shaikovsky)Hi Ilya,
I noticed some problem with the way rich:calendar reacts to manual editing of this field.
Let's say, I selected the value "Mar-31-2010" from the calendar and it appears as the value.
If I reference it from JavaScript as follows:
var pubDate = ${rich:component('publishedDate')}.getSelectedDate();
It works just fine.
But, if I manually delete the value, so that calendar field appears empty, calling previous method returns old value!
Strange thing is that after I call it second time, it realizes that value has changed and works fine.
Note, that JavaScript function is triggered by the click of the button. So, it seems that calendar component is not reacting to the editing before clicking occurs first time.
Any suggestions?
Please see the code for calendar below.
<
rich:calendar id="publishedDate" value="#{piPublisherBean.publishDate}" datePattern="MM/dd/yyyy" popup="true"
cellWidth="24px" cellHeight="22px" enableManualInput="true">
<f:facet name="header">
<h:panelGrid columns="2" width="100%">
<h:outputText value="{selectedDateControl}" />
<h:outputText value="{todayControl}" />
</h:panelGrid>
</f:facet>
<f:facet name="weekDay">
<h:panelGroup>
<h:outputText value="{weekDayLabelShort}" />
</h:panelGroup>
</f:facet>
<f:facet name="footer">
<h:panelGrid columns="3" width="100%">
<h:outputText value="{previousMonthControl}" />
<h:outputText value="{currentMonthControl}" />
<h:outputText value="{nextMonthControl}" />
</h:panelGrid>
</f:facet>
<h:outputText value="{day}"></h:outputText>
<rich:beanValidator summary="Invalid date" />
</rich:calendar>
-
5. Re: how can I get the updated date in my rich:calendar?
ilya_shaikovsky May 15, 2010 7:09 AM (in response to lenyas66)yes, selected date object updated only while popup opening (parses input to discplay current) and selecting from popup(actual selection occurs).. and yes, unfortunatelly seems we lacks function which could read from input and parse according to date. so seems you need to get it from input using it's predefined id. (clientId + InputDate)
-
6. Re: how can I get the updated date in my rich:calendar?
lenyas66 May 15, 2010 7:32 AM (in response to ilya_shaikovsky)So, if the client Id is "publishedDate" in my example, you suggest to use something like that;
getElementById('publishedDateInputDate').value
Would is still be date or just a string?
On somewhat unrelated note, how do I disable showing week numbers in popup calendar? I didn't mention them in my calendar definition, but they are still showing by default.
-
7. Re: how can I get the updated date in my rich:calendar?
ilya_shaikovsky May 15, 2010 7:45 AM (in response to lenyas66)1) string
2)showWeeksBar