hi,
I have table of data and a link on top in jsff in a task flow file which opens a popup dialog (af;dialog in a af:popup ) and it creates and inserts a new record of data as below:

| | public void createInsertNewAsset(PopupFetchEvent popupFetchEvent) { |
| | BindingContainer bindings = getBindings(); |
| | OperationBinding operationBinding = bindings.getOperationBinding("CreateInsert"); |
| | Object result = operationBinding.execute(); |
| | } |
| | public void createInsertNewAsset1(ActionEvent actionEvent) { |
| | BindingContainer bindings = getBindings(); |
| | OperationBinding operationBinding = bindings.getOperationBinding("CreateInsert"); |
| | Object result = operationBinding.execute(); |
| | } |
| | public void onDialogCancel(ClientEvent clientEvent) { |
| | // execute the method |
| | System.out.println("Method Start: onDialogCancel "); |
| | |
| | |
| | BindingContainer bindings = getBindings(); |
| | RichPopup popup = this.getPopup(); | |
| | popup.hide(); |
| | // rollback |
| | OperationBinding op= bindings.getOperationBinding("Rollback"); |
| | op.execute(); |
| | List errors = op.getErrors(); |
| | if (!errors.isEmpty()) |
| | { |
| | Exception ex = (Exception)errors.get(1); |
| | ex.printStackTrace(); |
| | } |
| | |
| | // get the current row for AST_ASSET table |
| | DCIteratorBinding astAssetsVOIterator = (DCIteratorBinding) bindings.get("AstAssetsVOIterator"); |
| | |
| | ViewObject assetsVO = astAssetsVOIterator.getViewObject(); |
| | |
| | // repopulate the asset list |
| | assetsVO.executeQuery(); |
| | System.out.println("Method End: re execute was successful! "); |
| | System.out.println("Method End: onDialogCancel "); |
| | } |
An then I have defined a af:clientListener and a af:serverListener to handle cases where user decides to cancel the operation which is taken care by "onDialogCancel" method above.

But, in practice when I cancel the operation:
-
if I use the escape button the onDialogCancel method is not called.
-
if I use the close button on top-left corner, it leaves a blank row bcuz of the createInsert from the popupFetchListener although the bound java code calls the rollback. The other point is that if I drag and drop a rollback operation from the DataControl windows it does the exact job for me so I assume there is difference between how it is done in onDialogCancel and how the DataControl => Rollback operation takes care of that.
I need to get a CRUD operation done successfully using ADF just as POC for a new charity project.
Your answers are really really appreciate it.
Regards,
J