I'm using struts 2 in my project and I don't want to display error messages on top of fields. What I need to know is, how do I customize validation framework so it will not show messages on top of each field which validation has failed??? This causes a mess up with my css design!!!
I have already configured the error messages to appear on top of pages when some validation error occurs but I was not able to disable the field messages to appear. I'm sure there's some way to accomplish that.
Tx for this tip.That's what i need. The simple theme is not an option for me as I'll loose tooltips and will have to manually add label to fields. But following your suggestion I found out how to customize a template for my needs.
I took a quick look yesterday(1 hour) and as I'm not confortable with template languages it does not seemed too trivial. I have tryied some modification on template files but with no success. I'm using Appfuse and I already have found 3 templates under /template/xhtml and nothing seems to change when I change this templates. I think I'm still doing something wrong. I'll post my progress here.
Follows the template I believe I should customize to meet my requirements (controlheader-core.ftl):
what I'm trying to acoplish is removing the message from the field but leaving the icon(warning) on label side to show which fields have failed validation. The messages I'll leave on top only, wich is default using struts Appfuse templates.
after a bit of modification I'm almost where I wanna to be. I have changed label entry to not became red anymore when error occurs so it's now like:
Also I have removed error message and left warnin icon:
The only thing I'm not able to do yet is to post the warnin icon on top(on label side) .
The icon is actually pushing the textfield and being placed on it's left side. I'd like it to be after the label text for the field, same line.
What I have is like:
label for field
icon - textfield
I want it to be like:
label for field - warning icon
I still didn't get which code fragment places a line between label and icon.
It took me 3.5 hours to acomplish this task. This time I have used to post here, some reading and research on web and trying with code changes in templates. For someone who never had work with template languages before I believe its a fair time. My final word on this is that doesn't look that hard to learn Freemarker templates and customizing the ones already there is not such a big deal.
In my final template i moved the place where warning icon was placed on template and it's working as expected now.