Question
Barclays UK PLC
GB
Last activity: 10 Aug 2017 20:11 EDT
Refresh the Parent WO harness which is replaced by Child WO harness
I have a requirement to refresh the parent WO harness on close of Child WO harness.
The child WO harness replaces the parent WO and as soon as i close the child WO harness, the parent case re-appears but is not refreshed.
Can anyone help with this?
I already tried to run the follow script:-
function refreshParent()
{
}
pega,u.d.attachOnLoad(refreshParent);
This refreshes the section but only when it's reloaded and hence doesn't help.
Hello Eric,
Thanks for replying.
According to the business requirement, we don't resolve the child at any stage. The Child can be accessed through Parent by replacing the same document object and whenever the child is explicitly closed(a 'X' link on the header), the DOM points to Parent WO which was already loaded.
Although i've found a solution using two functions and a global variable:-
var global;
function A (){
global=false;
}
function B(){
if(global)
{
var section=pega.u.d.getSectionByName('xyz','');
pega.u.d.reloadSection(section,'preActivity','','true','true','-1',false);
}
global=false;
}
I am calling the function A just before the child wo gets created and function B on hover of the layout of the section that contains the details for the child cases refreshing only once when the user returns to the screen.
I've tested this with all the browsers and it works fine.
Also, i ran a preActivity to get the lock of the parent again using obj-refreshandlock whenever the user comes back to parent case so that there is no stale data and user should be able to perform other actions on the parent case immediately.