Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jsf+Primefaces responsive design

I have started working of JSF+Primefaces latest version for my website is this somehow possible i can make my design responsive with these technology. I do not want to use Primefaces mobile or i do not want to create two different page for same functionality

like image 758
user3696143 Avatar asked Jun 04 '14 15:06

user3696143


People also ask

What is JSF PrimeFaces?

Welcome to JSF Primefaces tutorial. JavaServer Faces is one of the leading framework that is used these days for implementing Java web application user interface.

Does PrimeFaces have a responsive grid?

PrimeFaces 6.x has responsive design updates, including a Responsive Grid. The grid is not a JSF component, it's a simple div with a ui-grid classes. In real case scenarios having only a grid won't fill the requirements so you should usually use some frameworks like bootstrap or foundation.

What is PrimeFaces mobile (PFM)?

Primefaces Mobile Primefaces Mobile (PFM) provides a UI kit to create Primefaces applications for mobile devices. For this reason, PFM supports responsive design adjusted for mobile devices. 5.1. Configuration To begin with, we need to enable mobile navigation support inside our faces-config.xml:

What is JSF in spring?

The JSF specification is formalized through the Java Community Process and is a standardized display technology. More about JSF in Spring environment can be found here. 2.2. Primefaces Built on top of JSF, Primefaces supports rapid application development by providing pre-built UI components which can be added to any project.


1 Answers

PrimeFaces 6.x has responsive design updates, including a Responsive Grid.

The grid is not a JSF component, it's a simple div with a ui-grid classes.

Example of 3 column layout:

<div class="ui-grid">
   <div class="ui-grid-col-4">Col1</div>
   <div class="ui-grid-col-4">Col2</div>
   <div class="ui-grid-col-4">Col2</div>
 </div>

In real case scenarios having only a grid won't fill the requirements so you should usually use some frameworks like bootstrap or foundation.

Both frameworks provide CSS/Javascript rules, they can be applied easily on the JSF components, for example if you have a button:

<h:commandButton styleClass="btn" value="Button">
</h:commandButton>

btn is a bootstrap CSS class.

You might run into some components which won't accept such styles, like the table of Primefaces, in these cases you should write your own CSS media queries/Javascript in order to maintain the responsiveness.

See more

  • JSF and Twitter Bootstrap Integration
like image 87
Hatem Alimam Avatar answered Oct 18 '22 20:10

Hatem Alimam