Oracle ADF Faces Tip: How to hide the Asterisk (*) when the "required" Property is Set to "true"
If this one is common knowledge, then forgive me. I just jumped into ADF and JSF a few weeks ago (I was a STRUTS man), and am drinking from the firehose! There is a property on some of the ADF Faces components (inputText, selectOneChoice, etc ...) called "required". If set to true, this property will ensure that the user enters a value for the item (in DB terms, it makes the field a NOT NULL field). This is a convenient feature with one small exception. Setting the property to true places a green asterisk(*) on the left side of the data entry item. The asterisk appears whether you want it to or not and there is no option/property available for turning it off (NOTE: This is an ADF inputText feature, not a standard JSF inputText feature). This is an issue if your development standards say to put an asterisk on the RIGHT side of the input field (as mine do).
The solution to the problem was fairly straight forward. Since I had implemented a custom skin for this ADF Faces application and created a custom CSS document (see this article by Jonas Jacobi), I simply over-rode the existing style for the required icon with this one:
.AFRequiredIconStyle { display:none }
Presto! No more little green asterisk.
6:23:15 PM
|