我有使用ACE Datable的jsf页面。我需要根据条件对行进行着色,以便我使用datatable的rowStyleClass属性。
<ace:dataTable value="#{bookingListAndEditController.bookingList}"
rowStyleClass="#{booking.pickupTime.before(bookingListAndEditController.currentDate)?'jsfcrud_odd_row':null}"
var="booking" filterEvent="enter" paginator="true" rows="20" selectionMode="multiple"
rowSelectListener="#{bookingListAndEditController.rowSelected}"
rowUnselectListener="#{bookingListAndEditController.rowUnselected}" stateMap="#{bookingListAndEditController.stateMap}">
但它似乎没有起作用。谁能告诉我我做错了什么?
答案 0 :(得分:0)
永远记住,var booking
是bookingList
的对象,仅适用于ace:dataTable
的子元素。对所有列重复styleClass,以便样式应用于整行,并且只应用预订拾取时间小于当前时间的行。
<ace:dataTable value="#{bookingListAndEditController.bookingList}"
var="booking" filterEvent="enter" paginator="true" rows="20" selectionMode="multiple"
rowSelectListener="#{bookingListAndEditController.rowSelected}"
rowUnselectListener="#{bookingListAndEditController.rowUnselected}" stateMap="#{bookingListAndEditController.stateMap}">
<ace:column styleClass="#{booking.pickupTime.before
(bookingListAndEditController.currentDate)?'jsfcrud_odd_row':''}">
..
</ace:column>
.......
<ace:column styleClass="#{booking.pickupTime.before
(bookingListAndEditController.currentDate)?'jsfcrud_odd_row':''}">
..
</ace:column>