Hello,
i was wondering how
to change the background of an inputbox by simply changing the css style to e.g.
background:red. when a required="true" - validation was set.
I was trying several
possibilties but no one seems to fit my needs and i am just right now some
kind of frustrated because of this issue.
1. Making use of the
_expression_ Language by just accessing a method/property in a backing bean. This
works fine, as long as i don't want do access Input-Elements of a dataTable. I
don't think i can use the _expression_ Lanuage to access a method with a parameter
like getStyle(componentId)
2. I was trying to
find a possibility access the components-attributes through
"findComponent("inputbox1") in the jsf-api. Unfortunatly I was not able to
find the component (my input textfield) by its name or any other
function under FacesContext. Result was allways null.
:-(
3. Implementing an
own Validator: I implemented an own Validator which worked pretty good unless
the field was at least 1 letter. The validator was not fired when i typed
nothing into the inputBox. (But this is exactly the functionality i
need)
At the end of
the day i think i have to rewrite each component and overwrite the validate
method just because of of the requirement to make the background of an input
field red if a user forgot to enter data when it's required
definitly.
Is that
correct what i am thinking? Did i ignore other facts or
specifications?
Thank you in
advance for any hint how to change the css style with in a
required="true".
Best
Regards,
Nico
Nico
Krause| Software
Development| TomTom WORK | [EMAIL PROTECTED] | +49
(0)1749891949 mobile | +49(0)34124495-0 office | +49(0)34124495-25 fax |
www.tomtomwork.com