Hi All,
I have one requirement, wher after sending mail, the setComponentReturn() method shoul;d be called.
I have written the following code:
public void onInit(ArgumentList arg)
{
System.out.println("inside sendlocator objId: in onRenderend");
objID=arg.get("objectId");
System.out.println("eihtin oninit sendlocator objId: "+objID);
IDfSession seSS=getDfSession();
IDfId id = new DfId(objID);
IDfSysObject sysObj=null;
try {
sysObj = (IDfSysObject) seSS.getObjectByQualification("emc_contract where r_object_id=\'"+objID+"\'");
if(sysObj==null){
objID=null;
System.out.println("sysobject is null");
}
} catch (DfException e) {
objID=null;
e.printStackTrace();
}
System.out.println("inside returnToCallingComponent::::: ");
setComponentReturn();
// super.onInit(arg);
But if I am calling the setComponentReturn() method in above, then my email functionality is not working.
If I am commenting the setComponentReturn() method as //setComponentReturn(), then it is calling my email functionality.
But My requirement is that after email will be sent, setComponentReturn() method should be called. But in my case either I can call email functionality "or" i can call the setComponentReturn() method.
Kindly help me on this.
My Javascript is as below.
<script>
function redirect(){
//alert('<%=link %>');
//window.open('<%=link %>');
var sendlinkmail = 'mailto:?subject=CMC Document link' +'&body=Hi There%0A%0APlease click on the link below to view the Document.%0A%0A'+'<%=link %>'+'%0A%0AYou may be redirected to login page, after login kindly click on above link again.%0A%0AThank You%0ACMC Administrator';
window.location.href = sendlinkmail;
//self.close();
//postServerEvent(null, null, null, "returnToCallingComponent");
//postServerEvent(document.forms[0].name,null,null,"Invokemessage","ctrmain",ctrmain);
}
</script>
</head>
<body id="modalSmall"
<body style="background-color:#D2E7FD;" style="align:c"
<% if(objID!=null){%>
onload='redirect()'>
<% } else { %>
>
Thanks,
Sonu