Sunday, May 29, 2011

How to get the Page Id in Oracle ADF

Hi,

Another quicky today. How to get the page id of current page in Java.

lets have a quick look


//get the Context
FacesContext fctx = FacesContext.getCurrentInstance();

//get the Page id in String
String viewId = fctx.getViewRoot().getViewId();

//Display Id in Message
FacesMessage message = new FacesMessage("Hello Page no "+viewId);
fctx.addMessage(null,message);

Have a nice day,
Zeeshan Baig

1 comment:

  1. I've created a JFrame in bean class. I want to display that JFrame inside the current page. How can i do it.?

    ReplyDelete