0

I have a form with one field from a view object based on entity object. The rest of the fields on the table have default values. I give the default values on the EOImpl.create method. When the page loads the view object is executed with parameters, and if there is a result it's in edit mode, and if there is no result I call createInsertRow.

<invokeAction id="executeWithParams" Binds="ExecuteWithParams"
     RefreshCondition="#{bindings.MyVO1Iterator.estimatedRowCount != 0}"
     Refresh="default"/>
<invokeAction id="createInsert" Binds="CreateInsert"
     RefreshCondition="#{bindings.MyVO1Iterator.estimatedRowCount == 0}"
     Refresh="default"/>
<action IterBinding="MyVO1Iterator" id="CreateInsert" 
    InstanceName="MyAppModuleDataControl.MyVO1"
    DataControl="MyAppModuleDataControl"
    RequiresUpdateModel="true" Action="ExecuteWithParams"/>
<action IterBinding="MyVO1Iterator" id="CreateInsert" 
    InstanceName="MyAppModuleDataControl.MyVO1"
    DataControl="MyAppModuleDataControl"
    RequiresUpdateModel="true" Action="executeWithParams"/>
<NamedData NDName="" NDvalue="" NDType=""/>

I have a problem with the execution order (create insert is run on the second time i enter the page). Another problem I have is that if the user does not enter data in the field I want to rollback the row without any validation errors, but it seems that validation is happening (maybe because I give the default fields?)

I also tried calling the create row from the VOImpl class based on the .first()==null condition. It works correctly for my first error but I still get the validation error when exiting the page.

What am I missing?

Thank you

1 Answers1

1

Here I'm assuming that you are trying to do some DML operation on your VO. I will suggest here to include your page in a bounded taskflow. By this you will have the control on your page before calling the page and after coming out of the page.

The rollback operation you can call on the Finalizer method of the taskflow. enter image description here

Bounded taskflow are used for transactions. My suggestion will be to use a bounded taskflow whenever you are doing any transaction and also you can secure the pages.

bounded task flow versus unbounded taskflow in ADF

Let me know if it is not clear, or need any more info.

Ashok Jena
  • 166
  • 2
  • Thanks!! I tried this as it looks exactly what I want, but apparently the validation hits first and then the finalizer method .. – NotApplicable Jun 04 '18 at 18:16
  • Ok.. can you please tell me what type of validation you are using in your page..? Is it in EO level or page level? Earlier how you were able to come out of the page if it was there? Give some screenshot of your page if possible.. – Ashok Jena Jun 05 '18 at 01:53
  • 1
    On a second thought, if you are clicking on any button or link to come out of the page, then you can set immediate property to true on that item. – Ashok Jena Jun 05 '18 at 06:15
  • Sorry for answering after so many days. The validation is EO level. I managed to overcome this by implementing the dodml on the EOImpl class. Thanks again! – NotApplicable Jun 18 '18 at 09:45