RaulDM
15 Jun 2009, 2:59 AM
I have a Grid which is holding Person Records.
My Person Bean:
public class person{
int id;
String name;
Department dept;
public void setId(String id){id=id;}
public String getId(){return id;}
public void setName(String name){name = name;}
public String getName(){return name;}
public void setDepartment(Department d){dept=d;}
public Department getDepartment(){return dept;}
}
My Department Class
public class Department{
int id;
int name;
public void setId(String id){id=id;}
public String getId(){return id;}
public void setName(String name){name=name;}
public String getName(){return name;}
}
Now my Grid is holding the list of Persons and it has columns like:
Person Name Department Name
John CSE
Mac ENT
Robert Instrumentation
And I have a form which is bind with this Grid via form Binding and it looks like
Person Name: <-----------------Text Field
Department name : <-----------------Combox Box
I bind the Grid with my form and when I click the row contains Robert, the Person Name field of my Form displays Robert, but the Department name Combo does not showing anything.
The Depart name combo has been populated with the Bean Model data created from the Department Bean, and thus it holds the name of all the existing departments.
Now what I want to do is to when I select a row in my Grid, say Row having the person name Robert, the Department name Combo Box should force its selection to the department to which Robert belongs.
How can I do this..??
Plz help...!!
Raul
My Person Bean:
public class person{
int id;
String name;
Department dept;
public void setId(String id){id=id;}
public String getId(){return id;}
public void setName(String name){name = name;}
public String getName(){return name;}
public void setDepartment(Department d){dept=d;}
public Department getDepartment(){return dept;}
}
My Department Class
public class Department{
int id;
int name;
public void setId(String id){id=id;}
public String getId(){return id;}
public void setName(String name){name=name;}
public String getName(){return name;}
}
Now my Grid is holding the list of Persons and it has columns like:
Person Name Department Name
John CSE
Mac ENT
Robert Instrumentation
And I have a form which is bind with this Grid via form Binding and it looks like
Person Name: <-----------------Text Field
Department name : <-----------------Combox Box
I bind the Grid with my form and when I click the row contains Robert, the Person Name field of my Form displays Robert, but the Department name Combo does not showing anything.
The Depart name combo has been populated with the Bean Model data created from the Department Bean, and thus it holds the name of all the existing departments.
Now what I want to do is to when I select a row in my Grid, say Row having the person name Robert, the Department name Combo Box should force its selection to the department to which Robert belongs.
How can I do this..??
Plz help...!!
Raul