Details
- 
        Type: Bug Bug
- 
        Status: Closed
- 
            Priority: Major Major
- 
            Resolution: Fixed
- 
            Affects Version/s: EE-3.0.0.GA
- 
            Fix Version/s: 3.1.0.RC1, 3.1, EE-3.0.0.GA_P01
- 
            Component/s: Bridge
- 
            Labels:None
- 
            Environment:IceFaces 3.0.0 EE GA, Tomcat 7.x.x, Chrome, IE, FF
- 
                        Assignee Priority:P1
- 
                        ICEsoft Forum Reference:
Description
                    Under certain conditions, the bridge.js stops responding. This is caused by an uncaught exception in the function submitEventBroadcaster (line 1885 in bridge.js). The exception is "Uncaught TypeError: Cannot read property 'id' of null". Tracing it back it is caused when when jsf.js calls sendEvent with a null source because it couldn't find the element. 
ar sendEvent = function sendEvent(request, context, status) {
var data = {};
data.type = "event";
data.status = status;
data.source = context.sourceid;
if (typeof data.source === "string") {
data.source = document.getElementById(data.source)
}
if (status !== "begin") {
data.responseCode = request.status;
data.responseXML = request.responseXML;
data.responseText = request.responseText
}
if (context.onevent) {
context.onevent.call(null, data)
}
TO REPRODUCE:
1. Create the following page:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ace="http://www.icefaces.org/icefaces/components"
xmlns:ice="http://www.icesoft.com/icefaces/component"
>
<h:head>
<title>Case 11177</title>
<ice:outputStyle href="./xmlhttp/css/rime/rime.css" />
</h:head>
<h:body>
<h:form>
<h:commandButton value="Show" action="#{sessBean.toggleRendered}" />
<br/>
<center>
<h:panelGrid rendered="#{sessBean.rendered}">
<h:outputText value="Some text that will be dynamically rendered" />
<h:commandButton value="Hide" action="#{sessBean.toggleRendered}" />
</h:panelGrid>
</center>
</h:form>
</h:body>
</html>
2. And a session bean like the one below:
@ManagedBean
@SessionScoped
public class SessBean implements Serializable{
    
private boolean rendered;
public SessBean() {
rendered = false;
}
    
public String toggleRendered()
{
try {
Thread.currentThread().sleep(1000);
this.rendered = ! this.rendered;
}
catch (InterruptedException ex) {
Logger.getLogger(SessBean.class.getName()).log(Level.SEVERE, null, ex);
}
        
return null;
}
public boolean isRendered() { return rendered; }
public void setRendered(boolean rendered) { this.rendered = rendered; }
    
}
NOTES:
This behavior can be prevented with blockUIOnSubmit parameter set to true.
Once bridge is down no action can be constituted with a server via buttons, links e.t.c
            
ar sendEvent = function sendEvent(request, context, status) {
var data = {};
data.type = "event";
data.status = status;
data.source = context.sourceid;
if (typeof data.source === "string") {
data.source = document.getElementById(data.source)
}
if (status !== "begin") {
data.responseCode = request.status;
data.responseXML = request.responseXML;
data.responseText = request.responseText
}
if (context.onevent) {
context.onevent.call(null, data)
}
TO REPRODUCE:
1. Create the following page:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ace="http://www.icefaces.org/icefaces/components"
xmlns:ice="http://www.icesoft.com/icefaces/component"
>
<h:head>
<title>Case 11177</title>
<ice:outputStyle href="./xmlhttp/css/rime/rime.css" />
</h:head>
<h:body>
<h:form>
<h:commandButton value="Show" action="#{sessBean.toggleRendered}" />
<br/>
<center>
<h:panelGrid rendered="#{sessBean.rendered}">
<h:outputText value="Some text that will be dynamically rendered" />
<h:commandButton value="Hide" action="#{sessBean.toggleRendered}" />
</h:panelGrid>
</center>
</h:form>
</h:body>
</html>
2. And a session bean like the one below:
@ManagedBean
@SessionScoped
public class SessBean implements Serializable{
private boolean rendered;
public SessBean() {
rendered = false;
}
public String toggleRendered()
{
try {
Thread.currentThread().sleep(1000);
this.rendered = ! this.rendered;
}
catch (InterruptedException ex) {
Logger.getLogger(SessBean.class.getName()).log(Level.SEVERE, null, ex);
}
return null;
}
public boolean isRendered() { return rendered; }
public void setRendered(boolean rendered) { this.rendered = rendered; }
}
NOTES:
This behavior can be prevented with blockUIOnSubmit parameter set to true.
Once bridge is down no action can be constituted with a server via buttons, links e.t.c
Issue Links
- duplicates
- 
             ICE-7993
        JS error in bridge.js when submitting a form with the "enter" key ICE-7993
        JS error in bridge.js when submitting a form with the "enter" key-           
- Closed
 
-         
Backported fix maintenance branch.