Important Update: Community URLs redirect issues are partially resolved. Learn More. .

cancel
Showing results for 
Search instead for 
Did you mean: 

Hijack Close Button

Saravanan
Contributor III

Hi All,

 

I have a requirement that if i click Close button on the record, it should move to Home page instead of previous page.  I guess its working based on the function "parent.ArcherApp.service.ArcherInterface.redirectBackward("Home","xxx","xxx")".  Could anyone please help me to manually set this RedirectBackward function parameters or achieve this functionality?

8 REPLIES 8

DavidPetty
Archer Employee
Archer Employee

Saravanan, what is the "home" page; task-driven or a specific workspace?

 Advisory Consultant

Task driven page..

DavidPetty
Archer Employee
Archer Employee

See how this works:

<script type="text/javascript">
$('.frame-icon-close').attr('href','#').click(function(){
parent.ArcherApp.service.ArcherInterface.redirectBackward("Home","f04ac1ef-2d81-4152-b6dc-e6afd60308a3","");
});
</script>

 Advisory Consultant

Its working fine, if there is no unsaved data.  If any unsaved data is there, its throwing two pop-ups for dirty content

check usually it will be one popup.

 

Also i want to confirm whether the 2nd param value to redirectBackward is fixed.  Because when i did F12, it differed every time.  I thought its some pr value or sessionstate id.

 

Close_Btn_Issue.PNG

Usually Archer will have two type of Warning box.  Warning Box with Formatting is displayed when we click View or Close buttons and Warning Box without Formatting will be displayed when we click anywhere in Navigation menu like Home or Workspace button.

I assume here its making data-check-dirty value for both the Warning box as "True".  Ideally, close button should display Warning box with Formatting. With below code, i am able to neglect one Warning box, but its displaying the Warning Box without Formatting

 

<script type="text/javascript">
$('.frame-icon-close').attr('href','#').attr('data-check-dirty',"false").click(function(){
parent.ArcherApp.service.ArcherInterface.redirectBackward("Home","f04ac1ef-2d81-4152-b6dc-e6afd60308a3","");
});
</script>

May I know what are the parameters here - 

redirectBackward("Home","f04ac1ef-2d81-4152-b6dc-e6afd60308a3","")

Cause it looks like it goes to the home page all the time. 

@eyambao, there is no documentation on what's the valid parameters for the function are.  It's current configuration will indeed take the user to the "home" page.

 Advisory Consultant

Was able to get rid of the warning box by - 

parent.ArcherApp.service.ArcherInterface.clearAllDirtyContent();