I got the whole rows clickable with a bit of styling. I made the links inside the cells occupy the whole cell with display: block;
for the links and padding:0
for the cell.
So, here is what you need to do. In the JSF page, set up rowClasses
and the links in each cell:
<rich:dataTable value="#{myMB.listaElems}" var="elem" rowClasses="clickable">
<rich:column>
<h:commandLink action="#{myMB.preUpdate(elem)}" value="#{elem.item1}" />
</rich:column>
<rich:column>
<h:commandLink action="#{myMB.preUpdate(elem)}" value="#{elem.item2}" />
</rich:column>
</rich:datatable>
And in the CSS sheet:
tr.clickable td {
padding: 0;
}
tr.clickable td a {
display: block;
padding: 4px;
}
And that's it!
The only downside is that you need to repeat the link in each cell, but the HTTP flow remains simple, you don't need to change any component, and it will work for h:link
s or good old <a>
html links -- a pretty acceptable tradeoff, I'd say. :)