Note that there are some explanatory texts on larger screens.

plurals
  1. POwindow.location.href not working in jsf
    text
    copied!<p>I have a jsf xhtml page</p> <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich"&gt; &lt;head&gt; &lt;f:loadBundle basename="myProperties" var="msg" /&gt; &lt;/head&gt; &lt;f:view&gt; &lt;body&gt; &lt;h:form method="post" name="redirectForm" id="redirectId"&gt; &lt;div&gt; &lt;br /&gt; &lt;table width="100%" border="0" align="center"&gt; &lt;tr&gt; &lt;td align="center" width="100%" class="style1"&gt;Please wait. The page is getting loaded...&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;input type="hidden" name="msg" value="#{myBean.transMsg}" /&gt; &lt;input type="hidden" id="pgURLId" name="pgurl" value="#{myBean.pgURL}" /&gt; &lt;/div&gt; &lt;/h:form&gt; &lt;script type="text/javascript"&gt; /* &lt;![CDATA[ */ function forward() { var pgUrlId=getElementForAnId('pgURLId'); var pgValue=document.getElementById(pgUrlId).value; var formId=getElementForAnId('redirectId'); document.getElementById(formId).action = pgValue; document.getElementById(formId).submit(); window.location.href = pgValue; } forward(); function getElementForAnId(str) // To removing appending content { var ret; var inputs = document.getElementsByTagName('*'); for ( var i = 0; i &lt; inputs.length; i++) { if (inputs[i].id.indexOf(str) != -1) { ret = inputs[i].id; } } return ret; } /* ]]&gt; */ &lt;/script&gt; &lt;/body&gt; &lt;/f:view&gt; &lt;/html&gt; </code></pre> <p>I'm using liferay-portal-6.0.6 and jboss-5.1.0</p> <p>I'm able to hit that pgurl but the msg is not getting posted.</p> <p>When I see it in my logs the msg received is null.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload