Prevent duplicate update of CFgrid

168 Views Asked by At

I have a CFgrid with selectMode="Edit". Again I have an update method binded to the cfgrid via my cfc. However I am ble to update the grid with duplicate values. I can prevent the db from updating by chking for existing record but I wanted to let the user be thrown with a message that his update was not succesful. In this case he will only know of his update not being succesfull only after he has refreshed the page only to find the old value still exist.

I wanted to know if there is any event within the cfgrid which I can trigger to show the user that his update is trying duplicate the data and cannot be completed.

1

There are 1 best solutions below

0
On

You haven't posted any code, but I am guessing you are using an HTML grid with the onChange attribute to trigger the edit? If that is the case, then you can also use the onError attribute and then just have your CFC throw an error if the data is not satisfactory with cfthrow. Then in your onError handler, you can handle the error as you please. You can find more information about working with HTML grids in CF9 here