-
1. Re: updating dynamically date in calendar
pourmo Oct 31, 2007 1:01 PM (in response to marc1)Hi
I had an issue where, my calendar was not updating my back bean, even though inside an output panel, I had to use ajax support as show below, perhaps you need to do the same thing.<rich:calendar id="startDate" inputStyle="width:100px;" datePattern="dd/MM/yyyy" inputType="text" enableManualInput="true" value="#{startDate}" popup="true"> <a:support event="ondateselected" action="submit()" /> </rich:calendar>
-
2. Re: updating dynamically date in calendar
dmitry.demyankov Oct 31, 2007 4:52 PM (in response to marc1)The following code snippet worked fine..
JSP:<h:form> <a4j:commandButton id="add_day_btn" value="add day" action="#{testBean.TestMethod}" reRender="panel, calendar"/> </h:form> <h:panelGrid id="panel"> <h:outputText value="#{testBean.date}"/> </h:panelGrid> <rich:calendar id="calendar" value="#{testBean.date}" popup="true" datePattern="dd.MM.yyyy"/>
TestBean contains date property with simple get/set methods. Inside TestMethod of TestBean one day is added to the current value of date. Very simple..
Both panel and rich:calendar are reRendered and correct value of date property is displayed.
What is the scope of your bean? What exactly are you trying to archive - is it changing currently displayed date in calendar or submitting new date selected in calendar? -
3. Re: updating dynamically date in calendar
marc1 Nov 1, 2007 7:29 AM (in response to marc1)yes, im trying smth simple, similar to what you described. a backing bean changes some date thru a widget, an forces thru a reRender the calendar widget to redisplay that date - and that is not happening :-( . the backing bean returns the updated date though, as i can tell from my output log. everything else works just fine. it looked to me as if the calendar refused for ssome reason to update programatically that date.
im using release 3.1.3. snapshot from about two weeks ago.
marcelo -
4. Re: updating dynamically date in calendar
dmitry.demyankov Nov 1, 2007 2:39 PM (in response to marc1)My code example worked with 3.1.2GA version. Maybe I'll try it with 3.1.3