* Retrieve item types and fill in the item types combo box and
* set buttons disabilitation...
*/
private void init() {
Response res = ClientUtils.getData("loadItemTypes",new GridParams());
final Domain d = new Domain("ITEM_TYPES");
if (!res.isError()) {
ItemTypeVO vo = null;
java.util.List list = ((VOListResponse)res).getRows();
for(int i=0;i<list.size();i++) {
vo = (ItemTypeVO)list.get(i);
d.addDomainPair(vo.getProgressiveHie02ITM02(),vo.getDescriptionSYS10());
}
}
controlItemType.setDomain(d);
controlItemType.getComboBox().addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange()==e.SELECTED && detailPanel.getMode()!=Consts.READONLY) {
DetailPurchaseDocRowVO vo = (DetailPurchaseDocRowVO)detailPanel.getVOModel().getValueObject();
vo.setItemCodeItm01DOC07(null);
vo.setDescriptionSYS10(null);
vo.setUmCodePur02DOC07(null);
vo.setVatCodeItm01DOC07(null);
vo.setVatDescriptionDOC07(null);
vo.setDeductibleReg01DOC07(null);
vo.setValueReg01DOC07(null);
vo.setValuePur04DOC07(null);
vo.setQtyDOC07(null);
int selIndex = ((JComboBox)e.getSource()).getSelectedIndex();
Object selValue = d.getDomainPairList()[selIndex].getCode();
treeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01DOC07());
treeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.PROGRESSIVE_HIE02,selValue);
}
}
});