How to use OmniFaces Ajax.updateColumn() or Ajax.updateRow() via p:ajax

后端 未结 1 674
我寻月下人不归
我寻月下人不归 2021-01-21 10:33

I am attempting to use the Ajax.updateColumn() method of the OmniFaces 1.3 (SNAPSHOT) Ajax utility. More specifically, I want to replace the use p:ajax update=\":pageContentPane

1条回答
  •  伪装坚强ぢ
    2021-01-21 10:47

    The key point is that you've got to have a handle to the UIData component somehow so that you can pass it to Ajax#updateColumn(). In your particular case, easiest way would be to get it by event.getComponent() with help of Components#getClosestParent().

    UIData tripDatesDataTable = Components.getClosestParent(event.getComponent(), UIData.class);
    // ...
    Ajax.updateColumn(tripDatesDataTable, 1);
    

    Note that you can also just get the row number this way without the need to break down the client ID.

    int rowNumber = tripDatesDataTable.getRowIndex();
    

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