Hi,
A colleague of mine asked me why ValidationError doesn't work with
Serializable as Component's #info, #error, #debug, ... methods.
I looked deeper and I saw a solution: write a custom IValidationError
which keeps the Serializable and use it later.
Problem 1) IValidationError requires from me
i dont quite follow all this, but if you just want to change
IValidationErrror#getErrorMessage() to return a Serializable instead
of a String im fine with that.
-igor
On Wed, Mar 14, 2012 at 6:17 AM, Martin Grigorov mgrigo...@apache.org wrote:
Hi,
A colleague of mine asked me why
You almost got it :-)
Returning Serializable instead of String is half of it.
The other half is to replace
error(new ValidationErrorFeedback(error, message));
with
error(message);
in FormComponent#error()
The 'message' can bring the 'error' that produced it if it needs it.
OK ?
Wicket 6.0 only
by default the message should bring the error with it, thus
ValidationErrorFeedback. this is so users can customize feedbackpanels
and get access to ValidationError instances.
sounds like your code should check for ValidationErrorFeedback and
pull your message out of it...
-igor
On Wed, Mar
This will work as well.
Currently our code uses a lot Component#error(OurSerializableClass)
and our custom FeedbackPanel checks for specializations of
OurSerializableClass.
With your suggestion FeedbackPanel will have to check for
ValidationErrorFeedback then get our custom IValidationError out of
https://issues.apache.org/jira/browse/WICKET-4449
On Wed, Mar 14, 2012 at 6:07 PM, Martin Grigorov mgrigo...@apache.org wrote:
This will work as well.
Currently our code uses a lot Component#error(OurSerializableClass)
and our custom FeedbackPanel checks for specializations of