JSF 2 dataTable row index without dataModel

前端 未结 1 1431
一个人的身影
一个人的身影 2020-12-03 08:47

I\'ve been using ui:repeat to generate tables. With ui:repeat it\'s easy to get the rows numbered using the varStatus. I\'m depending on the row id\'s from varS

相关标签:
1条回答
  • 2020-12-03 09:18

    Just bind the table to the view itself instead of to a bean.

    <h:dataTable binding="#{table}" ...>
    

    Then you can use #{table.rowIndex} where necessary. E.g.

    <h:column>#{table.rowIndex + 1}</h:column>
    
    0 讨论(0)
提交回复
热议问题