Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 3.0.RC2
-
Fix Version/s: 3.0
-
Component/s: Framework, Sample Apps
-
Labels:None
-
Environment:ICEfaces 3 Mojarra
-
Assignee Priority:P2
Description
I haven't noticed the same behaviour with MyFaces but when running something like ACE Showcase with Mojarra, the jsf.js file is loaded twice. The reason is that the h:commandLink components used on the page will render out an inline reference to the file if Mojarra determines it's necessary. You can see it in the CommandLinkRenderer class:
@Override
public void encodeBegin(FacesContext context, UIComponent component)
throws IOException {
rendererParamsNotNull(context, component);
if (!shouldEncode(component)) {
return;
}
boolean componentDisabled =
Boolean.TRUE.equals(component.getAttributes().get("disabled"));
String formClientId = RenderKitUtils.getFormClientId(component, context);
if (componentDisabled || formClientId == null) {
renderAsDisabled(context, component);
} else {
RenderKitUtils.renderJsfJs(context);
renderAsActive(context, component);
}
}
In the method, it attempt to do a check to see if jsf.js is already there (which we do in the BridgeSetup) but it presumably fails that check and renders out an inline script for the benefit of the onclick handler:
<li style="padding-left: 15px;">
<script src="/mo/javax.faces.resource/jsf.js.jsf?ln=javax.faces&stage=Development"
type="text/javascript">
</script>
<a class="selected"
href="#"
id="j_idt20:j_idt22:24:j_idt30:0:_t32"
onclick="mojarra.jsfcljs(document.getElementById('j_idt20'),{'j_idt20:j_idt22:24:j_idt30:0:_t32':'j_idt20:j_idt22:24:j_idt30:0:_t32'},'');return false"
title="Overview">
<span id="j_idt20:j_idt22:24:j_idt30:0:_t33">> Overview</span>
</a>
</li>
@Override
public void encodeBegin(FacesContext context, UIComponent component)
throws IOException {
rendererParamsNotNull(context, component);
if (!shouldEncode(component)) {
return;
}
boolean componentDisabled =
Boolean.TRUE.equals(component.getAttributes().get("disabled"));
String formClientId = RenderKitUtils.getFormClientId(component, context);
if (componentDisabled || formClientId == null) {
renderAsDisabled(context, component);
} else {
RenderKitUtils.renderJsfJs(context);
renderAsActive(context, component);
}
}
In the method, it attempt to do a check to see if jsf.js is already there (which we do in the BridgeSetup) but it presumably fails that check and renders out an inline script for the benefit of the onclick handler:
<li style="padding-left: 15px;">
<script src="/mo/javax.faces.resource/jsf.js.jsf?ln=javax.faces&stage=Development"
type="text/javascript">
</script>
<a class="selected"
href="#"
id="j_idt20:j_idt22:24:j_idt30:0:_t32"
onclick="mojarra.jsfcljs(document.getElementById('j_idt20'),{'j_idt20:j_idt22:24:j_idt30:0:_t32':'j_idt20:j_idt22:24:j_idt30:0:_t32'},'');return false"
title="Overview">
<span id="j_idt20:j_idt22:24:j_idt30:0:_t33">> Overview</span>
</a>
</li>
Activity
Deryk Sinotte
created issue -
Deryk Sinotte
made changes -
Field | Original Value | New Value |
---|---|---|
Environment | ICEfaces 3 | ICEfaces 3 Mojarra |
Salesforce Case | [] | |
Assignee Priority | P2 | |
Assignee | Mircea Toma [ mircea.toma ] |
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #27106 | Thu Jan 05 15:33:58 MST 2012 | mircea.toma | |
Files Changed | ||||
MODIFY
/icefaces3/trunk/icefaces/core/src/main/java/org/icefaces/impl/event/BridgeSetup.java
|
Mircea Toma
made changes -
Status | Open [ 1 ] | Resolved [ 5 ] |
Resolution | Fixed [ 1 ] |
Ken Fyten
made changes -
Status | Resolved [ 5 ] | Closed [ 6 ] |
Assigning to Mircea