I am puzzled with these results with a table component.
when i use
for (int i = 0; i < listOfTicketsVector.size(); i++)
{
String employeeNo =listOfTicketsVector.get(i).getEmployeeNo();
String firstName = listOfTicketsVector.get(i).getFirstName();
String lastName = listOfTicketsVector.get(i).getLastName();
String name = firstName + " " + lastName;
String gender = listOfTicketsVector.get(i).getGender();
String nationality = listOfTicketsVector.get(i).getNationality();
String maritalStatus = listOfTicketsVector.get(i).getMaritalStatus();
String position = listOfTicketsVector.get(i).getPosition();
String employmentType = listOfTicketsVector.get(i).getEmploymentType();
listOfEmployeesTable.addItem(new Object[] { employeeNo, name, gender, nationality, maritalStatus, position, employmentType}, new Integer(i));
}
listPanel.addComponent(listOfEmployeesTable);
setCompositionRoot(listPanel);
The table shows the values
but when i use this code
for (int i = 0; i < employeeListVector.size(); i++)
{
Employee emp = new Employee();
emp = employeeListVector.get(i);
String employeeNo = emp.getEmployeeNo();
String firstName = emp.getFirstName();
String lastName = emp.getLastName();
String name = firstName + " " + lastName;
String gender = emp.getGender();
String nationality = emp.getNationality();
String maritalStatus = emp.getMaritalStatus();
String position = emp.getPosition();
String employmentType = emp.getEmploymentType();
listOfEmployeesTable.addItem(new Object[] { employeeNo, name, gender, nationality, maritalStatus, position,employmentType },new Integer(i));
}
listPanel.addComponent(listOfEmployeesTable);
setCompositionRoot(listPanel);
the table shows no values.
So pliz what is the issue here…
I got my table working by the previous method so i wonder why the second should return nothing??
while the difference is only
Employee emp = new Employee();
emp = employeeListVector.get(i);
String employeeNo = emp.getEmployeeNo();
from this one
String employeeNo =listOfTicketsVector.get(i).getEmployeeNo();