/ Published in: Java
URL: http://www.codedrop.ca/blog/archives/46
Something I have always found annoying about JSF datatables is the limitation to only apply one header class style to the entire table. This is un-functional for datatables that would display monetary amount or other data that is typically right aligned whereas descriptive columns are left aligned. The table doesn’t look very nice if the heading don’t match the columns.
Expand |
Embed | Plain Text
<h:panelGrid width=”100%” id=”memberTransactionTableBody” border=”0″ cellspacing=”0″ cellpadding=”0″ columns=”1″> <h:column> <h:form id=”form”> <h:dataTable rowClasses=”accountTransactionRowDefault, accountTransactionRowAlternate” headerClass=”accountColumnHeader StrongText” footerClass=”accountColumnFooter” width=”100%” cellpadding=”0″ cellspacing=”0″ border=”0″ columnClasses=”account-padding,account-date,account-description,account-debit, account-credit,account-currency,account-status” styleClass=”accountTransactionText” var=”transaction” value=”#{transactionHandler.transactionBean.transactionHistory}” rows=”40″> <h:column> </h:column> <h:column> <f:facet name=”header”> <div style=”float: left;”> #{messages['message.account.column.date']} </div> </f:facet> <h:outputText value=”#{transaction.dateTimeStamp}”/> <f:facet name=”footer”> </f:facet> </h:column> <h:column> <f:facet name=”header”> <div style=”float: left;”> #{messages['message.account.column.description']} </div> </f:facet> <h:outputText value=”#{transaction.description}”/> </h:column> <h:column> <f:facet name=”header”> #{messages['message.account.column.debit']} </f:facet> <h:outputText value=”#{transaction.debit}”/> </h:column> <h:column> <f:facet name=”header”> #{messages['message.account.column.credit']} </f:facet> <h:outputText value=”#{transaction.credit}”/> </h:column> <h:column> <f:facet name=”header”> #{messages['message.account.column.currency']} </f:facet> <h:outputText value=”#{transaction.currency}”/> </h:column> </h:dataTable> </h:form> </h:column> </h:panelGrid>
You need to login to post a comment.
