My angular app is loading in an iframe portlet.
In the parent JSP page, I have a form and submit the invisible button, which will open a popup window from an external app.
I am trying to click that button from the angular component.
Click is not working as expected, It’s working like onload. When the page is getting loaded popup is coming automatically.
Html page.
<html>
...
...
<!-- Left nav Menu-->
<div>
<ul> <li>....</li>
...
<li>
<a herf="javascript:void(0);" (click)="navigateToParentJspMethod('true')">Contact Us</a>
</li>
...
</html>
Component ts file
navigateToParentJspMethod(popupFlg: string){
console.log(popupFlg+' Test');
if(popupFlg==='true'){
$("#parentPageFrmSubmit", window.parent.document).click();
}
parent Jsp page
<script>
function openContactUsPopUpFromExternalApp(){
.....
document.getElementById("parentPageFrm").submit();
}
</script>
<form name="parentPageFrm" id="parentPageFrm" action="parentPageFrmSubmitAction" method="post" target="openContactUsWin">
<input type="hidden".....>
......
<button type="submit" id="parentPageFrmSubmit" style="display:none" onclick="openContactUsPopUpFromExternalApp()">Submit</button>
</form>
Thanks,
Rama
Tags: angular, function, java, javascriptjavascript, jquery