Package org.brain.bean

Source Code of org.brain.bean.NavBean

package org.brain.bean;

import javax.faces.application.ConfigurableNavigationHandler;
import javax.faces.application.NavigationCase;
import javax.faces.application.NavigationHandler;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.context.FacesContext;

import org.brain.tool.ToolBean;

@ManagedBean(name="navBean")
@RequestScoped
public class NavBean {
 
  public String URL;
  public String LoadURL()
  {
    String id;
    id = ToolBean.getRequestParameter("id");
    FacesContext fc = FacesContext.getCurrentInstance();
    NavigationHandler nh = fc.getApplication().getNavigationHandler();
      ConfigurableNavigationHandler navigationHandler = (ConfigurableNavigationHandler) nh;

          NavigationCase navCase = navigationHandler.getNavigationCase(fc, null,"DataTable.xhtml?id"+id);
   
    return navCase.getToViewId(fc);
  }

  public String getURL() {
    URL = LoadURL();
    return URL;
  }

  public void setURL(String uRL) {
    URL = uRL;
  }
 

}
TOP

Related Classes of org.brain.bean.NavBean

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.