I have a form where data can be entered, and one of the restrictions
is that there is no duplicate data in the db. If there is, I record an
error in the form with recordError(Field field, String errorMessage).
I can do this fine - but I would like to include a link to the item
that already contains the data they just entered, so that it can be
corrected if necessary.
When I tried that, the data gets escaped. I traced it to
org.apache.tapestry5.corelib.components.Errors, which uses a
MarkupWriter, which does writer.write(message), and that automatically
escapes the link I tried to include.

I think what I need is a way to have the Errors class optionally use
writeRaw for the message.
Because of the way MarkupWriter works, it looks to me like the
cleanest way to do this would be to have a method in
ValidationTracker, something like recordRawError, and then in
ValidationTrackerImpl each error instead of being a String would be
replaced with a String for the message and boolean for whether or not
it should be written raw (FieldTracker is already a holder class, so
the variable for if it's raw could just be added there). Any advice
for how to do this (in a way that would be accepted as a patch, if you
guys think this might be useful for others)

Or maybe I'm missing something and there already is a way of writing a
link in a form error message.

Donny

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to