-
1. Re: Default populate rich:calendar with today date on page load?
ilya_shaikovsky Oct 8, 2010 6:05 AM (in response to boy18nj)so just define value of the calendar attribute to today date by default.
-
2. Re: Default populate rich:calendar with today date on page load?
boy18nj Oct 8, 2010 10:53 AM (in response to ilya_shaikovsky)Hi Ilya,
There is no "calendar" attribute. Do you mean "currentDate" attribute ? What would be its value?
-
3. Re: Default populate rich:calendar with today date on page load?
boy18nj Oct 8, 2010 2:05 PM (in response to boy18nj)If you mean set the "value" attribute to today date. Then how would I bind the value to a bean.
-
4. Re: Default populate rich:calendar with today date on page load?
muneeswaranbalu Oct 11, 2010 2:18 AM (in response to boy18nj)Hi Aman,
At first you create HTMLForm variable in Bean and make getter,setter method for that variable and in the getter method you call one method.Then,Bind the varible with the form like using binding attribute.By this,that method is automatically called when you will enter into the page.
You just put the date variable in the Bean and initialize the date variable as Date date=new Date(); in the method which is called in the getttermethod of html form.You will get te current date at the time of initialization.
-
5. Re: Default populate rich:calendar with today date on page load?
ilya_shaikovsky Oct 11, 2010 6:27 AM (in response to boy18nj)still not see the problem.
<calendar value = "#{bean.date}"/>
where bean.date property has default value on server side. Which will be updated after submit with choosen one.
-
6. Re: Default populate rich:calendar with today date on page load?
davestar Nov 3, 2010 12:50 PM (in response to muneeswaranbalu)Thanks for the useful response. If I returned the current date in the getter method, I may not want the same behaviour for that field in other seam pages. For eg: On an edit or create page it is useful to have the getter method return the current date so that the user need not enter the 'created date' but on a list page however you do not want to display current date instead you want it to show the 'created date'.
As Aman has asked earlier, is the "currentDate" attribute useful for such a requirement? how can you use the "currentDate" attribute? what value do you set for that attribute? Thanks!!!
-
7. Re: Default populate rich:calendar with today date on page load?
ilya_shaikovsky Nov 4, 2010 9:55 AM (in response to davestar)first should be resolved using different Beans initiated for different pages
currentDate - only talls at which month calendar wil lbe opened in inline mode when there is no value.