Friday, July 27, 2012

JSF : Redirect / EOImpl

public void setRedirect(String page){
FacesContext context = FacesContext.getCurrentInstance();
String myPage = "./"+page+".jspx";
try {
context.getExternalContext().redirect(myPage);
} catch (IOException ex) {
System.out.println(ex.getMessage());
}
}
---------------------------------------
Need to Put this Code in EOImpl.java
    public Number getCurrentEmployeeId() {
      BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
      AttributeBinding attr = (AttributeBinding)bindings.getControlBinding("EmployeeId"); 
      return (Number)attr.getInputValue();
    }