getting inputText on only the first row of a (Primefaces) dataTable, with dynamic columns and rows

前端 未结 2 1198
你的背包
你的背包 2021-01-25 18:39

I have a Primefaces (5.0) Datatable with dynamic columns as well as dynamic rows. In brief, my problem is how do I set it up so that the cells of the first row are a series of i

2条回答
  •  逝去的感伤
    2021-01-25 19:29

    Since you asked you want only the 1st row is editable, I have asked you to use rowIndexVar to manage the rows.

    You can use p:dataTable's rowIndexVar attribute.

    rowIndexVar is Name of iterator to refer each row index.

    Whose iterator name can be used in EL to get the Row Id

    For example: if rowIndexVar="row" then you can access each row Index using that iterator name in EL using #{row}.

    Example Code:

    
        
           
                            
            
        
        ....
    
    

提交回复
热议问题