Many components? There are as far as I know only two which does that "unnecessarily": h:selectManyRadio
and h:selectManyCheckbox
, both from the UISelectMany
family. If you want table-less radiobuttons/checkboxes, instead use the Tomahawk variant which have an extra layout
attribute value of spread
.
For the remnant you just have the control fully in your own hands. Just do not use tables for layout, i.e. do not use JSF h:panelGrid
for layout. Just use HTML div
elements to display content blocks. Or if you're a JSF-purist, use h:panelGroup layout="block"
instead of HTML div
elements.
As to applying CSS, it isn't that hard, every JSF HTML component has a styleClass
attribute wherein you can specify CSS classes (which would end up in a HTML class
attribute) and style
attribute wherein you can specify inline CSS (which would end up in a HTML style
attribute).
You can even define global CSS styles and use the ID selectors. Only thing which you need to take care in JSF+CSS is that the JSF-generated HTML element ID's are prepended with the ID's of all parent UINamingContainer
components (e.g. f:subview
, h:form
, h:dataTable
, etc) with a colon :
as separator. As the colon is an illegal character in CSS identifiers, you need to escape it using \
. So styling the input element of for example
<h:form id="form">
<h:inputText id="input" ... />
which generates <input type="text" id="form:input" ... />
should be done as
#form\:input {
background: gray;
}