Hi,
Just my 5 cents: it's not good to serialize SimpleDateFormat instances
as part of the page state because IMHO it's footprint is too big. So
please avoid it or at least make it possible to store just a pattern (as
Gerolf suggested).
BTW don't you think that wicket needs some profiling tool to make it
easier to reduce pagemaps and sessions size by viewing pages state
contents in some convenient way? AFAIK there was a JIRA issue for this -
does it still exist and what's its state?
PS is it ok to write here if I'm not a wicket team member?
Gerolf Seitz wrote:
i was wondering if we could provide the facilities to set a
DateFormat/-Pattern (to format the date in feedback messages) for
DateValidators?
the default format in a feedback message via toString() (like "Sun Sep 23
23:59:55 CEST 2007") seems rather strange,
when the user needed to enter a date in a different format (which he
probably will).
i was thinking of the following:
add "DateValidator withDateFormat(DateFormat format)" and "DateValidator
withDatePattern(String pattern)" to DateValidator.
every DateValidator (Range, Minimum, Maximum) should add the variable values
like this:
protected Map variablesMap(IValidatable validatable)
{
final Map map = super.variablesMap(validatable);
map.put("maximum", formatDate(maximum)); // use formatDate(Date)
return map;
}
the formatDate method either uses the provided dateformat to format the date
or otherwise (in case no dateformat/patter was provided) just returns the
result of the toString() method.
so, wdyt?
gerolf
--
Andrew Klochkov