Details
-
Type: Bug
-
Status: Open
-
Priority: Major
-
Resolution: Unresolved
-
Affects Version/s: 2.0.2
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:ICEfaces 2.0.2
Build number: 8
Revision: 24561
Apache Tomcat/7.0.26
Eclipse Indigo Service Release 2
Firefox 11.0
IE 9.0
-
Workaround Exists:Yes
-
Workaround Description:Hit F5 within the browser.
Description
I have this simple page:
{code}
<html xmlns:h="http://java.sun.com/jsf/html"
xmlns:ice="http://www.icesoft.com/icefaces/component">
<h:head></h:head>
<h:body>
<ice:form id="content_form">
<ice:commandButton value="#{JSBean.buttonText}"
action="#{JSBean.switchJavaScript}" />
<ice:panelGroup id="contentForm" rendered="#{JSBean.visible}">
<div id="myDiv">The JavaScript goes hier:</div>
<script type="text/javascript">/* <![CDATA[ */
alert("Hello World!");
/* ]]> */</script>
</ice:panelGroup>
</ice:form>
</h:body>
</html>
{code}
And this backing bean:
{code}
package sample.bean;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
@ManagedBean(name = "JSBean")
@SessionScoped
public class JavaScriptBean {
private boolean isVisible = false;
public void switchJavaScript() {
isVisible = !isVisible;
}
public String getButtonText() {
return isVisible() ? "Hide" : "Show";
}
public boolean isVisible() {
return isVisible;
}
}
{code}
The issue:
Loading the page the first time the JavaScript is hidden due to the panelGroup which is not rendered. But after I hit the button to "Show" the JavScript the panelGroup is rendered indeed but I miss the JavaScript tag at all. That's the output of Firebug:
{code}
<div id="content_form:contentForm" class="icePnlGrp">
<div id="myDiv">The JavaScript goes hier:</div>
</div>
{code}
{code}
<html xmlns:h="http://java.sun.com/jsf/html"
xmlns:ice="http://www.icesoft.com/icefaces/component">
<h:head></h:head>
<h:body>
<ice:form id="content_form">
<ice:commandButton value="#{JSBean.buttonText}"
action="#{JSBean.switchJavaScript}" />
<ice:panelGroup id="contentForm" rendered="#{JSBean.visible}">
<div id="myDiv">The JavaScript goes hier:</div>
<script type="text/javascript">/* <![CDATA[ */
alert("Hello World!");
/* ]]> */</script>
</ice:panelGroup>
</ice:form>
</h:body>
</html>
{code}
And this backing bean:
{code}
package sample.bean;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
@ManagedBean(name = "JSBean")
@SessionScoped
public class JavaScriptBean {
private boolean isVisible = false;
public void switchJavaScript() {
isVisible = !isVisible;
}
public String getButtonText() {
return isVisible() ? "Hide" : "Show";
}
public boolean isVisible() {
return isVisible;
}
}
{code}
The issue:
Loading the page the first time the JavaScript is hidden due to the panelGroup which is not rendered. But after I hit the button to "Show" the JavScript the panelGroup is rendered indeed but I miss the JavaScript tag at all. That's the output of Firebug:
{code}
<div id="content_form:contentForm" class="icePnlGrp">
<div id="myDiv">The JavaScript goes hier:</div>
</div>
{code}
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion