Hi ADF Experts,
I have a requirement in which I have created two View Objects based on a single entity object.
I am using a first VO to display data in a table and the second to update data to database.
The commit will happen through a Global save button.
But before the global save, I need to show the data using the First VO, which is inserted using the second VO.
Can anyone help me on how to refresh the first VO to display the data.
Thanks in Advance
Edited by: 946185 on Mar 29, 2013 4:24 AM
I have not tried this, but you can try to post your changes after you insert data on your second VO and refresh the first VO page by setting proper query mode
//After VO2 insert
//Set query mode for your VO1
vo1.setQueryMode(ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES | ViewObject.QUERY_MODE_SCAN_ENTITY_ROWS | ViewObject.QUERY_MODE_SCAN_VIEW_ROWS);
But you might want not test how your screen saves the state during actv/passv.
Good luck !
Thanks for the response.
I will definitely try and let you know the result.
I got the same solution when I googgled the usecase.
But when I discussed the same solution with my superiors, they say that this piece of code will raise some performance issues.
Looks to me like there is no work around for this. Let me know if there is any another solution.
I hope that you didn't understand my requirement.
The solution you have given would surely work out If I am having only one VO in the model layer.
But I have two different VO's which are based on a single EO.
One VO, say VO1 is used for displaying the data in the UI as a table.
VO2 is used to update the table in the java code.
So, when VO2 updates the data, VO1 should be getting the changes done by VO2.
In this case having a partial trigger on the UI table using VO1 is not working out.
I don't understand why we need to create two VOs at first place. We can use the single VO for both display and update purpose. In that case we dont even bother about refreshing the VO after update.
The first VO which I mentioned is based on two EOs and has a lot of calculated values.
And to add to my worries there is a parent child relationship between the two EO's, where in parent is updated with one row and child with multiple rows.
The multiple rows updation to the child should happen with a shuttle component in a different popup.
So I am inserting everything programatically in the java code, where I need two use different VO to update parent and different VOs for the shuttle.
I could get the data, if it is committed, but to add to the complexity, there is a global save button which should commit the data.
So I want to get the data based on the EO update before commit to the database.
I Have tried the code below.
But with the line "vo1.setQueryMode(ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES | ViewObject.QUERY_MODE_SCAN_ENTITY_ROWS | ViewObject.QUERY_MODE_SCAN_VIEW_ROWS);",
the query is returning many duplicate values.
This is working fine.