Showing posts with label Date. Show all posts
Showing posts with label Date. Show all posts

Saturday 30 August 2014

Current Date and Time in ADF

Hello fellas,
today i'm sharing my learning to how to show current date and time in adf

First take a JSF(jspx) page and take a output field, 
create a managed bean, of the type Date(by extending java.util.Date),
make, value of the output field of the type of your bean



output will be like this,

use a convert date and time in the output field used. by searching it from component pallete and choose this one as we are using jspx.



use poll from the operations under component palette, set interval of the poll to 1000,



make a bind variable name,  create getters and setters.
select the poll from the structure, and go to the poll listner, and connect this listener to this  refreshPage method
bind the output text to the dates variable provided. 



code to be provided.
    public void refreshPage(PollEvent pollEvent) {
        refresh();
        AdfFacesContext.getCurrentInstance().addPartialTarget(dates);
    }
        protected void refresh() {
            FacesContext ctx = FacesContext.getCurrentInstance();
            String refreshpage = ctx.getViewRoot().getViewId();
            ViewHandler views = ctx.getApplication().getViewHandler();
            UIViewRoot view = views.createView(ctx, refreshpage);
            view.setViewId(refreshpage);
            ctx.setViewRoot(view);
        }


run the page.
you can download the application from here App 

thank you :)

Friday 29 August 2014

Disable Future Date on ADF Page

Hello Fellas,
today i'm sharing my learning, to how to Disable future date on our ADF page.

Take a Input date component on your page.
Make a managed bean, and simply create a method, and put this snipet of code on your bean,


    public Date getDate()      {            Date date=new Date(new java.sql.Date(new java.util.Date().getTime()));            return date;            }  

make the date of type oracle.jbo.domain.Date 
you can get the actual java class from this link     .XBean.java 

and make max value of the input date component from the source code.





actual result





thank you :)


you can download the actual code from here

FutureDateApp

A Guide to Installing Oracle HR Schema on an Existing Docker Container

  Hi Reader, Today I want to share my learning on how to install Oracle HR schema on a existing docker container. Step 1: Download the verif...