/** * {@inheritDoc} */ @Override public void bind(final Component component) { this.component = component; checkComponentProvidesDateFormat(component); component.setOutputMarkupId(true); }
@Override protected void configure(final Map<String, Object> widgetProperties, final IHeaderResponse response, final Map<String, Object> initVariables) { super.configure(widgetProperties, response, initVariables); DateTimeField.this.configure(widgetProperties); } };
/** * Check that this behavior can get a date format out of the component it is coupled to. It * checks whether {@link #getDatePattern()} produces a non-null value. If that method returns * null, and exception will be thrown * * @param component * the component this behavior is being coupled to * @throws UnableToDetermineFormatException * if this date picker is unable to determine a format. */ private void checkComponentProvidesDateFormat(final Component component) { if (getDatePattern() == null) { throw new UnableToDetermineFormatException(); } }
if (includeYUILibraries()) renderHeadInit(response); String widgetId = getEscapedComponentMarkupId(); variables.put("componentId", getComponentMarkupId()); variables.put("widgetId", widgetId); variables.put("datePattern", getDatePattern()); variables.put("fireChangeEvent", notifyComponentOnDateSelected()); variables.put("alignWithIcon", alignWithIcon()); variables.put("hideOnSelect", hideOnSelect()); variables.put("showOnFieldClick", showOnFieldClick()); variables.put("autoHide", autoHide()); variables.put("closeLabel", closeLabel()); String script = getAdditionalJavaScript(); if (script != null) configure(p, response, variables); if (!p.containsKey("navigator") && enableMonthYearSelection()) if (enableMonthYearSelection() && p.containsKey("pages") && Objects.longValue(p.get("pages")) > 1) appendMapping(p, calendarInit); variables.put("calendarInit", calendarInit.toString()); String escapedComponentMarkupId = getEscapedComponentMarkupId(); String javascript = "var e = Wicket.$('" + escapedComponentMarkupId + "Dp" +
Map<String, Object> initVariables) Locale locale = getLocale(); String key = "Wicket.DateTimeInit.CalendarI18n[\"" + locale.toString() + "\"]"; initVariables.put("i18n", key); setWidgetProperty(i18nVariables, "MONTHS_SHORT", filterEmpty(dfSymbols.getShortMonths())); setWidgetProperty(i18nVariables, "MONTHS_LONG", filterEmpty(dfSymbols.getMonths())); setWidgetProperty(i18nVariables, "WEEKDAYS_MEDIUM", filterEmpty(dfSymbols.getShortWeekdays())); setWidgetProperty(i18nVariables, "WEEKDAYS_LONG", filterEmpty(dfSymbols.getWeekdays())); i18nVariables.put("START_WEEKDAY", getFirstDayOfWeek(locale)); setWidgetProperty(i18nVariables, "WEEKDAYS_1CHAR", filterEmpty(substring(dfSymbols.getShortWeekdays(), 2, 1))); i18nVariables.put("WEEKDAYS_SHORT", filterEmpty(substring(dfSymbols.getShortWeekdays(), 2, 1))); setWidgetProperty(i18nVariables, "WEEKDAYS_1CHAR", filterEmpty(substring(dfSymbols.getShortWeekdays(), 0, 1))); setWidgetProperty(i18nVariables, "WEEKDAYS_SHORT", filterEmpty(substring(dfSymbols.getShortWeekdays(), 0, 2))); appendMapping(i18nVariables, i18n); i18n.append(';');
@SuppressWarnings("unchecked") Map<String, Object> nmap = (Map<String, Object>)value; appendMapping(nmap, json);
if (includeYUILibraries()) renderHeadInit(response); String widgetId = getEscapedComponentMarkupId(); variables.put("componentId", getComponentMarkupId()); variables.put("widgetId", widgetId); variables.put("datePattern", getDatePattern()); variables.put("fireChangeEvent", notifyComponentOnDateSelected()); variables.put("alignWithIcon", alignWithIcon()); variables.put("hideOnSelect", hideOnSelect()); variables.put("showOnFieldClick", showOnFieldClick()); variables.put("autoHide", autoHide()); String script = getAdditionalJavaScript(); if (script != null) configure(p, response, variables); if (!p.containsKey("navigator") && enableMonthYearSelection()) if (enableMonthYearSelection() && p.containsKey("pages") && Objects.longValue(p.get("pages")) > 1) appendMapping(p, calendarInit); variables.put("calendarInit", calendarInit.toString()); String escapedComponentMarkupId = getEscapedComponentMarkupId(); String javascript = "var e = Wicket.$('" + escapedComponentMarkupId + "Dp" + "'); if (e != null && typeof(e.parentNode) != 'undefined' && " +
Map<String, Object> initVariables) Locale locale = getLocale(); String key = "Wicket.DateTimeInit.CalendarI18n[\"" + locale.toString() + "\"]"; initVariables.put("i18n", key); setWidgetProperty(i18nVariables, "MONTHS_SHORT", filterEmpty(dfSymbols.getShortMonths())); setWidgetProperty(i18nVariables, "MONTHS_LONG", filterEmpty(dfSymbols.getMonths())); setWidgetProperty(i18nVariables, "WEEKDAYS_MEDIUM", filterEmpty(dfSymbols.getShortWeekdays())); setWidgetProperty(i18nVariables, "WEEKDAYS_LONG", filterEmpty(dfSymbols.getWeekdays())); i18nVariables.put("START_WEEKDAY", getFirstDayOfWeek(locale)); setWidgetProperty(i18nVariables, "WEEKDAYS_1CHAR", filterEmpty(substring(dfSymbols.getShortWeekdays(), 2, 1))); i18nVariables.put("WEEKDAYS_SHORT", filterEmpty(substring(dfSymbols.getShortWeekdays(), 2, 1))); setWidgetProperty(i18nVariables, "WEEKDAYS_1CHAR", filterEmpty(substring(dfSymbols.getShortWeekdays(), 0, 1))); setWidgetProperty(i18nVariables, "WEEKDAYS_SHORT", filterEmpty(substring(dfSymbols.getShortWeekdays(), 0, 2))); appendMapping(i18nVariables, i18n); i18n.append(';');
@SuppressWarnings("unchecked") Map<String, Object> nmap = (Map<String, Object>)value; appendMapping(nmap, json);
@Override protected void configure(final Map<String, Object> widgetProperties, final IHeaderResponse response, final Map<String, Object> initVariables) { super.configure(widgetProperties, response, initVariables); DateTimeField.this.configure(widgetProperties); } };
/** * {@inheritDoc} */ @Override public void bind(final Component component) { this.component = component; checkComponentProvidesDateFormat(component); component.setOutputMarkupId(true); }
/** * Check that this behavior can get a date format out of the component it is coupled to. It * checks whether {@link #getDatePattern()} produces a non-null value. If that method returns * null, and exception will be thrown * * @param component * the component this behavior is being coupled to * @throws UnableToDetermineFormatException * if this date picker is unable to determine a format. */ private void checkComponentProvidesDateFormat(final Component component) { if (getDatePattern() == null) { throw new UnableToDetermineFormatException(); } }