0
votes

I am using Icefaces 3.2. I have a ace:dateTimeEntry which works fine and also gets highlighted in Red background if the validation is failed for this date field. I want to know how can i achieve the same for other fields. I want the background to be highlited in red ,if validation has failed for the field. Note i have not implemented any custom logic for datetimeentry , it is highlighting by default.

                <ace:dateTimeEntry id="cal"  value="#{strformbean.customer1.custDob}"  timeZone="Canada/Mountain" pattern="dd/MM/yyyy"
                               renderAsPopup="true" navigator="true" styleClass="ui-inputfield" required="true"   requiredMessage="DOB is required"
                                maxdate="#{strformbean.date}"  readOnlyInputText="true">
                        <f:convertDateTime  dateStyle="medium" pattern="dd/MM/yyyy" /> 

                </ace:dateTimeEntry>
2

2 Answers

1
votes

You can do it by refering to the component's valid property:

<h:inputText styleClass="#{component.valid ? 'my-normal-styleclass' : 'my-error-styleclass'};"/>
0
votes

Thanks fischermatte. Icefaces forums mentioned that this validation highlighting feature is default provided in ACE components of Icefaces. I was using Ice components and the forum suggested me to use the latest Ace components 3.2. I modified my ice:inputText to ace:textEntry and the validation works properly withoug me adding any code.