Quantcast
Channel: Andrej Baranovskij Blog
Viewing all articles
Browse latest Browse all 705

Immediately Removing New Row Without Validation in ADF

$
0
0
Once new row is inserted but not yet saved and if validation rules are defined for the attributes - it may cause problems removing this new row (let's say user changes his mind and decides to remove unwanted row). Of course user can invoke Rollback, but this is not what is always desired. User should be able to remove row with one single click - by pressing Delete button. And this is really easy to achieve in ADF, but not always obvious. You need to set Immediate = true as property for Delete button, it will call then Delete operation ignoring any validations for the current row.

Here you can download working sample application - NewRowRemoveApp.zip.

I will describe first how it works by default. User inserts new record and without providing all required data decides to remove this row by pressing Delete button. Submit happens and ADF brings all failed validation messages - this is not what user expects when simply trying to remove row:


Situation will change with Immediate = true property for Delete button on ADF UI - this allows to skip validation invocation and call Delete operation quietly:


Test again with Immediate = true. Insert new record, try to commit or move to another record to force validation messages:


Press Delete button - problematic record will be removed instantly without reporting validation errors on Delete:


Viewing all articles
Browse latest Browse all 705

Trending Articles