{"id":1019,"date":"2010-11-05T11:08:04","date_gmt":"2010-11-05T11:08:04","guid":{"rendered":"http:\/\/salientsoft.co.uk\/?p=1019"},"modified":"2010-11-05T18:04:28","modified_gmt":"2010-11-05T18:04:28","slug":"tying-primefaces-page-styling-to-the-theme","status":"publish","type":"post","link":"https:\/\/salientsoft.co.uk\/?p=1019","title":{"rendered":"Tying Primefaces page styling to the theme"},"content":{"rendered":"<p>With Primefaces, rather than applying your own style for borders, headers etc. it is important where possible to tie the styling in to the theme using theme classes.<br \/>\nHere is an example of this from the Primefaces showcase, used to display the header for each example:-<\/p>\n<p style=\"padding-left: 30px;\">&lt;h1 class=&#8221;title ui-widget-header ui-corner-all&#8221;&gt;DataTable &#8211; Pagination&lt;\/h1&gt;<\/p>\n<p>This example places a border around the header according to the theme, sets the appropriate background, and adds corner rounding as per the theme.<br \/>\nWhilst in some cases another Primefaces component might be the right approach (in this case a panel would do it), in many cases this is undesirable and also overkill for the job. Taking our lead from the Primefaces showcase, it is clearly acceptable to use the underlying jQuery UI classes where appropriate, as I have also done <a href=\"http:\/\/salientsoft.co.uk\/?p=1007\"><strong>here<\/strong><\/a>.<\/p>\n<p>Here is another example page fragment which I have used to group a few controls\/buttons in a box:-<\/p>\n<p style=\"padding-left: 30px;\">&lt;h:head&gt;<br \/>\n\u00a0\u00a0\u00a0 &lt;style type=&#8221;text\/css&#8221;&gt;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 .ui-widget, .ui-widget .ui-widget {<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 font-size: 80% !important;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 .ss-controlgroup {<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 float: left;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/p>\n<p style=\"padding-left: 30px;\">\u00a0\u00a0\u00a0 &lt;\/style&gt;<br \/>\n&lt;\/h:head&gt;<br \/>\n&lt;h:body&gt;<br \/>\n&lt;h:form&gt;<br \/>\n&lt;h:panelGroup layout=&#8221;block&#8221; styleClass=&#8221;ui-widget-content ui-corner-all ss-controlgroup&#8221;&gt;<\/p>\n<p style=\"padding-left: 30px;\">\u00a0\u00a0 <em>(controls in the box go here)<\/em><\/p>\n<p style=\"padding-left: 30px;\">&lt;\/h:panelGroup&gt;<br \/>\n&lt;\/h:form&gt;<br \/>\n&lt;\/h:body&gt;<\/p>\n<p>Details of the jQuery UI, on which Primefaces is based, may be found <a href=\"http:\/\/jqueryui.com\/home\"><strong>here<\/strong><\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With Primefaces, rather than applying your own style for borders, headers etc. it is important where possible to tie the styling in to the theme using theme classes. Here is an example of this from the Primefaces showcase, used to display the header for each example:- &lt;h1 class=&#8221;title ui-widget-header ui-corner-all&#8221;&gt;DataTable &#8211; Pagination&lt;\/h1&gt; This example places [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[22],"tags":[119,184,112,16],"_links":{"self":[{"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1019"}],"collection":[{"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1019"}],"version-history":[{"count":6,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1019\/revisions"}],"predecessor-version":[{"id":1024,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1019\/revisions\/1024"}],"wp:attachment":[{"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1019"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1019"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1019"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}