Trigger/activate the RowEditor from bean for a primefaces In-Cell editing enabled p:dataTable

前端 未结 9 863
时光说笑
时光说笑 2021-01-02 10:16

I have a primefaces p:dataTable with InCell editing enabled and want to trigger/activate the RowEditor for the newly added row.

Excerpt of XHTML

9条回答
  •  伪装坚强ぢ
    2021-01-02 10:48

    To solve this is better to use styleClass and because for fix this it is necessary to use javascript, you need to check the html tags in your browser, because it seems that they change with the versions of primefaces. For vesion 6.1 I've put this on my bean:

    RequestContext requestContext = RequestContext.getCurrentInstance();
    requestContext.execute("$('.styleEventosPlanPrestacion tbody.ui-datatable-data tr:first-child td div.ui-row-editor a.ui-row-editor-pencil').click()");
    

    and In my .xhtml I've put this:

    
    

提交回复
热议问题