Change src of IFRAME to URL dinamically generated in JSF
I have a rich:modalPanel being triggered by an a4j:button in a xhtml page
(Facelets). Inside the modal, there is an html:IFRAME in order to redirect
the flow to another system's page login.
The problem is that external page expects a parameter. This parameter is
set in a Managed Bean and referenced by the IFRAME, like this:
<rich:modalPanel id="modalCadastramentoProcessoSAJ"
styleClass="modalForms" width="800" height="400" zindex="1001"
style="overflow:auto">
...
<iframe id="frameSAJ" width="750" height="600"
src="changeIframeSrc(#{tratarProcessoMB.urlString})"/>
</rich:modalPanel>
By doing that, I am receiving a HTTP 404 error. Therefore, the URL is not
being built correctly. Below is the Javascript code:
<script language="Javascript" type="text/javascript">
function changeIframeSrc(param)
{
<!--
var str1 = "<IP>/saj/loginIntegracao.jsf?sistema=TDCS¶metro=";
var srcString = str1.concat(param);
document.getElementById("frameSAJ").src = srcString;
-->
}
</script>
How can I dinamically build this URL ?
I've tried to pass it by POST, but the result is a blank page redirecting,
inside the IFRAME.
No comments:
Post a Comment