protected void onImbCalculateClick() throws ims.framework.exceptions.PresentationLogicException { Time startTime = form.timStart().getValue(); Time endTime = form.getGlobalContext().Scheduling.getProfileEndTime(); // this is mandatory for dialog if (form.getGlobalContext().Scheduling.getProfileEndTime() == null) return; if (startTime == null || (form.intSlotInterval().getValue() == null || form.intSlotInterval().getValue() == 0)) { engine.showErrors( new String[] {"Start Time and Slot Interval need to be provided for calculation"}); return; } int iDuration = form.intSlotInterval().getValue(); int iTime = endTime.getTotalMinutes() - startTime.getTotalMinutes(); form.intNoSlots().setValue(iTime / iDuration); }