Skip to main content

Posts

Showing posts with the label ADF JSF StyleClass Dynamically change binding EL Expression Language concatenate Faces

ADF 11g Skinning: Three ways to change look and feel

On the JDeveloper ADF forum there are many questions on how to change the look and feel of components. In this post I'll explain three ways to do that. Setting skin Selector property For this we need to define a custom skin. <?xml version="1.0" encoding="ISO-8859-1"?> <skins xmlns="http://myfaces.apache.org/trinidad/skin"> <skin> <id>mySkin.desktop</id> <family>MySkin</family> <extends>blafplus-rich.desktop</extends> <render-kit-id>org.apache.myfaces.trinidad.desktop</render-kit-id> <style-sheet-name>skins/MySkin.css</style-sheet-name> </skin> </skins> In the style sheet we will add an entry that will hide the columnheaders. af|column::column-header-cell{display: none;} This entry in the styleSheet will apply to ALL columns in your application. Using and appending styleClasses Now we create a StyleClass that is exactly the same as the sty...

Changing appearances.

Lately I've been working on an application that can serve offices in different countries. So what I hear you say.........I do that every day.............use the 'locale.language', use a bundle and be happy ;-) Ok, I know that, but I want to have changing appearances, not only changing text. That can also be done by using a skin selector for instance like the one below: <skin-family>#{facesContext.viewRoot.locale.language=='de' ? 'german' : 'english'}</skin-family> You can use this in the same way as I did in one of my previous posts. However, I want the application to behave in a way that not the whole look and feel changes, but that only some country specific elements automatically change. I will not go in to the details of the application, but I will try to explain the concept, based on license plates. Imagine a car rental company with cars and offices in different countries. Whatever country (or even state for that matter) you are in,...