Reputation: 61
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
Upvotes: 0
Views: 610
Reputation: 166
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.
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.
Upvotes: 1