Guys, tell me how to influence the selection of an element in the records from the dataTable. The table is filled with elements in the first columns of the edit and delete button, then the field
buttons before pressing
after the delete button is pressed, the element is deleted from DS, the table is updated and the button for deleting the first element from the remaining elements becomes selected and highlighted.
after removal
Someone tell me how to influence this, for example, I don’t want to choose which element at all or want to choose a button not in the first line but in an arbitrary one? here's the button code if that helps

<p:column style="width:32px;text-align: center"> <p:commandButton id="deleteItemBtnTree" icon="ui-icon-close" title="Удалить запись" actionListener="#{commonDimensionItemList.deleteItem(node)}" update="@([id$=commonDimensionItemPanel]), @([id$=treeTableId])" onstart="PF('commonDimensionItemPanelBlock').show()"/> 

Thank!

  • What if you delete the id from p: commandButton, or ensure its uniqueness? - bobzer
  • The id at the button is unique - Bender

1 answer 1

I solved this problem in this way, if someone helps in this situation - the only thing I have found so far is <p:focus for="name"/> here, my "name" is the id of the <p:inputText id="name".../> this is an element, the focus on which is more convenient for me. And for the button I added process and update for "@form" order not to lose the entered values ​​and at the same time updating the form, shift the focus. If you use not actionListner but f:ajax listener then in this case you need to use render and execute to update the form. If anyone knows an alternative solution - let me know.