2

Primefaces supports both web and mobile version. There is some minor difference in coding the two version.

Is there anyway to use primefaces for both WEB and MOBILE version? I mean single code base which supports both MOBILE and WEB version using primefaces? (something similar to the applications built by bootstrap)

yottabrain
  • 2,387
  • 5
  • 23
  • 37
  • Do you solve your problem? because I have the same problem. I would like to develop the same app for both desktop and mobile using 1 code, in fact this tag `` will switch all the components to primefaces mobile but I am looking to a way to load this tag only on mobile devices so the primefaces mobile components will be shown on mobile, otherwise do not load this tag and the normal primefaces components will be shown. – Jad Chahine Nov 08 '16 at 06:53

2 Answers2

0

Primefaces mobile is built on jquery mobile which works on phone, tablet, or desktop. So if you stick with primefaces mobile it should work on all devices.

hooda
  • 105
  • 6
  • 2
    An application developed with pure PrimeFaces mobile components does **not** look good on desktops imo. I personally use the normal components as much as possible and try to make them behave a little more responsive. – Kukeltje May 18 '15 at 09:45
  • So to answer the poster's question, yes you technically can use the same code base and it will work, but if you want the richness of both Primefaces web and Primefaces mobile you will need separate code bases. – hooda May 18 '15 at 12:17
  • @Kukeltje: As you know we can load the primefaces mobile components by adidng this tag `` but do you know how to add this tag only on mobile? so the primefaces mobile components will be shown on mobile, otherwise do not load this tag and the normal primefaces components will be shown. – Jad Chahine Nov 08 '16 at 06:56
  • New questions in a new question please – Kukeltje Nov 08 '16 at 17:02
0

To make it clear, Primefaces created some PrimeFaces Premium Themes and Layouts like (Sentinel, Spark, Ronin and all other on http://www.primefaces.org/themes). In my opinion that's great (good looking / pixel perfect), those are responsive layouts but not all components are responsive. You can check responsive components on responsive.xhtml

anotherUser
  • 551
  • 6
  • 29
  • PrimeFaces Bootstrap theme has **nothing** to do with mobile or responsive. It is a plain theme. – Kukeltje May 18 '15 at 09:42
  • @Kukeltje I agree, my answer was not clear (there is Primefaces theme called Bootstrap which only has its look). – anotherUser May 18 '15 at 11:44
  • The spark, ronin, and sentinel themes themselves are not specifically responsive. The corresponding layout and incorporated menu **are** responsive – Kukeltje May 18 '15 at 12:29
  • Yes, Responsiveness of components belong to PrimeFaces not layouts, see http://blog.primefaces.org/?p=3538 – Cagatay Civici Jun 04 '15 at 21:11