return obj;
}
public void objToView(Object obj) {
EquipmentForm var = (EquipmentForm) obj;
Radiogroup isEquipment = (Radiogroup) getFellow("isEquipment");
Textbox equipmentNameTB = (Textbox) getFellow("equipmentName");
Combobox supplierIdCB = (Combobox) getFellow("supplierId");
Textbox pccCodeTB = (Textbox) getFellow("pccCode");
Textbox venderCodeTB = (Textbox) getFellow("venderCode");
Iterator it = isEquipment.getItems().iterator();
while (it.hasNext()) {
Radio radio = (Radio) it.next();
if (radio.getValue().equals(var.getIsEquipment())) {
radio.setChecked(true);
}
}
equipmentNameTB.setText(var.getEquipmentName());
Iterator supplierIt = supplierIdCB.getItems().iterator();
while (supplierIt.hasNext()) {
Comboitem item = (Comboitem) supplierIt.next();
Supplier s = (Supplier) item.getValue();
if (var.getSupplierId() != null && var.getSupplierId() == s.getSupplierId()) {
supplierIdCB.setSelectedItem(item);
}
}
pccCodeTB.setText(var.getPccCode());
venderCodeTB.setText(var.getVenderCode());
Textbox insideCodeTB = (Textbox) getFellow("insideCode");
Combobox priorityCB = (Combobox) getFellow("priority");
Doublebox latestPriceTB = (Doublebox) getFellow("latestPrice");
Intbox inventoryAmountTB = (Intbox) getFellow("inventoryAmount");
Combobox systemTypeCB = (Combobox) getFellow("system");
insideCodeTB.setText(var.getInsideCode());
Iterator priorityIt = priorityCB.getItems().iterator();
while (priorityIt.hasNext()) {
Comboitem item = (Comboitem) priorityIt.next();
String priorityStr = item.getValue().toString();
if (var.getPriority() != null && var.getPriority().equals(priorityStr)) {
priorityCB.setSelectedItem(item);
}
}
latestPriceTB.setValue(var.getLatestPrice());
inventoryAmountTB.setValue(var.getInventoryAmount());
Iterator stItr = systemTypeCB.getItems().iterator();
while (stItr.hasNext()) {
Comboitem item = (Comboitem) stItr.next();
String s = (String) item.getValue();
if (s.equals(var.getSystemType())) {
systemTypeCB.setSelectedItem(item);
}
}
}