JBoss Rich Faces SVN: r15295 - root.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2009-08-25 10:52:10 -0400 (Tue, 25 Aug 2009)
New Revision: 15295
Modified:
root/richfaces-examples.xml
Log:
Update 4.0 ALPHA1 assembler for new structure
https://jira.jboss.org/jira/browse/RF-7745
Modified: root/richfaces-examples.xml
===================================================================
--- root/richfaces-examples.xml 2009-08-25 12:47:12 UTC (rev 15294)
+++ root/richfaces-examples.xml 2009-08-25 14:52:10 UTC (rev 15295)
@@ -24,8 +24,8 @@
<fileSet>
<directory>/</directory>
<includes>
- <include>src/</include>
- <include>pom.xml</include>
+ <include>**/src/</include>
+ <include>**/pom.xml</include>
</includes>
</fileSet>
</fileSets>
@@ -54,8 +54,8 @@
<fileSet>
<directory>/</directory>
<includes>
- <include>src/</include>
- <include>pom.xml</include>
+ <include>**/src/</include>
+ <include>**/pom.xml</include>
</includes>
</fileSet>
</fileSets>
15 years, 4 months
JBoss Rich Faces SVN: r15294 - in root/ui/trunk/components/core/src/main/java/org/ajax4jsf: facelets/tag and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-08-25 08:47:12 -0400 (Tue, 25 Aug 2009)
New Revision: 15294
Modified:
root/ui/trunk/components/core/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java
root/ui/trunk/components/core/src/main/java/org/ajax4jsf/facelets/tag/AjaxHandler.java
Log:
fix setters for queueId, statusId, similarityGroupingId, render, execute
Modified: root/ui/trunk/components/core/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java 2009-08-25 12:30:48 UTC (rev 15293)
+++ root/ui/trunk/components/core/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java 2009-08-25 12:47:12 UTC (rev 15294)
@@ -1,11 +1,15 @@
package org.ajax4jsf.component.behavior;
+import java.util.Collection;
+import java.util.Set;
+
import javax.el.ELContext;
import javax.el.ValueExpression;
import javax.faces.component.behavior.FacesBehavior;
import javax.faces.context.FacesContext;
import org.ajax4jsf.component.AjaxClientBehavior;
+import org.ajax4jsf.renderkit.AjaxRendererUtils;
/**
* @author Anton Belevich
@@ -16,14 +20,21 @@
public static final String BEHAVIOR_ID = "org.ajax4jsf.behavior.Ajax";
- public static final String LIMIT_RENDER = "limitRender";
+ private static enum Attributes {
+
+ limitRender, queueId, statusId, render, execute, similarityGroupingId, other;
+
+
+ public static Attributes toAttribute(String name) {
+
+ try {
+ return valueOf(name);
+ } catch (Exception ex) {
+ return other;
+ }
+ }
+ };
- public static final String QUEUE_ID = "queueId";
-
- public static final String STATUS_ID = "statusId";
-
- public static final String SIMILARITY_GROPING = "similarityGroupingId";
-
private Boolean limitRender;
private String queueId;
@@ -32,15 +43,57 @@
private String similarityGroupingId;
+ private Set <String> render;
+
+ private Set <String> execute;
+
+
+ protected Set<String> asSet(Object render) {
+ return AjaxRendererUtils.asSet(render);
+ }
+
+ public void setRender(Collection<String> render) {
+ this.render = asSet(render);
+ clearInitialState();
+ }
+
+ public Collection<String> getRender() {
+ return getCollectionValue(render, "RENDER");
+ }
+
+ public void setExecute(Collection<String> execute) {
+ this.execute = asSet(execute);
+ clearInitialState();
+ }
+
+ public Collection<String> getExecute() {
+ return getCollectionValue(execute, Attributes.execute.toString());
+ }
+
+ protected Collection<String> getCollectionValue(Collection<String> collection, String attribute) {
+ if(collection != null) {
+ return collection;
+ }
+
+ ValueExpression ve = getValueExpression(attribute) ;
+ if(ve != null) {
+ FacesContext context = FacesContext.getCurrentInstance();
+ Object value = ve.getValue(context.getELContext());
+ return asSet(value);
+ }
+
+ return this.render;
+ }
+
public String getSimilarityGroupingId() {
if(this.similarityGroupingId != null) {
return this.similarityGroupingId;
}
- ValueExpression ex = getValueExpression(SIMILARITY_GROPING);
- if(ex != null) {
+ ValueExpression ve = getValueExpression(Attributes.similarityGroupingId.toString());
+ if(ve != null) {
ELContext elContext = FacesContext.getCurrentInstance().getELContext();
- String value = ((String)ex.getValue(elContext));
+ String value = ((String)ve.getValue(elContext));
return value;
}
@@ -57,10 +110,10 @@
return this.statusId;
}
- ValueExpression ex = getValueExpression(STATUS_ID);
- if(ex != null) {
+ ValueExpression ve = getValueExpression(Attributes.statusId.toString());
+ if(ve != null) {
ELContext elContext = FacesContext.getCurrentInstance().getELContext();
- String value = ((String)ex.getValue(elContext));
+ String value = ((String)ve.getValue(elContext));
return value;
}
@@ -77,10 +130,10 @@
return this.queueId;
}
- ValueExpression ex = getValueExpression(QUEUE_ID);
- if(ex != null) {
+ ValueExpression ve = getValueExpression(Attributes.queueId.toString());
+ if(ve != null) {
ELContext elContext = FacesContext.getCurrentInstance().getELContext();
- String value = ((String)ex.getValue(elContext));
+ String value = ((String)ve.getValue(elContext));
return value;
}
@@ -99,10 +152,10 @@
return this.limitRender.booleanValue();
}
- ValueExpression ex = getValueExpression(LIMIT_RENDER);
- if(ex != null) {
+ ValueExpression ve = getValueExpression(Attributes.limitRender.toString());
+ if(ve != null) {
ELContext elContext = FacesContext.getCurrentInstance().getELContext();
- Boolean value = ((Boolean)ex.getValue(elContext));
+ Boolean value = ((Boolean)ve.getValue(elContext));
return value != null ? value.booleanValue() : false;
}
@@ -121,6 +174,41 @@
}
@Override
+ public void setValueExpression(String name, ValueExpression expression) {
+ if(expression != null && expression.isLiteralText()) {
+ Object value = getExpressionLiteralValue(expression);
+ switch(Attributes.toAttribute(name)) {
+
+ case limitRender:
+ this.limitRender = value != null ? (Boolean)value : Boolean.FALSE ; break;
+
+ case execute :
+ this.execute = value != null ? asSet(value) : null; break;
+
+ case render :
+ this.render = value != null ? asSet(value) : null; break;
+
+ case queueId :
+ this.queueId = value != null ? (String)value : null; break;
+
+ case statusId :
+ this.statusId = value != null ? (String)value : null; break;
+
+ case similarityGroupingId :
+ this.similarityGroupingId = value != null ? (String)value: null; break;
+
+ default: break;
+
+ }
+ }
+ super.setValueExpression(name, expression);
+ }
+
+ protected Object getExpressionLiteralValue(ValueExpression expression) {
+ return expression != null ? expression.getValue(FacesContext.getCurrentInstance().getELContext()) : null;
+ }
+
+ @Override
public Object saveState(FacesContext context) {
Object superState = super.saveState(context);
Object[] values;
@@ -132,35 +220,20 @@
values = new Object[] { superState };
}
} else {
- values = new Object[2];
+ values = new Object[7];
values[0] = superState;
values[1] = limitRender;
+ values[2] = execute;
+ values[3] = render;
+ values[4] = queueId;
+ values[5] = statusId;
+ values[6] = similarityGroupingId;
}
return values;
}
-
+
@Override
- public void setValueExpression(String name, ValueExpression expression) {
- if(expression != null && expression.isLiteralText()) {
- if(LIMIT_RENDER.equals(name)) {
- Object value = getExpressionLiteralValue(expression);
- this.limitRender = value != null ? (Boolean)value : Boolean.FALSE ;
- }
- }
- super.setValueExpression(name, expression);
- }
-
- protected Object getExpressionLiteralValue(ValueExpression expression) {
- Object value = null;
- if(expression != null) {
- ELContext elContext = FacesContext.getCurrentInstance().getELContext();
- value = expression.getValue(elContext);
- }
- return value;
- }
-
- @Override
public void restoreState(FacesContext context, Object state) {
if (state != null) {
@@ -168,7 +241,12 @@
super.restoreState(context, values[0]);
if (values.length != 1) {
- limitRender = ((Boolean)values[1]).booleanValue();
+ this.limitRender = ((Boolean)values[1]).booleanValue();
+ this.execute = asSet(values[2]);
+ this.render = asSet(values[3]);
+ this.queueId = (String)values[4];
+ this.statusId = (String)values[5];
+ this.similarityGroupingId = (String)values[6];
clearInitialState();
}
}
Modified: root/ui/trunk/components/core/src/main/java/org/ajax4jsf/facelets/tag/AjaxHandler.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/ajax4jsf/facelets/tag/AjaxHandler.java 2009-08-25 12:30:48 UTC (rev 15293)
+++ root/ui/trunk/components/core/src/main/java/org/ajax4jsf/facelets/tag/AjaxHandler.java 2009-08-25 12:47:12 UTC (rev 15294)
@@ -111,7 +111,7 @@
} else if (parent instanceof ClientBehaviorHolder) {
applyAttachedObject(ctx, parent, eventName);
} else {
- throw new TagException(this.tag,"Unable to attach <f:ajax> to non-ClientBehaviorHolder parent");
+ throw new TagException(this.tag,"Unable to attach <a4j:ajax> to non-ClientBehaviorHolder parent");
}
}
15 years, 4 months
JBoss Rich Faces SVN: r15293 - root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-08-25 08:30:48 -0400 (Tue, 25 Aug 2009)
New Revision: 15293
Modified:
root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java
Log:
Added support for spaces-separated list in render/execute attributes
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java 2009-08-25 09:28:07 UTC (rev 15292)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java 2009-08-25 12:30:48 UTC (rev 15293)
@@ -635,13 +635,13 @@
}
// Tokenize string.
else if (valueToSet instanceof String) {
- String areasString = (String) valueToSet;
- if (areasString.indexOf(",") > 0) {
- return new LinkedHashSet<String>(Arrays.asList(areasString.trim().split(
- "(\\s)*,(\\s)*")));
+ String areasString = ((String) valueToSet).trim();
+ if (areasString.indexOf(",") > 0 || areasString.indexOf(" ") > 0) {
+ return new LinkedHashSet<String>(Arrays.asList(areasString.split(
+ "(\\s*,\\s*)|(\\s+)")));
} else {
Set<String> areasSet = new LinkedHashSet<String>(5);
- areasSet.add(areasString.trim());
+ areasSet.add(areasString);
return areasSet;
}
15 years, 4 months
JBoss Rich Faces SVN: r15292 - root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-08-25 05:28:07 -0400 (Tue, 25 Aug 2009)
New Revision: 15292
Modified:
root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java
Log:
Fixed behavior scripts generation
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java 2009-08-25 01:02:04 UTC (rev 15291)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java 2009-08-25 09:28:07 UTC (rev 15292)
@@ -1097,13 +1097,13 @@
}
ClientBehaviorContext behaviorContext = null;
- if (behaviors != null) {
+ if (behaviors != null || needsSubmittingBehavior) {
Collection<Parameter> parametersList = AjaxRendererUtils.getBehaviorParametersList(facesContext, component);
behaviorContext = ClientBehaviorContext.createClientBehaviorContext(facesContext, component,
behaviorName, null, parametersList);
}
- if (isNonEmpty(eventHandler) || behaviors != null) {
+ if (isNonEmpty(eventHandler) || behaviors != null || needsSubmittingBehavior) {
return AjaxRendererUtils.createBehaviorsChain(facesContext, eventHandler, behaviors, behaviorContext, needsSubmittingBehavior);
} else {
return null;
15 years, 4 months
JBoss Rich Faces SVN: r15291 - in root: examples/trunk/components/core-demo/src/main/webapp and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-08-24 21:02:04 -0400 (Mon, 24 Aug 2009)
New Revision: 15291
Added:
root/examples/trunk/components/core-demo/src/main/java/org/richfaces/demo/OutputPanelBean.java
Modified:
root/examples/trunk/components/core-demo/src/main/webapp/outputPanel.xhtml
root/examples/trunk/components/core-demo/src/main/webapp/push.xhtml
root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java
root/ui/trunk/components/core/src/main/java/org/richfaces/component/html/HtmlOutputPanel.java
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/AjaxCommandRendererBase.java
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/AjaxOutputPanelRenderer.java
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/AjaxPushRenderer.java
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/MediaOutputRenderer.java
Log:
Added behaviors support for a4j:outputPanel
Added: root/examples/trunk/components/core-demo/src/main/java/org/richfaces/demo/OutputPanelBean.java
===================================================================
--- root/examples/trunk/components/core-demo/src/main/java/org/richfaces/demo/OutputPanelBean.java (rev 0)
+++ root/examples/trunk/components/core-demo/src/main/java/org/richfaces/demo/OutputPanelBean.java 2009-08-25 01:02:04 UTC (rev 15291)
@@ -0,0 +1,40 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.demo;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.RequestScoped;
+import javax.faces.event.AjaxBehaviorEvent;
+
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+@ManagedBean(name = "outputPanelBean")
+@RequestScoped
+public class OutputPanelBean {
+
+ public void behaviorListener(AjaxBehaviorEvent event) {
+ System.out.println("OutputPanelBean.behaviorListener() " + event);
+ }
+}
Modified: root/examples/trunk/components/core-demo/src/main/webapp/outputPanel.xhtml
===================================================================
--- root/examples/trunk/components/core-demo/src/main/webapp/outputPanel.xhtml 2009-08-24 18:52:20 UTC (rev 15290)
+++ root/examples/trunk/components/core-demo/src/main/webapp/outputPanel.xhtml 2009-08-25 01:02:04 UTC (rev 15291)
@@ -9,9 +9,13 @@
<h:head>
</h:head>
<h:body>
- <a4j:outputPanel layout="block">
- Output panel
- </a4j:outputPanel>
+ <a4j:status startText="start..." /><br />
+ <h:form>
+ <a4j:outputPanel layout="block" onclick="alert('clicked')">
+ <f:ajax event="mouseover" listener="#{outputPanelBean.behaviorListener}" />
+ Output panel
+ </a4j:outputPanel>
+ </h:form>
</h:body>
</f:view>
</html>
\ No newline at end of file
Modified: root/examples/trunk/components/core-demo/src/main/webapp/push.xhtml
===================================================================
--- root/examples/trunk/components/core-demo/src/main/webapp/push.xhtml 2009-08-24 18:52:20 UTC (rev 15290)
+++ root/examples/trunk/components/core-demo/src/main/webapp/push.xhtml 2009-08-25 01:02:04 UTC (rev 15291)
@@ -21,7 +21,7 @@
</a4j:push>
<h:commandLink value="Generate push event" action="#{pushBean.generateEvent}">
- <f:ajax render="#{'@this'}" />
+ <f:ajax render="@none" />
</h:commandLink>
</h:form>
</h:body>
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java 2009-08-24 18:52:20 UTC (rev 15290)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java 2009-08-25 01:02:04 UTC (rev 15291)
@@ -1081,41 +1081,63 @@
private static final boolean isNonEmpty(String s) {
return s!= null && s.length() != 0;
}
+
+ public static String createBehaviorsChain(FacesContext facesContext, UIComponent component, String eventHandlerAttribute,
+ String behaviorName, boolean needsSubmittingBehavior) {
- public static String createBehaviorsChain(FacesContext facesContext, UIComponent component, String attributeName) {
+ List<ClientBehavior> behaviors = null;
+
+ String eventHandler = (String) component.getAttributes().get(eventHandlerAttribute);
+ if (component instanceof ClientBehaviorHolder) {
+ ClientBehaviorHolder clientBehaviorHolder = (ClientBehaviorHolder) component;
+ Map<String, List<ClientBehavior>> clientBehaviorsMap = clientBehaviorHolder.getClientBehaviors();
+ if (clientBehaviorsMap != null) {
+ behaviors = clientBehaviorsMap.get(behaviorName);
+ }
+ }
+
+ ClientBehaviorContext behaviorContext = null;
+ if (behaviors != null) {
+ Collection<Parameter> parametersList = AjaxRendererUtils.getBehaviorParametersList(facesContext, component);
+ behaviorContext = ClientBehaviorContext.createClientBehaviorContext(facesContext, component,
+ behaviorName, null, parametersList);
+ }
+
+ if (isNonEmpty(eventHandler) || behaviors != null) {
+ return AjaxRendererUtils.createBehaviorsChain(facesContext, eventHandler, behaviors, behaviorContext, needsSubmittingBehavior);
+ } else {
+ return null;
+ }
+ }
+
+ public static String createBehaviorsChain(FacesContext facesContext, String eventHandlerValue, List<ClientBehavior> behaviors,
+ ClientBehaviorContext behaviorContext, boolean needsSubmittingBehavior) {
+
String result = null;
+ //TODO: performance optimizization
List<String> handlers = new ArrayList<String>(2);
- String eventHandler = (String) component.getAttributes().get(attributeName);
- if (isNonEmpty(eventHandler)) {
- handlers.add(eventHandler);
+ if (isNonEmpty(eventHandlerValue)) {
+ handlers.add(eventHandlerValue);
}
boolean hasSubmittingBehavior = false;
Map<String, Object> parametersMap = new LinkedHashMap<String, Object>();
- AjaxRendererUtils.appendParameters(facesContext, component, parametersMap);
- if (component instanceof ClientBehaviorHolder) {
- ClientBehaviorHolder clientBehaviorHolder = (ClientBehaviorHolder) component;
- List<ClientBehavior> behaviors = clientBehaviorHolder.getClientBehaviors().get(attributeName);
- if (behaviors != null) {
- ClientBehaviorContext behaviorContext = ClientBehaviorContext.createClientBehaviorContext(facesContext,
- component, attributeName, null, adaptParametersMap(parametersMap));
-
- for (ClientBehavior clientBehavior : behaviors) {
- String behaviorScript = clientBehavior.getScript(behaviorContext);
- if (isNonEmpty(behaviorScript)) {
- if (clientBehavior.getHints().contains(ClientBehaviorHint.SUBMITTING)) {
- hasSubmittingBehavior = true;
- }
-
- handlers.add(behaviorScript);
+ if (behaviors != null) {
+ for (ClientBehavior clientBehavior : behaviors) {
+ String behaviorScript = clientBehavior.getScript(behaviorContext);
+ if (isNonEmpty(behaviorScript)) {
+ if (clientBehavior.getHints().contains(ClientBehaviorHint.SUBMITTING)) {
+ hasSubmittingBehavior = true;
}
+
+ handlers.add(behaviorScript);
}
}
}
- if (!hasSubmittingBehavior) {
+ if (!hasSubmittingBehavior && needsSubmittingBehavior) {
JSFunction jsFunction = new JSFunction(AJAX_FUNCTION_NAME, JSReference.THIS, JSReference.EVENT);
if (parametersMap != null && !parametersMap.isEmpty()) {
jsFunction.addParameter(parametersMap);
@@ -1138,7 +1160,11 @@
return result;
}
- private static Collection<ClientBehaviorContext.Parameter> adaptParametersMap(Map<String, Object> parametersMap) {
+ public static Collection<ClientBehaviorContext.Parameter> getBehaviorParametersList(FacesContext context, UIComponent component) {
+ Map<String, Object> parametersMap = new LinkedHashMap<String, Object>();
+ //TODO: merge to a single method
+ appendParameters(context, component, parametersMap);
+
List<Parameter> result = new ArrayList<ClientBehaviorContext.Parameter>(parametersMap.size());
for (Map.Entry<String, Object> entry : parametersMap.entrySet()) {
result.add(new ClientBehaviorContext.Parameter(entry.getKey(), entry.getValue()));
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java 2009-08-24 18:52:20 UTC (rev 15290)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java 2009-08-25 01:02:04 UTC (rev 15291)
@@ -29,6 +29,7 @@
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashSet;
+import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -40,6 +41,10 @@
import javax.faces.component.UIForm;
import javax.faces.component.UIViewRoot;
import javax.faces.component.ValueHolder;
+import javax.faces.component.behavior.ClientBehavior;
+import javax.faces.component.behavior.ClientBehaviorContext;
+import javax.faces.component.behavior.ClientBehaviorHolder;
+import javax.faces.component.behavior.ClientBehaviorContext.Parameter;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.faces.convert.Converter;
@@ -74,6 +79,7 @@
substitutions.put(HTML.class_ATTRIBUTE, "styleClass");
requiredAttributes.add(HTML.alt_ATTRIBUTE);
Arrays.sort(HTML.PASS_THRU);
+ Arrays.sort(HTML.PASS_THRU_EVENTS);
Arrays.sort(HTML.PASS_THRU_BOOLEAN);
Arrays.sort(HTML.PASS_THRU_URI);
}
@@ -210,30 +216,33 @@
// public static final String onreset_ATTRIBUTE = "onreset";
// attributes sets.
public static final String[] PASS_THRU = {
- // DIR_ATTRIBUTE,
- // LANG_ATTRIBUTE,
- // STYLE_ATTRIBUTE,
- // TITLE_ATTRIBUTE
- "accesskey", "alt", "cols", "height", "lang", "longdesc",
- "maxlength", "onblur", "onchange", "onclick", "ondblclick",
- "onfocus", "onkeydown", "onkeypress", "onkeyup", "onload",
- "onmousedown", "onmousemove", "onmouseout", "onmouseover",
- "onmouseup", "onreset", "onselect", "onsubmit", "onunload",
- "rows", "size", "tabindex", "title", "width", "dir", "rules",
- "frame", "border", "cellspacing", "cellpadding", "summary",
- "bgcolor", "usemap", "enctype", "accept-charset", "accept",
- "target", "charset", "coords", "hreflang", "rel", "rev",
- "shape", "disabled", "readonly", "ismap", "align"
+ // DIR_ATTRIBUTE,
+ // LANG_ATTRIBUTE,
+ // STYLE_ATTRIBUTE,
+ // TITLE_ATTRIBUTE
+ "accesskey", "alt", "cols", "height", "lang", "longdesc",
+ "maxlength", "rows", "size", "tabindex", "title", "width",
+ "dir", "rules", "frame", "border", "cellspacing", "cellpadding",
+ "summary", "bgcolor", "usemap", "enctype", "accept-charset",
+ "accept", "target", "charset", "coords", "hreflang", "rel",
+ "rev", "shape", "disabled", "readonly", "ismap", "align"
+ };
+ public static final String[] PASS_THRU_EVENTS = {
+ "onblur", "onchange", "onclick", "ondblclick",
+ "onfocus", "onkeydown", "onkeypress", "onkeyup", "onload",
+ "onmousedown", "onmousemove", "onmouseout", "onmouseover",
+ "onmouseup", "onreset", "onselect", "onsubmit", "onunload"
};
-
+
/**
* HTML attributes allowed boolean-values only
*/
public static final String[] PASS_THRU_BOOLEAN = { "disabled",
- "declare", "readonly", "compact", "ismap", "selected",
- "checked", "nowrap", "noresize", "nohref", "noshade",
- "multiple" };
+ "declare", "readonly", "compact", "ismap", "selected",
+ "checked", "nowrap", "noresize", "nohref", "noshade",
+ "multiple"
+ };
/**
* all HTML attributes with URI value.
@@ -338,6 +347,53 @@
}
}
+ public void encodeBehaviors(FacesContext context, ClientBehaviorHolder behaviorHolder,
+ String defaultHtmlEventName, String[] attributesExclusions) throws IOException {
+
+ if (attributesExclusions != null && attributesExclusions.length != 0) {
+ assert false : "Not supported yet";
+ }
+
+ //TODO: disabled component check
+ String defaultEventName = behaviorHolder.getDefaultEventName();
+ Collection<String> eventNames = behaviorHolder.getEventNames();
+ if (eventNames != null) {
+ UIComponent component = (UIComponent) behaviorHolder;
+ ResponseWriter writer = context.getResponseWriter();
+ Map<String, List<ClientBehavior>> clientBehaviors = behaviorHolder.getClientBehaviors();
+ Collection<Parameter> behaviorParametersList = AjaxRendererUtils.getBehaviorParametersList(context, component);
+
+ for (String behaviorEventName : eventNames) {
+ if (behaviorEventName.equals(defaultEventName)) {
+ continue;
+ }
+
+ String htmlEventName = "on" + behaviorEventName;
+ List<ClientBehavior> behaviorsList = clientBehaviors.get(behaviorEventName);
+ if (behaviorsList == null && behaviorEventName.equals(defaultHtmlEventName) &&
+ defaultEventName != null) {
+
+ behaviorEventName = defaultEventName;
+ behaviorsList = clientBehaviors.get(behaviorEventName);
+ }
+
+ ClientBehaviorContext clientBehaviorContext = null;
+ if (behaviorsList != null) {
+ clientBehaviorContext = ClientBehaviorContext.createClientBehaviorContext(context, component, behaviorEventName,
+ null, behaviorParametersList);
+ }
+
+ String eventHandlerValue = (String) component.getAttributes().get(htmlEventName);
+ if (!isEmpty(eventHandlerValue) || behaviorsList != null) {
+ String behaviorsChain = AjaxRendererUtils.createBehaviorsChain(context, eventHandlerValue,
+ behaviorsList, clientBehaviorContext, false);
+
+ writer.writeAttribute(htmlEventName, behaviorsChain, htmlEventName);
+ }
+ }
+ }
+ }
+
/**
* Encode common pass-thru html attributes.
*
@@ -345,9 +401,15 @@
* @param component
* @throws IOException
*/
- public void encodePassThru(FacesContext context, UIComponent component)
+ public void encodePassThru(FacesContext context, UIComponent component, String defaultHtmlEvent)
throws IOException {
encodeAttributesFromArray(context, component, HTML.PASS_THRU);
+ if (component instanceof ClientBehaviorHolder) {
+ ClientBehaviorHolder clientBehaviorHolder = (ClientBehaviorHolder) component;
+ encodeBehaviors(context, clientBehaviorHolder, defaultHtmlEvent, null);
+ } else {
+ encodeAttributesFromArray(context, component, HTML.PASS_THRU_EVENTS);
+ }
}
/**
@@ -359,16 +421,16 @@
* @throws IOException
*/
public void encodePassThruWithExclusions(FacesContext context,
- UIComponent component, String exclusions) throws IOException {
+ UIComponent component, String exclusions, String defaultHtmlEvent) throws IOException {
if (null != exclusions) {
String[] exclusionsArray = exclusions.split(",");
encodePassThruWithExclusionsArray(context, component,
- exclusionsArray);
+ exclusionsArray, defaultHtmlEvent);
}
}
public void encodePassThruWithExclusionsArray(FacesContext context,
- UIComponent component, Object[] exclusions) throws IOException {
+ UIComponent component, String[] exclusions, String defaultHtmlEvent) throws IOException {
ResponseWriter writer = context.getResponseWriter();
Map<String, Object> attributes = component.getAttributes();
Arrays.sort(exclusions);
@@ -378,6 +440,18 @@
encodePassThruAttribute(context, attributes, writer, attribute);
}
}
+
+ if (component instanceof ClientBehaviorHolder) {
+ ClientBehaviorHolder clientBehaviorHolder = (ClientBehaviorHolder) component;
+ encodeBehaviors(context, clientBehaviorHolder, defaultHtmlEvent, exclusions);
+ } else {
+ for (int i = 0; i < HTML.PASS_THRU_EVENTS.length; i++) {
+ String attribute = HTML.PASS_THRU_EVENTS[i];
+ if (Arrays.binarySearch(exclusions, attribute) < 0) {
+ encodePassThruAttribute(context, attributes, writer, attribute);
+ }
+ }
+ }
}
/**
Modified: root/ui/trunk/components/core/src/main/java/org/richfaces/component/html/HtmlOutputPanel.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/component/html/HtmlOutputPanel.java 2009-08-24 18:52:20 UTC (rev 15290)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/component/html/HtmlOutputPanel.java 2009-08-25 01:02:04 UTC (rev 15291)
@@ -1,8 +1,15 @@
package org.richfaces.component.html;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.LinkedHashSet;
+
+import javax.faces.component.behavior.ClientBehaviorHolder;
+
import org.richfaces.component.UIAjaxOutputPanel;
-public class HtmlOutputPanel extends UIAjaxOutputPanel {
+public class HtmlOutputPanel extends UIAjaxOutputPanel implements ClientBehaviorHolder {
static final public String COMPONENT_FAMILY = "javax.faces.Panel";
@@ -13,6 +20,12 @@
onkeyup, onmousedown, title, style, onmouseout, onmouseover, onmouseup, styleClass
}
+ private static final Collection<String> EVENT_NAMES = Collections.unmodifiableCollection(
+ new LinkedHashSet<String>(
+ Arrays.asList("click", "mousemove", "dblclick", "keydown", "keypress",
+ "keyup", "mousedown", "mouseout", "mouseover", "mouseup"))
+ );
+
public HtmlOutputPanel() {
super();
setRendererType("org.richfaces.OutputPanelRenderer");
@@ -150,4 +163,8 @@
return COMPONENT_FAMILY;
}
+ @Override
+ public Collection<String> getEventNames() {
+ return EVENT_NAMES;
+ }
}
Modified: root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/AjaxCommandRendererBase.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/AjaxCommandRendererBase.java 2009-08-24 18:52:20 UTC (rev 15290)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/AjaxCommandRendererBase.java 2009-08-25 01:02:04 UTC (rev 15291)
@@ -74,7 +74,7 @@
public String getOnClick(FacesContext context, UIComponent component) {
StringBuffer onClick = new StringBuffer();
if (!getUtils().isBooleanAttribute(component, "disabled")) {
- onClick.append(AjaxRendererUtils.createBehaviorsChain(context, component, "onclick"));
+ onClick.append(AjaxRendererUtils.createBehaviorsChain(context, component, "onclick", "click" , true));
if (!"reset".equals(component.getAttributes().get("type"))) {
onClick.append(";return false;");
}
Modified: root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/AjaxOutputPanelRenderer.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/AjaxOutputPanelRenderer.java 2009-08-24 18:52:20 UTC (rev 15290)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/AjaxOutputPanelRenderer.java 2009-08-25 01:02:04 UTC (rev 15291)
@@ -105,7 +105,7 @@
if (!hasNoneLayout(component)) {
writer.startElement(getTag(panel), panel);
getUtils().encodeId(context, component);
- getUtils().encodePassThru(context, component);
+ getUtils().encodePassThru(context, component, null);
getUtils().encodeAttributesFromArray(context,component,STYLE_ATTRIBUTES);
}
}
Modified: root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/AjaxPushRenderer.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/AjaxPushRenderer.java 2009-08-24 18:52:20 UTC (rev 15290)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/AjaxPushRenderer.java 2009-08-25 01:02:04 UTC (rev 15291)
@@ -98,7 +98,9 @@
options.put("pushId", push.getListenerId(context));
options.put("clientId", component.getClientId(context));
- String behaviorsChain = AjaxRendererUtils.createBehaviorsChain(context, push, push.getDefaultEventName());
+ String behaviorsChain = AjaxRendererUtils.createBehaviorsChain(context, push, UIPush.ON_DATA_AVAILABLE,
+ UIPush.ON_DATA_AVAILABLE, true);
+
if (behaviorsChain != null) {
JSFunctionDefinition dataAvailableHandler = new JSFunctionDefinition(JSReference.EVENT);
dataAvailableHandler.addToBody(behaviorsChain);
Modified: root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/MediaOutputRenderer.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/MediaOutputRenderer.java 2009-08-24 18:52:20 UTC (rev 15290)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/MediaOutputRenderer.java 2009-08-25 01:02:04 UTC (rev 15291)
@@ -122,7 +122,7 @@
}
writer.writeURIAttribute(uriAttribute,uri,"uri");
getUtils().encodeAttributesFromArray(context,component,HTML.PASS_THRU_STYLES);
- getUtils().encodePassThru(context, mmedia);
+ getUtils().encodePassThru(context, mmedia, null);
}
}
15 years, 4 months
JBoss Rich Faces SVN: r15290 - root/ui/trunk/components/core/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2009-08-24 14:52:20 -0400 (Mon, 24 Aug 2009)
New Revision: 15290
Modified:
root/ui/trunk/components/core/src/main/java/org/richfaces/component/UIAjaxLog.java
Log:
small fix
Modified: root/ui/trunk/components/core/src/main/java/org/richfaces/component/UIAjaxLog.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/component/UIAjaxLog.java 2009-08-24 18:42:00 UTC (rev 15289)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/component/UIAjaxLog.java 2009-08-24 18:52:20 UTC (rev 15290)
@@ -44,8 +44,22 @@
return COMPONENT_FAMILY;
}
- public boolean isPopup() {
- //FIXME: common stuff goes here
- return false;
- }
+ // public abstract String getHotkey();
+//
+// public abstract void setHotkey(String newvalue);
+//
+// public abstract String getName();
+// public abstract void setName(String newvalue);
+//
+// public abstract String getWidth();
+// public abstract void setWidth(String newvalue);
+//
+// public abstract String getHeight();
+// public abstract void setHeight(String newvalue);
+//
+// public abstract String getLevel();
+// public abstract void setLevel(String newvalue);
+//
+// public abstract boolean isPopup();
+// public abstract void setPopup(boolean popup);
}
15 years, 4 months
JBoss Rich Faces SVN: r15289 - in root: examples/trunk/components/core-demo/src/main/webapp and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2009-08-24 14:42:00 -0400 (Mon, 24 Aug 2009)
New Revision: 15289
Modified:
root/examples/trunk/components/core-demo/src/main/java/org/richfaces/demo/CommandBean.java
root/examples/trunk/components/core-demo/src/main/webapp/button.xhtml
root/examples/trunk/components/core-demo/src/main/webapp/link.xhtml
root/ui/trunk/components/core/src/main/java/org/richfaces/component/html/HtmlCommandButton.java
root/ui/trunk/components/core/src/main/java/org/richfaces/component/html/HtmlCommandLink.java
Log:
attribute limitRender has been added
Modified: root/examples/trunk/components/core-demo/src/main/java/org/richfaces/demo/CommandBean.java
===================================================================
--- root/examples/trunk/components/core-demo/src/main/java/org/richfaces/demo/CommandBean.java 2009-08-24 18:40:44 UTC (rev 15288)
+++ root/examples/trunk/components/core-demo/src/main/java/org/richfaces/demo/CommandBean.java 2009-08-24 18:42:00 UTC (rev 15289)
@@ -1,4 +1,6 @@
package org.richfaces.demo;
+import java.util.Date;
+
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
@@ -24,4 +26,8 @@
public void reset() {
name = "";
}
+
+ public Date getDate() {
+ return new Date();
+ }
}
Modified: root/examples/trunk/components/core-demo/src/main/webapp/button.xhtml
===================================================================
--- root/examples/trunk/components/core-demo/src/main/webapp/button.xhtml 2009-08-24 18:40:44 UTC (rev 15288)
+++ root/examples/trunk/components/core-demo/src/main/webapp/button.xhtml 2009-08-24 18:42:00 UTC (rev 15289)
@@ -9,10 +9,14 @@
<h:head>
</h:head>
<h:body>
+ <a4j:outputPanel ajaxRendered="true">
+ <h:outputText value="#{commandBean.date}" />
+ </a4j:outputPanel>
<h:outputText value="Name:" />
<h:form>
<h:inputText value="#{commandBean.name}" />
<a4j:commandButton action="#{commandBean.submit}" render="out" value="Say Hello" />
+ <a4j:commandButton action="#{commandBean.submit}" render="out" value="Say Hello with limitRender" limitRender="true"/>
<a4j:commandButton action="#{commandBean.reset}" render="out" value="Reset" />
</h:form>
<br />
Modified: root/examples/trunk/components/core-demo/src/main/webapp/link.xhtml
===================================================================
--- root/examples/trunk/components/core-demo/src/main/webapp/link.xhtml 2009-08-24 18:40:44 UTC (rev 15288)
+++ root/examples/trunk/components/core-demo/src/main/webapp/link.xhtml 2009-08-24 18:42:00 UTC (rev 15289)
@@ -9,12 +9,18 @@
<h:head>
</h:head>
<h:body>
+ <a4j:outputPanel ajaxRendered="true">
+ <h:outputText value="#{commandBean.date}" />
+ </a4j:outputPanel>
<h:outputText value="Name:" />
<h:form>
<h:inputText value="#{commandBean.name}" />
<a4j:commandLink action="#{commandBean.submit}" render="out">
<h:outputText value="Say Hello" />
</a4j:commandLink>
+ <a4j:commandLink action="#{commandBean.submit}" render="out" limitRender="true">
+ <h:outputText value="Say Hello with limitRender" />
+ </a4j:commandLink>
<a4j:commandLink action="#{commandBean.reset}" render="out">
<h:outputText value="Reset" />
</a4j:commandLink>
Modified: root/ui/trunk/components/core/src/main/java/org/richfaces/component/html/HtmlCommandButton.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/component/html/HtmlCommandButton.java 2009-08-24 18:40:44 UTC (rev 15288)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/component/html/HtmlCommandButton.java 2009-08-24 18:42:00 UTC (rev 15289)
@@ -32,7 +32,35 @@
public final static String COMPONENT_TYPE = "org.richfaces.CommandButton";
+ private static enum PropertyKeys {
+ style, styleClass, limitRender
+ }
+
public HtmlCommandButton(){
setRendererType("org.richfaces.CommandButtonRenderer");
}
+
+ public String getStyle() {
+ return (String) getStateHelper().eval(PropertyKeys.style, "");
+ }
+
+ public void setStyle(String style) {
+ getStateHelper().put(PropertyKeys.style, style);
+ }
+
+ public String getStyleClass() {
+ return (String) getStateHelper().eval(PropertyKeys.styleClass, "");
+ }
+
+ public void setStyleClass(String styleClass) {
+ getStateHelper().put(PropertyKeys.styleClass, styleClass);
+ }
+
+ public boolean getLimitRender() {
+ return Boolean.valueOf(getStateHelper().eval(PropertyKeys.limitRender, Boolean.FALSE).toString());
+ }
+
+ public void setLimitRender(boolean limitRender) {
+ getStateHelper().put(PropertyKeys.limitRender, limitRender);
+ }
}
Modified: root/ui/trunk/components/core/src/main/java/org/richfaces/component/html/HtmlCommandLink.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/component/html/HtmlCommandLink.java 2009-08-24 18:40:44 UTC (rev 15288)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/component/html/HtmlCommandLink.java 2009-08-24 18:42:00 UTC (rev 15289)
@@ -34,7 +34,7 @@
public final static String COMPONENT_TYPE = "org.richfaces.CommandLink";
private static enum PropertyKeys {
- style, styleClass
+ style, styleClass, limitRender
}
public HtmlCommandLink() {
@@ -56,4 +56,12 @@
public void setStyleClass(String styleClass) {
getStateHelper().put(PropertyKeys.styleClass, styleClass);
}
+
+ public boolean getLimitRender() {
+ return Boolean.valueOf(getStateHelper().eval(PropertyKeys.limitRender, Boolean.FALSE).toString());
+ }
+
+ public void setLimitRender(boolean limitRender) {
+ getStateHelper().put(PropertyKeys.limitRender, limitRender);
+ }
}
15 years, 4 months
JBoss Rich Faces SVN: r15288 - in root: ui/trunk/components/core/src/main/java/org/richfaces/renderkit and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2009-08-24 14:40:44 -0400 (Mon, 24 Aug 2009)
New Revision: 15288
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/templates/BaseTemplateConsumer.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/templates/TemplateBodyConsumer.java
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/AjaxCommandRendererBase.java
root/ui/trunk/components/core/src/main/templates/org/ajax4jsf/renderkit/html/link.template.xml
Log:
NPE when call responseWriter.writeText has been fixed
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/templates/BaseTemplateConsumer.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/templates/BaseTemplateConsumer.java 2009-08-24 17:38:53 UTC (rev 15287)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/templates/BaseTemplateConsumer.java 2009-08-24 18:40:44 UTC (rev 15288)
@@ -280,7 +280,7 @@
}
protected MethodBodyStatement createWriteText(Characters characters) {
- return new MethodBodyStatement(MessageFormat.format("responseWriter.writeText({0}, component, null);",
+ return new MethodBodyStatement(MessageFormat.format("responseWriter.writeText(convertToString({0}), component, null);",
compileEl(characters.getData().trim())));
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/templates/TemplateBodyConsumer.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/templates/TemplateBodyConsumer.java 2009-08-24 17:38:53 UTC (rev 15287)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/templates/TemplateBodyConsumer.java 2009-08-24 18:40:44 UTC (rev 15288)
@@ -139,6 +139,13 @@
methodBody.addToBody(createGetComponentClassMethod(componentClassName));
getComponentClassMethod.setMethodBody(methodBody);
javaClass.addMethod(getComponentClassMethod);
+
+ JavaMethod convertToStringMethod = new JavaMethod("convertToString", String.class, new Argument("obj", Object.class));
+ convertToStringMethod.getModifiers().add(JavaModifier.PRIVATE);
+ MethodBody convertToStringBody = new MethodBody(convertToStringMethod);
+ convertToStringBody.addToBody(new MethodBodyStatement("return obj == null ? \"\" : obj.toString();"));
+ convertToStringMethod.setMethodBody(convertToStringBody);
+ javaClass.addMethod(convertToStringMethod);
}
}
Modified: root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/AjaxCommandRendererBase.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/AjaxCommandRendererBase.java 2009-08-24 17:38:53 UTC (rev 15287)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/AjaxCommandRendererBase.java 2009-08-24 18:40:44 UTC (rev 15288)
@@ -26,7 +26,6 @@
import javax.faces.application.ResourceDependencies;
import javax.faces.application.ResourceDependency;
import javax.faces.component.UIComponent;
-import javax.faces.component.ValueHolder;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
@@ -85,7 +84,7 @@
return onClick.toString();
}
- public String getStringValue(UIComponent component) {
+/* public String getStringValue(UIComponent component) {
Object value = getValue(component);
return convertToString(value);
}
@@ -105,11 +104,11 @@
protected String convertToString(long b ) {
return b!=Long.MIN_VALUE?String.valueOf(b):"";
}
-/*
+
public void encodeChildren(FacesContext context, UIComponent component)
throws IOException {
renderChildren(context, component);
- } */
+ }
public Object getValue(UIComponent component) {
if (component instanceof ValueHolder) {
@@ -118,7 +117,7 @@
return component.getAttributes().get("value");
}
- /*
+
public String getType(UIComponent uiComponent) {
String type;
if (uiComponent instanceof HtmlCommandButton) {
Modified: root/ui/trunk/components/core/src/main/templates/org/ajax4jsf/renderkit/html/link.template.xml
===================================================================
--- root/ui/trunk/components/core/src/main/templates/org/ajax4jsf/renderkit/html/link.template.xml 2009-08-24 17:38:53 UTC (rev 15287)
+++ root/ui/trunk/components/core/src/main/templates/org/ajax4jsf/renderkit/html/link.template.xml 2009-08-24 18:40:44 UTC (rev 15288)
@@ -15,7 +15,7 @@
href="#"
class="#{component.attributes['styleClass']}"
>
- #{this.getStringValue(component)}
+ #{component.attributes['value']}
<cdk:body>
<cdk:call expression="renderChildren(context,component);" />
</cdk:body>
15 years, 4 months
JBoss Rich Faces SVN: r15287 - tags/3.3.2.CR1/framework/impl/src/main/java/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2009-08-24 13:38:53 -0400 (Mon, 24 Aug 2009)
New Revision: 15287
Modified:
tags/3.3.2.CR1/framework/impl/src/main/java/org/richfaces/VersionBean.java
Log:
change SVN revision and date
Modified: tags/3.3.2.CR1/framework/impl/src/main/java/org/richfaces/VersionBean.java
===================================================================
--- tags/3.3.2.CR1/framework/impl/src/main/java/org/richfaces/VersionBean.java 2009-08-24 17:21:04 UTC (rev 15286)
+++ tags/3.3.2.CR1/framework/impl/src/main/java/org/richfaces/VersionBean.java 2009-08-24 17:38:53 UTC (rev 15287)
@@ -38,7 +38,7 @@
* Revision version, must be auto modified by CVS
*/
- public static final String REVISION = "2.CR1";
+ public static final String REVISION = "2.CR1";
public static final String SCM_REVISION = " SVN $Revision$ $Date$";//$Revision$ $Date$";
public static final Version _version = new Version();
15 years, 4 months
JBoss Rich Faces SVN: r15286 - in root: framework/trunk/api/src/main/java/org/ajax4jsf/component and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-08-24 13:21:04 -0400 (Mon, 24 Aug 2009)
New Revision: 15286
Modified:
root/examples/trunk/components/core-demo/src/main/webapp/function.xhtml
root/framework/trunk/api/src/main/java/org/ajax4jsf/component/AjaxComponent.java
root/framework/trunk/api/src/main/java/org/ajax4jsf/javascript/AjaxSubmitFunction.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java
root/framework/trunk/impl/src/main/java/org/richfaces/context/PartialViewContextImpl.java
root/ui/trunk/components/core/src/main/java/org/richfaces/component/html/HtmlAjaxFunction.java
Log:
Renamed "limitToList" into "limitRender"
Modified: root/examples/trunk/components/core-demo/src/main/webapp/function.xhtml
===================================================================
--- root/examples/trunk/components/core-demo/src/main/webapp/function.xhtml 2009-08-24 17:02:49 UTC (rev 15285)
+++ root/examples/trunk/components/core-demo/src/main/webapp/function.xhtml 2009-08-24 17:21:04 UTC (rev 15286)
@@ -19,13 +19,13 @@
<a4j:jsFunction action="#{requestBean.setupIdsToRender}" name="testFunction1" execute="@all" render="#{requestBean.idsToRender}">
<f:param name="idsToRender" value="time1" />
</a4j:jsFunction>
- <a4j:jsFunction action="#{requestBean.setupIdsToRender}" name="testFunction1Limited" execute="form" limitToList="true" render="#{requestBean.idsToRender}">
+ <a4j:jsFunction action="#{requestBean.setupIdsToRender}" name="testFunction1Limited" execute="form" limitRender="true" render="#{requestBean.idsToRender}">
<f:param name="idsToRender" value="time1" />
</a4j:jsFunction>
<a4j:jsFunction action="#{requestBean.setupIdsToRender}" name="testFunction2" execute="form" render="#{requestBean.idsToRender}">
<f:param name="idsToRender" value="time2" />
</a4j:jsFunction>
- <a4j:jsFunction action="#{requestBean.setupIdsToRender}" name="testFunction2Limited" execute="form" limitToList="true" render="#{requestBean.idsToRender}">
+ <a4j:jsFunction action="#{requestBean.setupIdsToRender}" name="testFunction2Limited" execute="form" limitRender="true" render="#{requestBean.idsToRender}">
<f:param name="idsToRender" value="time2" />
</a4j:jsFunction>
@@ -36,9 +36,10 @@
</h:form>
<a href="javascript:testFunction1()">Call test function1</a>
- <a href="javascript:testFunction1Limited()">Call test function1 with limitToList=true</a>
+ <a href="javascript:testFunction1Limited()">Call test function1 with limitRender=true</a>
<a href="javascript:testFunction2()">Call test function2</a>
- <a href="javascript:testFunction2Limited()">Call test function2 with limitToList=true</a>
+ <a href="javascript:testFunction2Limited()">Call test function2 with limitRender=true</a>
+ <a4j:log />
</h:body>
</f:view>
</html>
\ No newline at end of file
Modified: root/framework/trunk/api/src/main/java/org/ajax4jsf/component/AjaxComponent.java
===================================================================
--- root/framework/trunk/api/src/main/java/org/ajax4jsf/component/AjaxComponent.java 2009-08-24 17:02:49 UTC (rev 15285)
+++ root/framework/trunk/api/src/main/java/org/ajax4jsf/component/AjaxComponent.java 2009-08-24 17:21:04 UTC (rev 15286)
@@ -118,12 +118,12 @@
* setter method for property
* @param new value of Submit ( or not ) full form on Ajax action. to set
*/
- public abstract void setLimitToList(boolean submitForm);
+ public abstract void setLimitRender(boolean submitForm);
/**
* @return value or result of valueBinding of Submit ( or not ) full form on Ajax action.
*/
- public abstract boolean isLimitToList();
+ public abstract boolean isLimitRender();
/**
* setter method for property
Modified: root/framework/trunk/api/src/main/java/org/ajax4jsf/javascript/AjaxSubmitFunction.java
===================================================================
--- root/framework/trunk/api/src/main/java/org/ajax4jsf/javascript/AjaxSubmitFunction.java 2009-08-24 17:02:49 UTC (rev 15285)
+++ root/framework/trunk/api/src/main/java/org/ajax4jsf/javascript/AjaxSubmitFunction.java 2009-08-24 17:21:04 UTC (rev 15286)
@@ -51,7 +51,7 @@
/**
* Attribute to keep
*/
- public static final String LIMITTOLIST_ATTR_NAME = "limitToList";
+ public static final String LIMITRENDER_ATTR_NAME = "limitRender";
//private static Log log = LogFactory.getLog(AjaxSubmitFunction.class);
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java 2009-08-24 17:02:49 UTC (rev 15285)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java 2009-08-24 17:21:04 UTC (rev 15286)
@@ -103,7 +103,7 @@
/**
* Attribute to keep
*/
- public static final String LIMITTOLIST_ATTR_NAME = "limitRender";
+ public static final String LIMITRENDER_ATTR_NAME = "limitRender";
private static Log log = LogFactory.getLog(AjaxRendererUtils.class);
@@ -735,15 +735,15 @@
* @param component
* @return <code>true</code> if client must render ONLY given areas.
*/
- public static boolean isAjaxLimitToList(UIComponent component) {
+ public static boolean isAjaxLimitRender(UIComponent component) {
boolean result = false;
if (component instanceof AjaxComponent) {
- result = ((AjaxComponent) component).isLimitToList();
+ result = ((AjaxComponent) component).isLimitRender();
} else {
try {
result = ((Boolean) component.getAttributes().get(
- LIMITTOLIST_ATTR_NAME)).booleanValue();
+ LIMITRENDER_ATTR_NAME)).booleanValue();
} catch (NullPointerException e) {
// NullPointer - ignore ...
} catch (ClassCastException e1) {
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/context/PartialViewContextImpl.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/context/PartialViewContextImpl.java 2009-08-24 17:02:49 UTC (rev 15285)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/context/PartialViewContextImpl.java 2009-08-24 17:21:04 UTC (rev 15286)
@@ -225,10 +225,10 @@
super(behaviorEvent, false, false);
}
- private boolean limitToList = false;
+ private boolean limitRender = false;
- public boolean isLimitToList() {
- return limitToList;
+ public boolean isLimitRender() {
+ return limitRender;
}
@Override
@@ -236,9 +236,9 @@
AjaxClientBehavior behavior) {
super.doVisit(context, target, behavior);
- limitToList = AjaxRendererUtils.isAjaxLimitToList(target);
- if(behavior != null) {
- limitToList = behavior.isLimitRender();
+ limitRender = AjaxRendererUtils.isAjaxLimitRender(target);
+ if (behavior != null) {
+ limitRender = behavior.isLimitRender();
}
}
@@ -325,7 +325,7 @@
if (!renderCallback.isHandleNone()) {
renderIds.addAll(renderCallback.getComponentIds());
- if (!renderCallback.isLimitToList()) {
+ if (!renderCallback.isLimitRender()) {
Collection<String> ajaxOutputComponentIds = getAjaxOutputComponentIds(facesContext);
renderIds.addAll(ajaxOutputComponentIds);
//TODO ids from wrapped object?
Modified: root/ui/trunk/components/core/src/main/java/org/richfaces/component/html/HtmlAjaxFunction.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/component/html/HtmlAjaxFunction.java 2009-08-24 17:02:49 UTC (rev 15285)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/component/html/HtmlAjaxFunction.java 2009-08-24 17:21:04 UTC (rev 15286)
@@ -59,9 +59,9 @@
which ID's are passed to the "reRender" attribute of the describable component.
"false"-the default value-means that all components with ajaxRendered="true" will be updated.
*/
- private boolean _limitToList = false;
+ private boolean _limitRender = false;
- private boolean _limitToListSet = false;
+ private boolean _limitRenderSet = false;
/*
* Name of generated JavaScript function definition
@@ -281,11 +281,11 @@
this._ignoreDupResponsesSet = true;
}
- public boolean isLimitToList(){
- if (this._limitToListSet) {
- return (this._limitToList);
+ public boolean isLimitRender(){
+ if (this._limitRenderSet) {
+ return (this._limitRender);
}
- ValueExpression ve = getValueExpression("limitToList");
+ ValueExpression ve = getValueExpression("limitRender");
if (ve != null) {
Boolean value = null;
@@ -296,19 +296,19 @@
}
if (null == value) {
- return (this._limitToList);
+ return (this._limitRender);
}
return value;
} else {
- return (this._limitToList);
+ return (this._limitRender);
}
}
- public void setLimitToList(boolean _limitToList){
- this._limitToList = _limitToList;
- this._limitToListSet = true;
+ public void setLimitRender(boolean _limitRender){
+ this._limitRender = _limitRender;
+ this._limitRenderSet = true;
}
public String getName(){
@@ -570,8 +570,8 @@
state[7] = _focus;
state[8] = Boolean.valueOf(_ignoreDupResponses);
state[9] = Boolean.valueOf(_ignoreDupResponsesSet);
- state[10] = Boolean.valueOf(_limitToList);
- state[11] = Boolean.valueOf(_limitToListSet);
+ state[10] = Boolean.valueOf(_limitRender);
+ state[11] = Boolean.valueOf(_limitRenderSet);
state[12] = _name;
state[13] = _onbeforedomupdate;
state[14] = _oncomplete;
@@ -599,8 +599,8 @@
_focus = (String)states[7];;
_ignoreDupResponses = ((Boolean)states[8]).booleanValue();
_ignoreDupResponsesSet = ((Boolean)states[9]).booleanValue();
- _limitToList = ((Boolean)states[10]).booleanValue();
- _limitToListSet = ((Boolean)states[11]).booleanValue();
+ _limitRender = ((Boolean)states[10]).booleanValue();
+ _limitRenderSet = ((Boolean)states[11]).booleanValue();
_name = (String)states[12];;
_onbeforedomupdate = (String)states[13];;
_oncomplete = (String)states[14];;
15 years, 4 months