protected void onCmbSmokingStatusValueChanged() throws PresentationLogicException { if(form.ctnBreathing().cmbSmokingStatus().getValue() != null && form.ctnBreathing().cmbSmokingStatus().getValue().equals(SmokingStatus.NEVERSMOKED) && form.ctnBreathing().grdSmoking().getRows().size() > 0) form.ctnBreathing().cmbSmokingStatus().setValue(SmokingStatus.SMOKER); if(form.ctnBreathing().cmbSmokingStatus().getValue() != null && form.ctnBreathing().cmbSmokingStatus().getValue().equals(SmokingStatus.NEVERSMOKED)) { form.getContextMenus().getSmokingGridADDItem().setVisible(false); //WDEV-17082 form.getContextMenus().getSmokingGridREMOVEItem().setVisible(false); } else { form.getContextMenus().getSmokingGridADDItem().setVisible(true); //WDEV-17082 form.getContextMenus().getSmokingGridREMOVEItem().setVisible(form.ctnBreathing().grdSmoking().getSelectedRowIndex() != -1); } }
protected void onComboBoxStatusValueChanged() throws PresentationLogicException { //doesn't allow to change status from SMOKER TO NEVERSMOKED if there are entries in the grid if(form.comboBoxStatus().getValue() != null && form.comboBoxStatus().getValue().equals(SmokingStatus.NEVERSMOKED) && form.gridSmoking().getRows().size() > 0) form.comboBoxStatus().setValue(SmokingStatus.SMOKER); if(form.comboBoxStatus().getValue() != null && form.comboBoxStatus().getValue().equals(SmokingStatus.NEVERSMOKED)) { form.bSmoking().setEnabled(false); form.btnRemove().setEnabled(false); } else { form.bSmoking().setEnabled(true); form.btnRemove().setEnabled(true); } }
protected void onGrdSmokingDetailsGridComboBoxSelectionChanged(int column, grdSmokingDetailsRow row, Object value) throws PresentationLogicException { if (column == 0) { if (form.cmbSmokingStatus().getValue() == null || value == null || row == null) return; if (column == 0 && form.cmbSmokingStatus().getValue().equals(SmokingStatus.EXSMOKER) && !value.equals(SmokingCurrentHistoric.HISTORIC)) row.setColStatus(SmokingCurrentHistoric.HISTORIC); if (column == 0 && form.cmbSmokingStatus().getValue().equals(SmokingStatus.SMOKER) && row.getColStatus().equals(SmokingCurrentHistoric.CURRENT)) row.setColWhenStopped(null); if (row.getColStatus().equals(SmokingCurrentHistoric.CURRENT)) row.setColWhenStoppedReadOnly(true); else if (row.getColStatus().equals(SmokingCurrentHistoric.HISTORIC)) row.setColWhenStoppedReadOnly(false); } }
private void updateControlState() { form.ccAuthUser().setEnabled(form.getMode().equals(FormMode.EDIT)); if (form.getMode().equals(FormMode.VIEW)) { form.btnNew().setVisible(!form.getLocalContext().getCurrentRecordIsNotNull()); form.btnEdit().setVisible(form.getLocalContext().getCurrentRecordIsNotNull()); } else { boolean isSmoker = SmokingStatus.SMOKER.equals(form.cmbSmokStatus().getValue()); form.chkAdviceGiven().setEnabled(isSmoker); form.chkReffered().setEnabled(isSmoker); updateAllergyButton(); updateComorbidityButton(); } updateContextMenuState(); }
private void setSmokingControls(SmokingStatus status) { if(status!=null){ if(status.equals(SmokingStatus.EXSMOKER)){ form.intYearsStopped().setVisible(true); form.intYearsStopped().setEnabled(form.getMode().equals(FormMode.EDIT)); form.lblYearsStopped().setVisible(true); form.intDailyAmount().setVisible(false); form.lblDailyAmount().setVisible(false); form.intDailyAmount().setValue(null); return; } else if(status.equals(SmokingStatus.SMOKER)){ form.intYearsStopped().setVisible(false); form.lblYearsStopped().setVisible(false); form.intDailyAmount().setVisible(true); form.intDailyAmount().setEnabled(form.getMode().equals(FormMode.EDIT)); form.lblDailyAmount().setVisible(true); form.intYearsStopped().setValue(null); return; } else if(status.equals(SmokingStatus.NEVERSMOKED)){ form.intYearsStopped().setVisible(false); form.lblYearsStopped().setVisible(false); form.intDailyAmount().setVisible(false); form.lblDailyAmount().setVisible(false); form.intDailyAmount().setValue(null); form.intYearsStopped().setValue(null); return; } } form.intDailyAmount().setVisible(false); form.lblDailyAmount().setVisible(false); form.intDailyAmount().setValue(null); form.intYearsStopped().setVisible(false); form.lblYearsStopped().setVisible(false); form.intYearsStopped().setValue(null); }
protected void onGrdSmokingGridComboBoxSelectionChanged(int column, grdSmokingRow row, Object value) throws PresentationLogicException { if(form.ctnBreathing().cmbSmokingStatus().getValue() == null || value == null || row == null) return; if(column == 0 && form.ctnBreathing().cmbSmokingStatus().getValue().equals(SmokingStatus.EXSMOKER) && !value.equals(SmokingCurrentHistoric.HISTORIC)) row.setColStatus(SmokingCurrentHistoric.HISTORIC); if(column == 0 && form.ctnBreathing().cmbSmokingStatus().getValue().equals(SmokingStatus.SMOKER) && value.equals(SmokingCurrentHistoric.CURRENT)) row.setColWhenStopped(null); }
protected void onGridSmokingGridComboBoxSelectionChanged(int column, gridSmokingRow row, Object value) throws PresentationLogicException { if(form.comboBoxStatus().getValue() == null || value == null || row == null) return; if(column == 0 && form.comboBoxStatus().getValue().equals(SmokingStatus.EXSMOKER) && !value.equals(SmokingCurrentHistoric.HISTORIC)) row.setColStatus(SmokingCurrentHistoric.HISTORIC); if(column == 0 && form.comboBoxStatus().getValue().equals(SmokingStatus.SMOKER) && value.equals(SmokingCurrentHistoric.CURRENT)) row.setColWhenStopped(null); }
protected void onCmbSmokingStatusValueChanged() throws PresentationLogicException { //WDEV-16510 if (form.cmbSmokingStatus().getValue() == null) { form.grdSmokingDetails().getRows().clear(); } if (form.cmbSmokingStatus().getValue() != null && form.cmbSmokingStatus().getValue().equals(SmokingStatus.NEVERSMOKED) && form.grdSmokingDetails().getRows().size() > 0) form.cmbSmokingStatus().setValue(SmokingStatus.SMOKER); updateContextMenus(); }
private void updateContextMenus() { if (form.getMode().equals(FormMode.EDIT)) { if (form.cmbSmokingStatus().getValue() != null && (form.cmbSmokingStatus().getValue().equals(SmokingStatus.SMOKER) || form.cmbSmokingStatus().getValue().equals(SmokingStatus.EXSMOKER))) { form.getContextMenus().getGenericGridAddItem().setVisible(true); if (form.grdSmokingDetails().getSelectedRowIndex() >= 0) form.getContextMenus().getGenericGridRemoveItem().setVisible(true); else form.getContextMenus().getGenericGridRemoveItem().setVisible(false); } else { form.getContextMenus().getGenericGridAddItem().setVisible(false); form.getContextMenus().getGenericGridRemoveItem().setVisible(false); } form.getContextMenus().Core.getSocialHistoryGridAddItem().setVisible(true); if(form.grdIllicitDrugs().getSelectedRowIndex() >= 0) form.getContextMenus().Core.getSocialHistoryGridRemoveItem().setVisible(true); else form.getContextMenus().Core.getSocialHistoryGridRemoveItem().setVisible(false); } else { form.getContextMenus().getGenericGridAddItem().setVisible(false); form.getContextMenus().getGenericGridRemoveItem().setVisible(false); form.getContextMenus().Core.getSocialHistoryGridAddItem().setVisible(false); form.getContextMenus().Core.getSocialHistoryGridRemoveItem().setVisible(false); } }
@Override protected void onCmbSmokStatusValueChanged() throws PresentationLogicException { if (!SmokingStatus.SMOKER.equals(form.cmbSmokStatus().getValue())) { form.chkAdviceGiven().setValue(null); form.chkReffered().setValue(null); } updateControlState(); }