How to update specific row in Primefaces datatable

前端 未结 2 1277
南方客
南方客 2020-12-06 03:24

Primefaces 3.5, Mojarra 2.1.14. This is my PF datatable, it contains one non-editable boolean column named \'automatic\', and editable \'label\' column:



        
2条回答
  •  盖世英雄少女心
    2020-12-06 03:37

    You p:ajax tag is inside p:dataTable no in some specific row or column, so you cent so easy update some relative component id. You can with help of RequestContext update specific component in cell. So, remove update from p:ajax and add this to your onEditLabel method:

    RequestContext.getCurrentInstance().update(
      s.getClientId(FacesContext.getCurrentInstance()) +
      ":" + event.getRowIndex() +
      ":isAutomatic"
    );
    

    As you can see, id of component inside cell has row number before id you assigned.

提交回复
热议问题