private boolean newChildNode(RoomDetailsVo voRoomDetails) { if (form.getLocalContext().getvoRoomDetails() != null) return false; if (voRoomDetails.countFieldsWithValue() >= 1) { String strErrors[] = voRoomDetails.validate(); if (strErrors != null && strErrors.length > 0) { engine.showErrors(strErrors); return false; } promoteChild(voRoomDetails); clearInstanceControls(); } return true; }
private void populateChildNode(grdRoomsRow row, RoomDetailsVo voRoomDetails) { if (voRoomDetails == null) return; row.setValue(voRoomDetails); if (voRoomDetails.getLocationIsNotNull()) row.setcolLocation(voRoomDetails.getLocation().toString()); if (voRoomDetails.getEnvironmentVisitRoomTypeIsNotNull()) row.setcolType(voRoomDetails.getEnvironmentVisitRoomType().toString()); if (voRoomDetails.getAccessIsNotNull()) row.setcolAccess(voRoomDetails.getAccess().toString()); if (voRoomDetails.getDoorWidthIsNotNull()) row.setcolDoorWidth(voRoomDetails.getDoorWidth().toString()); if (voRoomDetails.getUnitOfMeasureIsNotNull()) row.setColUnit(voRoomDetails.getUnitOfMeasure().getText()); if (voRoomDetails.getRoomDetailsIsNotNull()) row.setcolComment(voRoomDetails.getRoomDetails()); // if not saved then set the colour if (voRoomDetails.getID_RoomDetails() == null) row.setTextColor(Color.Red); }
private void updateInstance() { // get selected row and disable all the others grdRoomsRow row = form.grdRooms().getSelectedRow(); for (int i = 0; i < form.grdRooms().getRows().size(); i++) form.grdRooms().getRows().get(i).setSelectable(false); row.setSelectable(true); RoomDetailsVo voCachedChild = form.grdRooms().getValue(); if (voCachedChild.getID_RoomDetails() == null) { populateChildInstanceControls(voCachedChild); } form.getLocalContext().setvoRoomDetails(voCachedChild); form.setMode(FormMode.EDIT); form.ctnDetails().setCollapsed(false); }
private boolean newChildNode(RoomDetailsVo voRoomDetails) { if (form.getLocalContext().getRoomDetail() != null) return false; if (voRoomDetails.countFieldsWithValue() >= 1) { String strErrors[] = voRoomDetails.validate(); if (strErrors != null && strErrors.length > 0) { engine.showErrors(strErrors); return false; } promoteChild(voRoomDetails); clearInstanceControls(); } return true; }
private void updateInstance() { // get selected row and disable all the others gridRoomsRow row = form.gridRooms().getSelectedRow(); for (int i = 0; i < form.gridRooms().getRows().size(); i++) form.gridRooms().getRows().get(i).setSelectable(false); row.setSelectable(true); RoomDetailsVo voCachedChild = form.gridRooms().getValue(); if (voCachedChild.getID_RoomDetails() == null) { populateChildInstanceControls(voCachedChild); } form.getLocalContext().setRoomDetail(voCachedChild); form.setMode(FormMode.EDIT); form.ctnDetails().setCollapsed(false); }
private RoomDetailsVo populateChildInstanceData(RoomDetailsVo voRoomDetails) { voRoomDetails.setAccess(form.ctnDetails().txtAccess().getValue()); voRoomDetails.setDoorWidth(form.ctnDetails().intDoorWidth().getValue()); voRoomDetails.setUnitOfMeasure(form.ctnDetails().cmbUnit().getValue()); voRoomDetails.setLocation(form.ctnDetails().cmbLocation().getValue()); voRoomDetails.setRoomDetails(form.ctnDetails().txtDetails().getValue()); voRoomDetails.setEnvironmentVisitRoomType(form.ctnDetails().cmbType().getValue()); return voRoomDetails; }
private void populateChildInstanceControls(RoomDetailsVo voRoomDetails) { if (voRoomDetails == null) return; form.ctnDetails().cmbLocation().setValue(voRoomDetails.getLocation()); form.ctnDetails().cmbType().setValue(voRoomDetails.getEnvironmentVisitRoomType()); form.ctnDetails().txtAccess().setValue(voRoomDetails.getAccess()); form.ctnDetails().intDoorWidth().setValue(voRoomDetails.getDoorWidth()); form.ctnDetails().cmbUnit().setValue(voRoomDetails.getUnitOfMeasure()); form.ctnDetails().txtDetails().setValue(voRoomDetails.getRoomDetails()); }
private boolean widthAndUnitEntered(EnvironmentalVisitVo voEnvironmentalVisit) { // for add if (voEnvironmentalVisit == null) { if (form.ctnDetails().intDoorWidth().getValue() != null) { if (form.ctnDetails().cmbUnit().getValue() != null) return true; else return false; } else { if (form.ctnDetails().cmbUnit().getValue() != null) return false; } } // for save else { for (int i = 0; i < voEnvironmentalVisit.getRooms().size(); i++) { RoomDetailsVo room = voEnvironmentalVisit.getRooms().get(i); if (room.getDoorWidthIsNotNull()) { if (room.getUnitOfMeasureIsNotNull()) return true; else return false; } else { if (room.getUnitOfMeasureIsNotNull()) return false; } } } return true; }
private void promoteChild(RoomDetailsVo voRoomDetails) { if (voRoomDetails == null) return; GenForm.grdRoomsRow row = form.grdRooms().getRows().newRow(); populateChildNode(row, voRoomDetails); }
private void promoteUpdatedChild(RoomDetailsVo voRoomDetails) { if (voRoomDetails == null) return; GenForm.grdRoomsRow row = form.grdRooms().getSelectedRow(); populateChildNode(row, voRoomDetails); }
private boolean promoteChild(RoomDetailsVo voRoomDetails) { if (voRoomDetails == null) return false; GenForm.gridRoomsRow row = form.gridRooms().getRows().newRow(); populateChildNode(row, voRoomDetails); return true; }
private void promoteUpdatedChild(RoomDetailsVo voRoomDetails) { if (voRoomDetails == null) return; GenForm.gridRoomsRow row = form.gridRooms().getSelectedRow(); populateChildNode(row, voRoomDetails); }
private RoomDetailsVo populateChildInstanceData(RoomDetailsVo voRoomDetails) { voRoomDetails.setLocation(form.ctnDetails().comboBoxLocation().getValue()); voRoomDetails.setHomeVisitRoomType(form.ctnDetails().comboBoxType().getValue()); voRoomDetails.setAccess(form.ctnDetails().textBoxAccess().getValue()); voRoomDetails.setDoorWidth(form.ctnDetails().intDoorWidth().getValue()); voRoomDetails.setUnitOfMeasure(form.ctnDetails().cmbUnit().getValue()); voRoomDetails.setRoomDetails(form.ctnDetails().textBoxDetails().getValue()); return voRoomDetails; }
private void updateControlsState() { if (form.getMode().equals(FormMode.EDIT)) setAddApplyCaption(); if(FormMode.VIEW.equals(form.getMode())) { form.btnEdit().setVisible(form.gridRooms().getValue() instanceof RoomDetailsVo); } enableDetailsButtons(); updateContextMenusState(); }
private void populateChildInstanceControls(RoomDetailsVo voRoomDetails) { if (voRoomDetails == null) return; form.ctnDetails().comboBoxLocation().setValue(voRoomDetails.getLocation()); form.ctnDetails().comboBoxType().setValue(voRoomDetails.getHomeVisitRoomType()); form.ctnDetails().textBoxAccess().setValue(voRoomDetails.getAccess()); form.ctnDetails().intDoorWidth().setValue(voRoomDetails.getDoorWidth()); form.ctnDetails().cmbUnit().setValue(voRoomDetails.getUnitOfMeasure()); form.ctnDetails().textBoxDetails().setValue(voRoomDetails.getRoomDetails()); }
private boolean widthAndUnitEntered(HomeVisitVo voHomeVisit) { // for add if (voHomeVisit == null) { if (form.ctnDetails().intDoorWidth().getValue() != null) { if (form.ctnDetails().cmbUnit().getValue() != null) return true; else return false; } else { if (form.ctnDetails().cmbUnit().getValue() != null) return false; } } // for save else { for (int i = 0; i < voHomeVisit.getRooms().size(); i++) { RoomDetailsVo room = voHomeVisit.getRooms().get(i); if (room.getDoorWidthIsNotNull()) { if (room.getUnitOfMeasureIsNotNull()) return true; else return false; } else { if (room.getUnitOfMeasureIsNotNull()) return false; } } } return true; }