Author: abelevich
Date: 2008-07-30 07:45:23 -0400 (Wed, 30 Jul 2008)
New Revision: 9824
Modified:
trunk/ui/core/src/main/java/org/ajax4jsf/component/UIInclude.java
Log:
https://jira.jboss.org/jira/browse/RF-3813
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/component/UIInclude.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/component/UIInclude.java 2008-07-30 10:46:45
UTC (rev 9823)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/component/UIInclude.java 2008-07-30 11:45:23
UTC (rev 9824)
@@ -22,7 +22,9 @@
package org.ajax4jsf.component;
import javax.el.ELContext;
+import javax.el.ELException;
import javax.el.ValueExpression;
+import javax.faces.FacesException;
import javax.faces.component.NamingContainer;
import javax.faces.component.UIComponent;
import javax.faces.component.UIComponentBase;
@@ -48,9 +50,12 @@
public static final String LAYOUT_BLOCK ="block";
public static final String LAYOUT_INLINE ="inline";
-
- private boolean wasNavigation = false;
+ private boolean _ajaxRendered = true;
+ private boolean _ajaxRenderedSet = false;
+
+ private boolean wasNavigation = false;
+
/*
* (non-Javadoc)
@@ -58,7 +63,7 @@
* @see org.ajax4jsf.framework.ajax.ViewIdHolder#skipNavigation(java.lang.String)
*/
public boolean skipNavigation(String ViewId) {
- wasNavigation = true;
+// wasNavigation = true;
return true;
}
@@ -120,12 +125,31 @@
public boolean isAjaxRendered() {
- return (!LAYOUT_NONE.equals(getLayout())) && wasNavigation;
+ Boolean value = null;
+ if(!this._ajaxRenderedSet) {
+ ValueExpression ve = getValueExpression("ajaxRendered");
+ if (ve != null) {
+ try {
+ value = (Boolean) ve.getValue(getFacesContext().getELContext());
+ } catch (ELException e) {
+ throw new FacesException(e);
+ }
+ }
+ }
+
+ if (null == value) {
+ value = this._ajaxRendered;
+ }
+
+ return (!LAYOUT_NONE.equals(getLayout())) && value;
}
public void setAjaxRendered(boolean ajaxRendered) {
- // unsupported
+ this._ajaxRendered = ajaxRendered;
+ this._ajaxRenderedSet = true;
}
+
+
/*
* (non-Javadoc)
*
@@ -196,16 +220,20 @@
super.restoreState(context, componentState[0]);
this._viewId = (String) componentState[1];
this._layout = (String) componentState[2];
- }
+ this._ajaxRendered = ((Boolean) componentState[3]).booleanValue();
+ this._ajaxRenderedSet = ((Boolean) componentState[4]).booleanValue();
+ }
/* (non-Javadoc)
* @see
javax.faces.component.UIComponentBase#saveState(javax.faces.context.FacesContext)
*/
public Object saveState(FacesContext context) {
- Object[] componentState = new Object[3];
+ Object[] componentState = new Object[5];
componentState[0] = super.saveState(context);
componentState[1] = _viewId;
componentState[2] = _layout;
+ componentState[3] = Boolean.valueOf(_ajaxRendered);
+ componentState[4] = Boolean.valueOf(_ajaxRenderedSet);
return componentState;
}