PrimeFaces Goes Bidirectional
One of the highlights of PrimeFaces 3.5 is the RTL support. Initially commonly used components tabview, accordion, datatable, tree, menus and more would be RTL aware. In future versions RTL support would be improved with each iteration just like accessibility.
To configure PrimeFaces to use RTL, one way is setting the context param that also accepts EL expressions.
1 2 3 4 |
<context-param> <param-name>primefaces.DIR</param-name> <param-value>RTL</param-value> </context-param> |
That’s it, if you have a regular tabview like;
1 2 3 |
<p:tabView> //tabs </p:tabView> |
RTL mode renders like;
Mossaab
1 November 2012 at 19:07Adding RTL support is a big plus to primefaces. Thanks!
I have a request. Can’t you add an attribute to the primefaces tags instead?
I’m thinking of something as simple as .
In fact I have a website that serves bilingual content (Arabic / English), and I prefer to be able to dynamically decide, for a given view, whether the orientation should be RTL or LTR.
Many thanks!
David
1 November 2012 at 21:36Agree with Mossaab, it could be better if this cofiguration can be made at component scope and not application scope.
Optimus Prime
1 November 2012 at 22:04primefaces.DIR accepts EL expressions so that you can decide dynamically.
Moayad Abu Jaber
3 November 2012 at 12:53That mean every component that support RTL have dir attribute ? very interesting 🙂
finally primefaces do that!
lucaster
3 November 2012 at 12:56But the text is stil left to right…
Optimus Prime
3 November 2012 at 14:11It is actually, notice the orientation, the text itself is English though. Yo don’t expect horizontally flipped Latin characters right?
Luca
5 November 2012 at 11:36I tought RTL would affect any language. Probably arabic character are alighed RTL correctly though.