In this tutorial, I am going to explain that how to show current date and time on page in your Oracle ADF application.
Follow these Steps-
- Create a fusion web application and a page in it (i have used .jspx page)
- Now drag an output text from the component palette and drop it on page
- Now select the output text and go to its property inspector then select the value from Expression Builder as shown in the image
- Now in Expression Builder, create a Managed Bean of type java.util.Date and assign its value to output text
- Now run your page and see the current date is there
- Now to format Date and Time , drag and drop af:convertDateTime under output text from the component palette
- Select convertDateTime and go to property inspector and change its pattern and run your page
- Now you have done basic configuration for Date/Time, if you want to refresh time (second and minute part) on page periodically then drop a poll component in the page and create a poll listener in the managed bean
- Now write this simple code in your managed bean to invoke poll listener
And don’t forget to set clientComponent property of outputText to true
- Now Run your application, see in this video clip how your page gets refreshed.
Cheers 🙂 Happy Learning
An Oracle ACE, Blogger, Reviewer, Technical Lead working on Oracle ADF