@AfterCompose public void doAfterCompose( @ContextParam(ContextType.VIEW) Component view, @ExecutionArgParam("map") Map<String, Object> parameters) { Selectors.wireComponents(view, this, false); this.view = view; userName = FHSessionUtil.getCurrentUser().getUserLoginID(); listBoxViewModel = new ListboxViewModel(); allReordsInDB = new ListModelList<>(); getDataRecordList(); for (Jobdetails up : allReords) { allReordsInDB.add(up); } // allReordsInDB.setMultiple(true); listBoxViewModel.setModel(allReordsInDB); // loadUserTabs(); if (usertabs != null && listBoxViewModel.getModel().size() > 0) { if (selectedItem != null) loadDetailPageTab(selectedItem); else { selectedItem = new Jobdetails(); loadDetailPageTab(selectedItem); } } else { selectedItem = new Jobdetails(); loadDetailPageTab(selectedItem); } }
@Command @NotifyChange("usertabs") public void loadDetailPageTab() { if (!listBoxViewModel.getSelectedListItem().isEmpty()) { for (Iterator itr = listBoxViewModel.getSelectedListItem().iterator(); itr.hasNext(); ) { Jobdetails data = (Jobdetails) itr.next(); loadDetailPageTab(data); } } }
@NotifyChange("*") @Command public void addNewJobDetail() { Jobdetails selectedrecord = new Jobdetails(); if (listBoxViewModel.getModel() == null) { listBoxViewModel.setModel(new ListModelList<>()); } listBoxViewModel.getModel().add(selectedrecord); listBoxViewModel.setSelectItem(selectedrecord); loadDetailPageTab(selectedrecord); }
@Command @NotifyChange("*") public void refresh() { getDataRecordList(); allReordsInDB.removeAll(allReordsInDB); for (Jobdetails up : allReords) { allReordsInDB.add(up); } listBoxViewModel.setModel(allReordsInDB); if (usertabs != null && listBoxViewModel.getModel().size() > 0) { this.selectedItem = (Jobdetails) listBoxViewModel.getModel().get(0); loadDetailPageTab(selectedItem); } }