How to refer to dataTable parent within the dataTable?

前端 未结 1 459
梦谈多话
梦谈多话 2021-01-13 09:13

Consider a dummy case:


    
        

        
相关标签:
1条回答
  • 2021-01-13 09:44

    There are actually two things going wrong:

    1) ui:repeat is broken

    As answered by BalusC in the comments of the question, the first issue occurs (once again) due to a bug in Mojarra. It seems ui:repeat is so broken even the wrapper container holding the h:dataTable does not help. For more details, see question "Why doesn't h:dataTable inside ui:repeat get correct ID?" and the comments of this question.

    As BalusC suggests, a workaround is to use h:dataTable instead of ui:repeat. It will provide unconvenient (<table>) HTML but works. This removes some odd issues when adding and removing rows to/from the inner iteration.

    Note: some issues regarding ui:repeat seem to be fixed in Mojarra 2.0.3 but not all.

    2) The references just fail

    Even with h:dataTable workaround, the reference to the inner h:dataTable from the button inside it fails. As there is no ui:repeat in use, this must be datatable's internal issue. I don't see any solution at the moment, so I filed a ticket for this behavior as well.

    0 讨论(0)
提交回复
热议问题