public JournalFilterFrame() { try { jbInit(); // set domain in combo box... ClientApplet applet = ((ApplicationClientFacade) MDIFrame.getInstance().getClientFacade()).getMainClass(); ButtonCompanyAuthorizations bca = applet.getAuthorizations().getCompanyBa(); ArrayList companiesList = bca.getCompaniesList("ACC05"); Domain domain = new Domain("DOMAIN_ACC05"); for (int i = 0; i < companiesList.size(); i++) { if (applet .getAuthorizations() .getCompanyBa() .isInsertEnabled("ACC05", companiesList.get(i).toString())) domain.addDomainPair(companiesList.get(i), companiesList.get(i).toString()); } controlCompaniesCombo.setDomain(domain); controlCompaniesCombo.getComboBox().setSelectedIndex(0); setSize(400, 200); MDIFrame.getInstance().add(this); } catch (Exception e) { e.printStackTrace(); } }
/** Retrieve item types and fill in the item types combo box. */ private void init() { Response res = ClientUtils.getData("loadItemTypes", new GridParams()); Domain d = new Domain("ITEM_TYPES"); if (!res.isError()) { ItemTypeVO vo = null; list = ((VOListResponse) res).getRows(); for (int i = 0; i < list.size(); i++) { vo = (ItemTypeVO) list.get(i); d.addDomainPair(vo.getProgressiveHie02ITM02(), vo.getDescriptionSYS10()); } } controlHierarchy.setDomain(d); controlHierarchy .getComboBox() .addItemListener( new ItemListener() { public void itemStateChanged(ItemEvent e) { if (e.getStateChange() == e.SELECTED) { ItemTypeVO typeVO = (ItemTypeVO) list.get(controlHierarchy.getSelectedIndex()); treePanel.setCompanyCode(typeVO.getCompanyCodeSys01ITM02()); treePanel.setProgressiveHIE02((BigDecimal) controlHierarchy.getValue()); DetailSupplierVO vo = (DetailSupplierVO) supplierPanel.getVOModel().getValueObject(); treePanel.setCompanyCode(vo.getCompanyCodeSys01REG04()); treePanel.reloadTree(); itemsGrid.clearData(); } } }); if (d.getDomainPairList().length == 1) controlHierarchy.getComboBox().setSelectedIndex(0); else controlHierarchy.getComboBox().setSelectedIndex(-1); }