Author: konstantin.mishin
Date: 2008-06-19 08:22:10 -0400 (Thu, 19 Jun 2008)
New Revision: 9106
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/context/ViewResourcesPhaseEventHandler.java
trunk/framework/impl/src/main/resources/META-INF/services/org.richfaces.component.ComponentPhaseEventHandler
Log:
RF-2815
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/context/ViewResourcesPhaseEventHandler.java
===================================================================
---
trunk/framework/impl/src/main/java/org/ajax4jsf/context/ViewResourcesPhaseEventHandler.java 2008-06-18
22:50:42 UTC (rev 9105)
+++
trunk/framework/impl/src/main/java/org/ajax4jsf/context/ViewResourcesPhaseEventHandler.java 2008-06-19
12:22:10 UTC (rev 9106)
@@ -14,7 +14,6 @@
import javax.faces.FactoryFinder;
import javax.faces.application.Application;
import javax.faces.component.UIComponent;
-import javax.faces.component.UIViewRoot;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.faces.event.PhaseEvent;
@@ -68,11 +67,13 @@
LinkedHashSet<String> userScripts = new LinkedHashSet<String>();
LinkedHashSet<String> userStyles = new LinkedHashSet<String>();
+
+ boolean ajaxRequest = AjaxContext.getCurrentInstance().isAjaxRequest(context);
+
if (log.isDebugEnabled()) {
log
.debug("Process component tree for collect used scripts and styles");
}
- UIViewRoot root = context.getViewRoot();
try {
Skin skin = SkinFactory.getInstance().getSkin(context);
// For a "NULL" skin, do not collect components stylesheets
@@ -96,8 +97,7 @@
.equals(scriptStrategy)) {
processScripts = false;
// For an "ALL" strategy, it is not necessary to load scripts in the ajax
request
- //TODO add !this.isAjaxRequest(context)
- if (false) {
+ if (!ajaxRequest) {
try {
scripts.add(internetResourceBuilder
.createResource(
@@ -148,8 +148,7 @@
processStyles = false;
// For an "ALL" strategy, it is not necessary to load styles
// in the ajax request
- //TODO add !this.isAjaxRequest(context)
- if (false) {
+ if (!ajaxRequest) {
String commonStyle = InternetResourceBuilder.COMMON_STYLE_PREFIX;
if (useStdControlsSkinning
Modified:
trunk/framework/impl/src/main/resources/META-INF/services/org.richfaces.component.ComponentPhaseEventHandler
===================================================================
---
trunk/framework/impl/src/main/resources/META-INF/services/org.richfaces.component.ComponentPhaseEventHandler 2008-06-18
22:50:42 UTC (rev 9105)
+++
trunk/framework/impl/src/main/resources/META-INF/services/org.richfaces.component.ComponentPhaseEventHandler 2008-06-19
12:22:10 UTC (rev 9106)
@@ -1 +1,2 @@
-org.ajax4jsf.component.UIDataAdaptorPhaseEventHandler
\ No newline at end of file
+org.ajax4jsf.component.UIDataAdaptorPhaseEventHandler
+org.ajax4jsf.context.ViewResourcesPhaseEventHandler
\ No newline at end of file