/** * Gives overriding classes the option of adding (or even changing/ removing) configuration * properties for the javascript widget. See <a * href="http://developer.yahoo.com/yui/calendar/">the widget's documentation</a> for the * available options. If you want to override/ remove properties, you should call * super.configure(properties) first. If you don't call that, be aware that you will have to * call {@link #localize(java.util.Map, org.apache.wicket.markup.head.IHeaderResponse, java.util.Map)} manually if you like localized strings to be added. * * @param widgetProperties * the current widget properties * @param response * the header response * @param initVariables * variables passed to the Wicket.DateTime.init() js method */ protected void configure(final Map<String, Object> widgetProperties, final IHeaderResponse response, final Map<String, Object> initVariables) { widgetProperties.put("close", true); // localize date fields localize(widgetProperties, response, initVariables); Object modelObject = component.getDefaultModelObject(); // null and cast check if (modelObject instanceof Date) { Date date = (Date)modelObject; widgetProperties.put("selected", new SimpleDateFormat(FORMAT_DATE).format(date)); widgetProperties.put("pagedate", new SimpleDateFormat(FORMAT_PAGEDATE).format(date)); } }
/** * Gives overriding classes the option of adding (or even changing/ removing) configuration * properties for the javascript widget. See <a * href="http://developer.yahoo.com/yui/calendar/">the widget's documentation</a> for the * available options. If you want to override/ remove properties, you should call * super.configure(properties) first. If you don't call that, be aware that you will have to * call {@link #localize(java.util.Map, org.apache.wicket.markup.head.IHeaderResponse, java.util.Map)} manually if you like localized strings to be added. * * @param widgetProperties * the current widget properties * @param response * the header response * @param initVariables * variables passed to the Wicket.DateTime.init() js method */ protected void configure(final Map<String, Object> widgetProperties, final IHeaderResponse response, final Map<String, Object> initVariables) { widgetProperties.put("close", true); // localize date fields localize(widgetProperties, response, initVariables); Object modelObject = component.getDefaultModelObject(); // null and cast check if (modelObject instanceof Date) { Date date = (Date)modelObject; widgetProperties.put("selected", new SimpleDateFormat(FORMAT_DATE).format(date)); widgetProperties.put("pagedate", new SimpleDateFormat(FORMAT_PAGEDATE).format(date)); } }