i already write a code like this.Is my coding right?:
PropertyInfo pInfo = PropertyInfoDAO.loadPropertyInfoByORMID(this.getSessionBean1().getPropertyID());
User[] userList = UserDAO.listUserByQuery(null,null);
Option[] optUser = new Option [userList.length];
int y = 0;
for (int i=0; i<userList.length; i++){
if (userList[i].inCharge.contains(pInfo)){
//condition
else {
//condition
i query apartment id using below code:
PropertyInfo pInfo = PropertyInfoDAO.loadPropertyInfoByORMID(this.getSessionBean1().getPropertyID());
Actually i have 2 pages which is the previous page have a list of apartment.I create link for apartment name,then when i click that link,such as i click link for apartment A,it will go to the next page which contains a residents list for apartment A.
I put resident list in listbox component.I use 2 listboxes. I name it listbbox1 and listbox2.If michael is resident for apartment A,his name will appear in listbox1 and john and sarah will appear in listbox2 because they are not resident for aparment A.
The case is same for apartment B. Sarah and Michael will appear in listbox1 but michael will appear in listbox 2 becase michael is not resident for apartmentB