/** * Reduces code duplication<br> * This will render the view date picker control or a message depending on various system settings * <br> * <b>NOTE:</b> the rsfId should not include the ":" even though it must appear in the template * with a colon<br> * <b>NOTE:</b> the label for this message must use an rsf:id of (rsfId + "_label")<br> * * @param parent the parent container * @param rsfId the rsf id of the checkbox * @param binding the EL binding for this control value * @param viewResultsSetting * @param useDateTime * @param sameViewDateForAll */ protected void generateViewDateControl( UIBranchContainer parent, String rsfId, String binding, Boolean viewResultsSetting, Boolean useDateTime, boolean sameViewDateForAll) { if (viewResultsSetting == null || viewResultsSetting) { // only show something if this on or configurable if (sameViewDateForAll) { // just show the text to the user since all view dates are the same AND the system setting // forces this UIMessage.make(parent, rsfId + "_label", "evalsettings.view.results.date.label"); } else { // allow them to choose the date using a date picker UIInput dateInput = UIInput.make(parent, rsfId + ":", binding); if (useDateTime) { dateevolver.setStyle(FormatAwareDateInputEvolver.DATE_TIME_INPUT); } else { dateevolver.setStyle(FormatAwareDateInputEvolver.DATE_INPUT); } dateevolver.evolveDateInput(dateInput); } } }
/** * Generates the date picker control for the standard evaluation dates * * @param parent the parent container * @param rsfId the rsf id of the checkbox * @param binding the EL binding for this control value * @param initValue null or an initial date value * @param currentEvalState * @param worksUntilState * @param useDateTime */ private void generateDateSelector( UIBranchContainer parent, String rsfId, String binding, Date initValue, String currentEvalState, String worksUntilState, boolean useDateTime) { if (EvalUtils.checkStateAfter(currentEvalState, worksUntilState, true)) { String suffix = ".date"; if (useDateTime) { suffix = ".time"; } UIOutput.make(parent, rsfId + "_disabled", null, binding).resolver = new ELReference("dateResolver." + suffix); } else { UIInput datePicker = UIInput.make(parent, rsfId + ":", binding); if (useDateTime) { dateevolver.setStyle(FormatAwareDateInputEvolver.DATE_TIME_INPUT); } else { dateevolver.setStyle(FormatAwareDateInputEvolver.DATE_INPUT); } dateevolver.evolveDateInput(datePicker, initValue); } }