// add to the domain about data import type:
// - supplier prices
res = ClientUtils.getData("loadSupplierPricelists",new GridParams());
if (!res.isError()) {
SupplierPricelistVO vo = null;
java.util.List list = ((VOListResponse)res).getRows();
for(int i=0;i<list.size();i++) {
vo = (SupplierPricelistVO)list.get(i);
ditVO = new DataImportType();
ditVO.comboItemIndex = pos++;
ditVO.subTypeCode = vo.getPricelistCodePUR03();
ditVO.subTypeCode2 = vo.getProgressiveReg04PUR03();
ditVO.className = ImportSupplierPricesDescriptorVO.class.getName();
ditVO.companyCodeSys01 = vo.getCompanyCodeSys01PUR03();
dit.addDomainPair(
ditVO,
ClientSettings.getInstance().getResources().getResource("import prices")+" "+
ClientSettings.getInstance().getResources().getResource("for supplier")+" "+
vo.getName_1REG04()+" "+
ClientSettings.getInstance().getResources().getResource("in pricelist")+" "+vo.getDescriptionSYS10()
);
}
}
controlImportType.setDomain(dit);
controlImportType.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange()==e.SELECTED) {
DataImportType vo = (DataImportType)controlImportType.getValue();
ETLProcessVO processVO = (ETLProcessVO)mainPanel.getVOModel().getValueObject();
processVO.setCompanyCodeSys01SYS23(vo.companyCodeSys01);
processVO.setClassNameSYS23(vo.className);
processVO.setProgressiveHIE02(vo.progressiveHIE02);
processVO.setSubTypeValueSYS23(vo.subTypeCode);
processVO.setSubTypeValue2SYS23(vo.subTypeCode2);
grid.clearData();
grid.getOtherGridParams().put(ApplicationConsts.FILTER_VO,processVO);
grid.reloadData();
grid.setMode(Consts.EDIT);
controlDescr.setValue(controlImportType.getComboBox().getSelectedItem());
}
}
});
Domain d = new Domain("FILE_TYPES");
d.addDomainPair(XLS,"Excel");
d.addDomainPair(CSV1,"CSV(;)");
d.addDomainPair(CSV2,"CSV(,)");
d.addDomainPair(TXT,"Txt file");
controlFormat.setDomain(d);
controlFormat.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange()==e.SELECTED) {
ETLProcessVO vo = (ETLProcessVO)getMainPanel().getVOModel().getValueObject();
vo.setLocalFile(null);
controlLocalFile.setText("");
controlRemoteFile.setText("");
}
}