/** * Function used to update the local context with selected 'MDT Meeting' record * and populate screen based on selected record * * @param mdtMeeting - The 'MDT Meeting' record to be considered selected */ private void updateSelection(MDTMeetingLiteVo mdtMeeting) { // Set selection in local context form.getLocalContext().setCurrentMDTMeeting(domain.getMDTMeeting(mdtMeeting)); // Populate instance controls populateInstanceControlsFromData(form.getLocalContext().getCurrentMDTMeeting()); }
/** * Function used to populate MDT Meeting records to MDT grid * @param mdtMeetingRecords - Records that will be populated to MDT grid */ private void populateMDTMeetingGrid(MDTMeetingLiteVoCollection mdtMeetingRecords) { // Clear grid & instance controls clearDataControls(); // Check 'MDT Meeting' records collection parameter if (mdtMeetingRecords == null) return; // Populate 'MDT Meeting' records to grid for (MDTMeetingLiteVo mdtMeeting : mdtMeetingRecords) { grdMDTRow mdtRow = form.grdMDT().getRows().newRow(); mdtRow.setColDate(mdtMeeting.getMDTMeetingDate().toString()); mdtRow.setValue(mdtMeeting); } form.grdMDT().setValue(form.getLocalContext().getCurrentMDTMeeting()); if (mdtMeetingRecords.size() > 0) { if (form.grdMDT().getValue() == null) { form.grdMDT().setValue(mdtMeetingRecords.get(0)); } form.getLocalContext().setLatestMDTMeeting(mdtMeetingRecords.get(0)); } updateSelection(form.grdMDT().getValue()); }