| Author |
Change <input> tag after validation/conversion-Exception
|
Pascal Lochmann
Greenhorn
Joined: May 06, 2010
Posts: 5
|
|
Hello Everybody,
i have a really simple problem and didn't find a working solution - it drives me mad!
Problem:
If a ValidationException/ConversionException is trhown by my validators/converters the regarding <input> -element in the page must be changed e.g. the background-color is set to red or style-class "invalid" ist set.
How to accomplish this? (Solution must work for InputText-Elements in a table)
Best Regards
Pascal
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 14487
|
|
Normally I pair the input control with a "message for=" tag, and that tag has options for different styles depending on error severity. I'm sure there's a way to highlight the input control itself, but I can't think of an easy one offhand.
The main problem with simply highlighting a bad input is that it doesn't explain itself like a message element would.
|
Customer surveys are for companies who didn't pay proper attention to begin with.
|
 |
Pascal Lochmann
Greenhorn
Joined: May 06, 2010
Posts: 5
|
|
Hello Tim,
thanks for your reply.
I already have message-elements for the inputs. (And it works)
Nevertheless the users/ my costumers want this feature...
Regards
Pascal
|
 |
suresh dasari
Ranch Hand
Joined: Oct 05, 2009
Posts: 120
|
|
Hi Pascal Lochmann,
use a phase listener with phase id "Validation phase"
add the logic in after phase, iterate the component find the error messages for every component if exist then update the style class for that component which accomplish your requirement.
|
Sun Certified Java Programmer with 93 percent
|
 |
 |
|
|
subject: Change <input> tag after validation/conversion-Exception
|
|
|