Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7996803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:47:48+00:00 2026-06-04T14:47:48+00:00

Using jsf I want to edit a employee profile, when user will click on

  • 0

Using jsf I want to edit a employee profile, when user will click on any particular datatable row,then

I am able to get all that deatils of selected patient in an
arraylist. Now I want to set all the attritbutes in arraylist to
page1.xhtml backingbean , so When user will select a particular row,
he will navigate to page1.xhtml where he will get all these fields in
the form set already by arraylist attributes.

I am trying in this way.

> page1.xhtml

    <h:outputLabel  value="Name" />
    <p:inputText id="name1" value="#{employeeBB.emp.name}" >
                            </p:inputText>

    <h:outputLabel  value="age" />
                            <p:inputText id="ag" value="#{employeeBB.emp.age}" >
                            </p:inputText>


    <h:outputLabel  value="code" />
                            <p:inputText id="code1" value="#{employeeBB.emp.code}" >
                            </p:inputText>


@ManagedBean(name = "employee") 
@ViewScoped 
public class emp {
private String name;    
private String age;     
private String code;    
public String getName() 
{       return name;    
}

public void setName(String name) { 
this.name = name;   
}

public String getAge() {
return age;     
}

public void setAge(String age) {
this.age = age;     
}

    public String getCode() {
    return code;    
    }

public void setCode(String code) {
this.code = code;   
}

 }


    @SessionScoped
    @ManagedBean
    public class EmployeeBB implements serializable{

    private Employe emp;

        public Employee getEmp() {
            return emp;
        }

        public void setEmp(Employee emp) {
            this.emp = emp;
        }



    }

    @SessionScoped
    @ManagedBean
    public class AddEmployeeBB{

    private ArrayList<Employee>empList;


    private ArrayList<Employee>empList;


        public ArrayList<Employee> getEmpList() {
            if(empList==null){

                empList=new ArrayList<Employee>();
            }

            return empList;
        }

        public void setEmpList(ArrayList<Employee> empList) {
            this.empList = empList;
        }

    public void method() throws IOException{

    String code='123';

    EmployeeDAO obj=new EmployeeDAO();   // DAO class 

    empList=obj.getAllEmplInfo(code); // will get all needed information about employee of this code in this arrayist 

    for(int i=0;i<empList.size();i++){

    String name=empList.get(i).getName();
    String age=empList.get(i).getAge();
    String code=empList.get(i).getCode();

    Employee e=new Employee();

    e.setName(name);
    e.setAge(age);
    e.setCode(code);

    EmployeeBB obj1=new EmployeeBB();

    obj1.setEmp(e);  // now according to my logic object e will set to emp object of Employee, and 
    // that means  all these values name ,agem and code will be set to my  page1.xhtml and I will be able to see it.



    }

    }

But I am unable to get pag1.xhtml with filled values.

Show me the way.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T14:47:50+00:00Added an answer on June 4, 2026 at 2:47 pm

    The reason for it not being shown is that you are setting values in a object which you are creating

    EmployeeBB obj1=new EmployeeBB();
    
    obj1.setEmp(e);
    

    JSF lifecycle doens’t know about this object and everytime you are seeing blank.

    In AddEmployeeBB add this

    @ManagedProperty(value="employeeBB")
    private EmployeeBB employeeBB = null; // create getter setter for this
    

    then instead of this :

    EmployeeBB obj1=new EmployeeBB();
    
    obj1.setEmp(e);
    

    Use this:

    this.employeeBB.setEmp(e);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using JSF and I have a complex datatable where the user can sort
I want to perform the following task using JSF / Richfaces On click of
I'm using Richfaces JSF and I want to iterate over an Map<Object,Object> . I
I want to dynamically create controls in my bean. I am using JSF 2.0
I'm using JSF 2.0 and want to fill a selectOneMenu with the values of
I am working on a web app using JSF w/Seam. I want to be
I want to look at using JSF but I'm put off by what appears
I'm using JSF 2.0 with Facelets and I want to do something like this:
I am using JSF, richfaces 4 stuff and i want to call a bean
I am using JSF 2.0, PF 3.0M3 and GF 2.1. I want to upload

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.