public boolean validate() {
return true;
}
public Object viewToObj(Object obj) {
Mechanic var = new Mechanic();
if (obj != null) {
try {
BeanUtils.copyProperties(var, obj);
} catch (Exception iae) {
iae.printStackTrace();
}
}
Radiogroup hasCitizenshipRG = (Radiogroup) getFellow("hasCitizenship");
Textbox mechanicNameTB = (Textbox) getFellow("mechanicName");
Textbox uniIdTB = (Textbox) getFellow("uniId");
Combobox companyCB = (Combobox) getFellow("company");
Radiogroup sexRG = (Radiogroup) getFellow("sex");
var.setHasCitizenship(
hasCitizenshipRG.getSelectedItem().getValue());
var.setMechanicName(mechanicNameTB.getText());
var.setUniId(uniIdTB.getText());
if (companyCB.getSelectedItem() != null) {
var.setCompany((Org) companyCB.getSelectedItem().getValue());
}
var.setSex(sexRG.getSelectedItem().getValue());
Datebox birthdayDB = (Datebox) getFellow("birthday");
Textbox homePhoneTB = (Textbox) getFellow("homePhone");
Textbox mobileTB = (Textbox) getFellow("mobile");
Textbox informPeopleTB = (Textbox) getFellow("informPeople");
Textbox relationTB = (Textbox) getFellow("relation");
var.setBirthday(birthdayDB.getValue());
var.setHomePhone(homePhoneTB.getText());
var.setMobile(mobileTB.getText());
var.setInformPeople(informPeopleTB.getText());
var.setRelation(relationTB.getText());
Textbox informPhoneTB = (Textbox) getFellow("informPhone");
Textbox deliveryZipTB = (Textbox) getFellow("deliveryZip");
Textbox deliveryAddressTB = (Textbox) getFellow("deliveryAddress");
Textbox billZipTB = (Textbox) getFellow("billZip");
Textbox billAddressTB = (Textbox) getFellow("billAddress");
var.setInformPhone(informPhoneTB.getText());
var.setDeliveryZip(deliveryZipTB.getText());
var.setDeliveryAddress(deliveryAddressTB.getText());
var.setBillZip(billZipTB.getText());
var.setBillAddress(billAddressTB.getText());
return var;
}