In my project I'm using PrimeFaces components to define GUI. I'm using TreeTable
component, where its items can be selected and the body is scrollable.
Next to the table, I have a CommandButton
, that adds the new item to the table. This item is then created, TreeTable
is updated via ajax and the new item is selected. Problem I'm trying to solve is how to scroll to the new item. I have item's row key, so I can reconstruct its id, so I've tried to add this to my CommandButton
:
oncomplete="PrimeFaces.focus('form1:mainTreeTable_node_0_0_3_1');"
, where 0_0_3_1 is the row key. This only focuses the row, but does not scroll the body of the table to it. Is there a way how to achieve this behaviour?