ace:dateTimeEntry shows background in Red if validation failed, but how to show such highlighting for other fields when validation fails

StackOverflow https://stackoverflow.com/questions/14353918

  •  16-01-2022
  •  | 
  •  

Frage

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>
War es hilfreich?

Lösung 2

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.

Andere Tipps

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

<h:inputText styleClass="#{component.valid ? 'my-normal-styleclass' : 'my-error-styleclass'};"/>
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top