Archive for the ‘JSF’ Category

Dependencies for creating a JSF (PrimeFaces) Portlet in Liferay

October 28, 2014 Leave a comment

Following are the dependencies if you are trying to create a JSF (PrimeFaces) Portlet in Liferay:

– commons-fileupload-1.2.2.jar
– commons-io-1.3.2.jar
– jboss-el-2.0.0.GA.jar
– jsf-api-2.1.21.jar
– jsf-impl-2.1.21.jar
– liferay-faces-alloy-3.2.4-ga5-SNAPSHOT.jar
– liferay-faces-bridge-api-3.2.4-ga5-SNAPSHOT.jar
– liferay-faces-bridge-impl-3.2.4-ga5-SNAPSHOT.jar
– liferay-faces-util-3.2.4-ga5-SNAPSHOT.jar
– primefaces-3.5.jar (primefaces-5.0.jar also working)

Its recommended to use exactly the same versions of these jars because of conflicting classes/issues in other versions (other versions too would be stable but i got a conflict when using different versions). This combination of JARs have been testing for creating JSF (PrimeFaces) portlets with Liferay version

Cheers and have a nice day 🙂

Categories: Java, JSF, PrimeFaces

How to override default PrimeFaces CSS

October 13, 2014 Leave a comment

For JSF/PrimeFaces beginners overriding the default primefaces CSS is often an issue and there are also not much answers to this question on the internet. Okay why do you want to override the default CSS..? Because of a number of reasons.. For example the default PrimeFaces components are too big and i wanted them to look like those shown in PrimeFaces showcase. So all i have to do is to override the CSS with my custom CSS.
Create a CSS file in the WebContent\resources\css folder (create the css folder). Put the following code in the CSS file:

.ui-widget .ui-widget
    font-size: 90% !important;

Now all you have to do is to include this CSS file in your JSF page by adding the following code.

<h:outputStylesheet name="css/custom-style.css" />

And thats all, now you can add any styles, classes to this CSS file and make your JSF/PrimeFaces components fancy and the way you want them to be. Cheers.

Categories: Java, JSF, PrimeFaces