0

I am working with some DataTables and LazyDataModels in my company's website and I've run into these already existing code that uses the value attribute to link the component to a LazyDataModel object in the Managed Bean, but it also uses the binding attribute to link it to a DataTable object.

So far so good, but I've been implementing the same samples with other pages and tables, until I've dealt with a deleting operation. The log showed a stack with a SQL Exception of the DB not being able to delete the row, but as I tried to reload the page, it was indeed deleted.

I proceeded to debug it and turns out JSF was calling the deleting method twice, and in the events handler, I noticed the method being called by my CommandLink (as I intended to) but also by the DataTable.

I solved it by removing the binding tag and using only the value.

Has anyone run into this kind of problem? I've searched some questions and the documentation, but only regarding the difference between the two tags, but nothing as of their usage at the same time. Any docs or links regarding to how JSF treats binded components vs linked values?

Jasper de Vries
  • 19,370
  • 6
  • 64
  • 102

0 Answers0