Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable pencil of rowEditor in primeFaces

I need to disable row Editor in some rows(because of their specific data) I search too much but I can't find a way to do that.

I have two type of rows,rows with status A and rows with status B.

I want to enable pencil for rows A and disable for rows B.

like image 908
Mahdi Avatar asked Apr 11 '13 13:04

Mahdi


2 Answers

You can:

 <p:column rendered="#{listvar.status != 'B'}">  
                    <p:rowEditor />  
 </p:column>
like image 142
Rong Nguyen Avatar answered Oct 23 '22 12:10

Rong Nguyen


Rong's answer is great, but you will notice that if you render the column your table will miss some lines...

Just put the rendered on the rowEditor to avoid this design issue :

    <p:column >  
                    <p:rowEditor rendered="#{listvar.status != 'B'}" />        
</p:column>  
like image 1
Farid Avatar answered Oct 23 '22 12:10

Farid