Author: konstantin.mishin
Date: 2009-08-27 12:39:02 -0400 (Thu, 27 Aug 2009)
New Revision: 15355
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/templates/BaseTemplateConsumer.java
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/examples/trunk/components/core-demo/src/main/webapp/mediaOutput.xhtml
root/examples/trunk/components/core-demo/src/main/webapp/status.xhtml
root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/HandlersChain.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/HtmlAjaxStatus.java
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
root/ui/trunk/components/core/src/main/java/org/richfaces/component/html/HtmlMediaOutput.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/AjaxCommandButtonRendererBase.java
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/AjaxStatusRenderer.java
root/ui/trunk/components/core/src/main/templates/org/ajax4jsf/renderkit/html/button.template.xml
root/ui/trunk/components/core/src/main/templates/org/ajax4jsf/renderkit/html/log.template.xml
Log:
RF-7758
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-27
16:15:31 UTC (rev 15354)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/templates/BaseTemplateConsumer.java 2009-08-27
16:39:02 UTC (rev 15355)
@@ -218,8 +218,6 @@
elementName)));
Map<String, String> attributes = new LinkedHashMap<String, String>();
- boolean usePassThrough = false;
- Set<String> passThroughSkip = new HashSet<String>();
Iterator<Attribute> attributesItr = startElement.getAttributes();
while (attributesItr.hasNext()) {
@@ -231,12 +229,9 @@
attributes.put(attributeName.getLocalPart(), value);
} else if (isCdkNamespace(attributeName)) {
if ("passThroughWithExclusions".equals(attributeName.getLocalPart())) {
- usePassThrough = true;
if (!"#none".equals(value)) {
- String[] split = value.split(",");
- for (String s : split) {
- passThroughSkip.add(s.trim());
- }
+ rootStatement.addToBody(new MethodBodyStatement(MessageFormat
+ .format("getUtils().encodePassThruWithExclusions(context, component,
\"{0}\", null);", value)));
}
} else {
throw new IllegalArgumentException(attributeName.toString());
@@ -246,24 +241,6 @@
}
}
- if (usePassThrough) {
- Set<String> schemaAttributes = elementsAttributes.get(elementName);
- if (schemaAttributes != null) {
- for (String schemaAttribute : schemaAttributes) {
- if (passThroughSkip.contains(schemaAttribute)) {
- continue;
- }
-
- if (attributes.containsKey(schemaAttribute)) {
- continue;
- }
-
- attributes.put(schemaAttribute,
- MessageFormat.format("#'{'component.attributes[{0}]'}'",
schemaAttribute));
- }
- }
- }
-
for (Entry<String, String> attributeEntry : attributes.entrySet()) {
//TODO add check for default values
rootStatement.addToBody(new MethodBodyStatement(
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-27
16:15:31 UTC (rev 15354)
+++
root/examples/trunk/components/core-demo/src/main/java/org/richfaces/demo/CommandBean.java 2009-08-27
16:39:02 UTC (rev 15355)
@@ -3,6 +3,7 @@
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
+import javax.faces.event.AjaxBehaviorEvent;
@ManagedBean(name="commandBean")
@SessionScoped
@@ -30,4 +31,8 @@
public Date getDate() {
return new Date();
}
+
+ public void listener(AjaxBehaviorEvent event) {
+ System.out.println("CommandBean.listener()");
+ }
}
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-27
16:15:31 UTC (rev 15354)
+++ root/examples/trunk/components/core-demo/src/main/webapp/button.xhtml 2009-08-27
16:39:02 UTC (rev 15355)
@@ -18,6 +18,9 @@
<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" />
+ <a4j:commandButton value="Test AjaxBehavior">
+ <f:ajax event="action" listener="#{commandBean.listener}"
/>
+ </a4j:commandButton>
</h:form>
<br />
<h:panelGroup id="out">
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-27
16:15:31 UTC (rev 15354)
+++ root/examples/trunk/components/core-demo/src/main/webapp/link.xhtml 2009-08-27
16:39:02 UTC (rev 15355)
@@ -24,6 +24,10 @@
<a4j:commandLink action="#{commandBean.reset}"
render="out">
<h:outputText value="Reset" />
</a4j:commandLink>
+ <a4j:commandLink>
+ <f:ajax event="action" listener="#{commandBean.listener}"
/>
+ <h:outputText value="Test AjaxBehavior" />
+ </a4j:commandLink>
</h:form>
<br />
<h:panelGroup id="out">
Modified: root/examples/trunk/components/core-demo/src/main/webapp/mediaOutput.xhtml
===================================================================
--- root/examples/trunk/components/core-demo/src/main/webapp/mediaOutput.xhtml 2009-08-27
16:15:31 UTC (rev 15354)
+++ root/examples/trunk/components/core-demo/src/main/webapp/mediaOutput.xhtml 2009-08-27
16:39:02 UTC (rev 15355)
@@ -11,8 +11,12 @@
<h:body>
<a4j:mediaOutput createContent="#{mediaOutputBean.createContent}"
value="richfaces.jpg"
element="img" /><br />
- <a4j:mediaOutput createContent="#{mediaOutputBean.createContent}"
value="richfaces-twitter.jpg"
- element="img" /><br />
+ <h:form>
+ <a4j:mediaOutput createContent="#{mediaOutputBean.createContent}"
value="richfaces-twitter.jpg"
+ element="img" >
+ <f:ajax event="dblclick"
listener="#{commandBean.listener}" />
+ </a4j:mediaOutput><br />
+ </h:form>
</h:body>
</f:view>
</html>
\ No newline at end of file
Modified: root/examples/trunk/components/core-demo/src/main/webapp/status.xhtml
===================================================================
--- root/examples/trunk/components/core-demo/src/main/webapp/status.xhtml 2009-08-27
16:15:31 UTC (rev 15354)
+++ root/examples/trunk/components/core-demo/src/main/webapp/status.xhtml 2009-08-27
16:39:02 UTC (rev 15355)
@@ -30,6 +30,7 @@
<a4j:status startStyle="color: green">
<f:facet name="start">...start...</f:facet>
<f:facet name="stop">stop</f:facet>
+ <f:ajax event="error" listener="#{commandBean.listener}"
/>
</a4j:status>
<h:form>
Modified:
root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/HandlersChain.java
===================================================================
---
root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/HandlersChain.java 2009-08-27
16:15:31 UTC (rev 15354)
+++
root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/HandlersChain.java 2009-08-27
16:39:02 UTC (rev 15355)
@@ -54,10 +54,6 @@
private Collection<Parameter> parameters;
- private boolean skipSubmittingBehaviors = false;
-
- private boolean behaviorsHandled = false;
-
//TODO: review for optimization
private List<String> handlers = new ArrayList<String>(2);
@@ -75,9 +71,7 @@
this.parameters = parameters;
}
- private final List<ClientBehavior> getBehaviorsList(String behaviorName) {
- behaviorsHandled = true;
-
+ private final List<ClientBehavior> getBehaviorsList(String behaviorName) {
List<ClientBehavior> behaviors = null;
if (component instanceof ClientBehaviorHolder) {
ClientBehaviorHolder clientBehaviorHolder = (ClientBehaviorHolder) component;
@@ -115,23 +109,24 @@
addInlineHandlerAsValue(context, (String)
component.getAttributes().get(attributeName));
}
- public void addBehaviors(FacesContext context, String behaviorName) {
- List<ClientBehavior> behaviorsList = getBehaviorsList(behaviorName);
+ public void addBehaviors(FacesContext context, String evantName) {
+ addBehaviors(context, evantName, null);
+ }
+ public void addBehaviors(FacesContext context, String evantName, String
defaultEventName) {
+ String name = evantName;
+ List<ClientBehavior> behaviorsList = getBehaviorsList(evantName);
+ if (behaviorsList == null && defaultEventName != null) {
+ behaviorsList = getBehaviorsList(defaultEventName);
+ name = defaultEventName;
+ }
if (behaviorsList != null) {
ClientBehaviorContext behaviorContext =
ClientBehaviorContext.createClientBehaviorContext(
- context, component, behaviorName, null, getParameters(context));
+ context, component, name, null, getParameters(context));
for (ClientBehavior clientBehavior : behaviorsList) {
String behaviorScript = clientBehavior.getScript(behaviorContext);
if (isNotEmpty(behaviorScript)) {
if (clientBehavior.getHints().contains(ClientBehaviorHint.SUBMITTING)) {
- if (skipSubmittingBehaviors) {
-
- //TODO: discuss this - it is not ok to skip submitting behaviors completely
- log.info("Submitting behavior '" + behaviorScript + "' has
been skipped");
- continue;
- }
-
hasSubmittingBehavior = true;
}
@@ -166,14 +161,4 @@
return parameters;
}
-
- /**
- * @param ignoreSubmittingBehaviors the ignoreSubmittingBehaviors to set
- */
- public void setSkipSubmittingBehaviors() {
- assert (!behaviorsHandled) : "Some behaviors were already processed by this
chain!";
-
- this.skipSubmittingBehaviors = true;
- }
-
}
\ No newline at end of file
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-27
16:15:31 UTC (rev 15354)
+++
root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java 2009-08-27
16:39:02 UTC (rev 15355)
@@ -389,12 +389,12 @@
return parameters;
}
- public void encodeBehaviors(FacesContext context, ClientBehaviorHolder behaviorHolder,
+ private void encodeBehaviors(FacesContext context, ClientBehaviorHolder behaviorHolder,
String defaultHtmlEventName, String[] attributesExclusions) throws IOException {
- if (attributesExclusions != null && attributesExclusions.length != 0) {
- assert false : "Not supported yet";
- }
+// if (attributesExclusions != null && attributesExclusions.length != 0) {
+// assert false : "Not supported yet";
+// }
//TODO: disabled component check
String defaultEventName = behaviorHolder.getDefaultEventName();
@@ -411,13 +411,15 @@
}
String htmlEventName = "on" + behaviorEventName;
- HandlersChain handlersChain = new HandlersChain(component, parametersList);
- handlersChain.addInlineHandlerFromAttribute(context, htmlEventName);
- handlersChain.addBehaviors(context, behaviorEventName);
- String handlerScript = handlersChain.toScript();
-
- if (!isEmpty(handlerScript)) {
- writer.writeAttribute(htmlEventName, handlerScript, htmlEventName);
+ if(attributesExclusions == null || Arrays.binarySearch(attributesExclusions,
htmlEventName) < 0) {
+ HandlersChain handlersChain = new HandlersChain(component, parametersList);
+ handlersChain.addInlineHandlerFromAttribute(context, htmlEventName);
+ handlersChain.addBehaviors(context, behaviorEventName);
+ String handlerScript = handlersChain.toScript();
+
+ if (!isEmpty(handlerScript)) {
+ writer.writeAttribute(htmlEventName, handlerScript, htmlEventName);
+ }
}
}
}
Modified:
root/ui/trunk/components/core/src/main/java/org/richfaces/component/html/HtmlAjaxStatus.java
===================================================================
---
root/ui/trunk/components/core/src/main/java/org/richfaces/component/html/HtmlAjaxStatus.java 2009-08-27
16:15:31 UTC (rev 15354)
+++
root/ui/trunk/components/core/src/main/java/org/richfaces/component/html/HtmlAjaxStatus.java 2009-08-27
16:39:02 UTC (rev 15355)
@@ -21,18 +21,30 @@
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.UIAjaxStatus;
/**
* @author Nick Belaevski
*
*/
-public class HtmlAjaxStatus extends UIAjaxStatus {
+public class HtmlAjaxStatus extends UIAjaxStatus implements ClientBehaviorHolder {
public static final String COMPONENT_TYPE = "org.richfaces.Status";
public static final String COMPONENT_FAMILY = "org.richfaces.Status";
+ private static final Collection<String> EVENT_NAMES =
Collections.unmodifiableCollection(
+ new LinkedHashSet<String>(
+ Arrays.asList("start", "stop", "error",
"success"))
+ );
+
public HtmlAjaxStatus() {
setRendererType("org.richfaces.StatusRenderer");
}
@@ -41,4 +53,8 @@
return COMPONENT_FAMILY;
}
+ @Override
+ public Collection<String> getEventNames() {
+ return EVENT_NAMES;
+ }
}
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-27
16:15:31 UTC (rev 15354)
+++
root/ui/trunk/components/core/src/main/java/org/richfaces/component/html/HtmlCommandButton.java 2009-08-27
16:39:02 UTC (rev 15355)
@@ -21,14 +21,20 @@
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.UICommand;
+import javax.faces.component.behavior.ClientBehaviorHolder;
/**
* @author Konstantin Mishin
*
*/
-public class HtmlCommandButton extends UICommand {
+public class HtmlCommandButton extends UICommand implements ClientBehaviorHolder {
public final static String COMPONENT_TYPE = "org.richfaces.CommandButton";
@@ -36,6 +42,12 @@
style, styleClass, limitRender
}
+ private static final Collection<String> EVENT_NAMES =
Collections.unmodifiableCollection(
+ new LinkedHashSet<String>(
+ Arrays.asList("click", "mousemove", "dblclick",
"keydown", "keypress",
+ "keyup", "mousedown", "mouseout",
"mouseover", "mouseup", "action"))
+ );
+
public HtmlCommandButton(){
setRendererType("org.richfaces.CommandButtonRenderer");
}
@@ -63,4 +75,14 @@
public void setLimitRender(boolean limitRender) {
getStateHelper().put(PropertyKeys.limitRender, limitRender);
}
+
+ @Override
+ public Collection<String> getEventNames() {
+ return EVENT_NAMES;
+ }
+
+ @Override
+ public String getDefaultEventName() {
+ return "action";
+ }
}
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-27
16:15:31 UTC (rev 15354)
+++
root/ui/trunk/components/core/src/main/java/org/richfaces/component/html/HtmlCommandLink.java 2009-08-27
16:39:02 UTC (rev 15355)
@@ -21,7 +21,13 @@
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.UICommand;
+import javax.faces.component.behavior.ClientBehaviorHolder;
/**
* @author Konstantin Mishin
@@ -29,7 +35,7 @@
*/
-public class HtmlCommandLink extends UICommand {
+public class HtmlCommandLink extends UICommand implements ClientBehaviorHolder {
public final static String COMPONENT_TYPE = "org.richfaces.CommandLink";
@@ -37,6 +43,12 @@
style, styleClass, limitRender
}
+ private static final Collection<String> EVENT_NAMES =
Collections.unmodifiableCollection(
+ new LinkedHashSet<String>(
+ Arrays.asList("click", "mousemove", "dblclick",
"keydown", "keypress",
+ "keyup", "mousedown", "mouseout",
"mouseover", "mouseup", "action"))
+ );
+
public HtmlCommandLink() {
setRendererType("org.richfaces.CommandLinkRenderer");
}
@@ -64,4 +76,14 @@
public void setLimitRender(boolean limitRender) {
getStateHelper().put(PropertyKeys.limitRender, limitRender);
}
+
+ @Override
+ public Collection<String> getEventNames() {
+ return EVENT_NAMES;
+ }
+
+ @Override
+ public String getDefaultEventName() {
+ return "action";
+ }
}
Modified:
root/ui/trunk/components/core/src/main/java/org/richfaces/component/html/HtmlMediaOutput.java
===================================================================
---
root/ui/trunk/components/core/src/main/java/org/richfaces/component/html/HtmlMediaOutput.java 2009-08-27
16:15:31 UTC (rev 15354)
+++
root/ui/trunk/components/core/src/main/java/org/richfaces/component/html/HtmlMediaOutput.java 2009-08-27
16:39:02 UTC (rev 15355)
@@ -1,12 +1,17 @@
package org.richfaces.component.html;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
import java.util.Date;
+import java.util.LinkedHashSet;
import javax.el.MethodExpression;
+import javax.faces.component.behavior.ClientBehaviorHolder;
import org.richfaces.component.UIMediaOutput;
-public class HtmlMediaOutput extends UIMediaOutput {
+public class HtmlMediaOutput extends UIMediaOutput implements ClientBehaviorHolder {
static public final String COMPONENT_FAMILY = "org.richfaces.MediaOutput";
@@ -21,6 +26,12 @@
session, expires
}
+ 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 HtmlMediaOutput() {
setRendererType("org.richfaces.MediaOutputRenderer");
}
@@ -411,5 +422,9 @@
public String getFamily() {
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-27
16:15:31 UTC (rev 15354)
+++
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/AjaxCommandRendererBase.java 2009-08-27
16:39:02 UTC (rev 15355)
@@ -80,16 +80,16 @@
StringBuffer onClick = new StringBuffer();
if (!getUtils().isBooleanAttribute(component, "disabled")) {
HandlersChain handlersChain = new HandlersChain(component);
- handlersChain.setSkipSubmittingBehaviors();
handlersChain.addInlineHandlerFromAttribute(context, "onclick");
- handlersChain.addBehaviors(context, "click");
-
- JSFunction ajaxFunction = buildAjaxFunction(context, component, AJAX_FUNCTION_NAME);
- AjaxEventOptions eventOptions = buildEventOptions(context, component);
- if (!eventOptions.isEmpty()) {
- ajaxFunction.addParameter(eventOptions);
+ handlersChain.addBehaviors(context, "click", "action");
+ if(!handlersChain.hasSubmittingBehavior()) {
+ JSFunction ajaxFunction = buildAjaxFunction(context, component, AJAX_FUNCTION_NAME);
+ AjaxEventOptions eventOptions = buildEventOptions(context, component);
+ if (!eventOptions.isEmpty()) {
+ ajaxFunction.addParameter(eventOptions);
+ }
+ handlersChain.addInlineHandlerAsValue(context, ajaxFunction.toScript());
}
- handlersChain.addInlineHandlerAsValue(context, ajaxFunction.toScript());
String handlerScript = handlersChain.toScript();
if (handlerScript != null) {
Modified:
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/AjaxCommandButtonRendererBase.java
===================================================================
---
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/AjaxCommandButtonRendererBase.java 2009-08-27
16:15:31 UTC (rev 15354)
+++
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/AjaxCommandButtonRendererBase.java 2009-08-27
16:39:02 UTC (rev 15355)
@@ -52,7 +52,7 @@
if(null != type ){
writer.writeAttribute("type",type.toLowerCase(),"type");
} else {
- writer.writeAttribute("type","button","type");
+ writer.writeAttribute("type","submit","type");
}
}
}
Modified:
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/AjaxStatusRenderer.java
===================================================================
---
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/AjaxStatusRenderer.java 2009-08-27
16:15:31 UTC (rev 15354)
+++
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/AjaxStatusRenderer.java 2009-08-27
16:39:02 UTC (rev 15355)
@@ -33,6 +33,7 @@
import javax.faces.render.Renderer;
import org.ajax4jsf.javascript.JSFunction;
+import org.ajax4jsf.renderkit.HandlersChain;
import org.ajax4jsf.renderkit.RendererUtils;
import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.ajax4jsf.renderkit.RendererUtils.ScriptHashVariableWrapper;
@@ -53,8 +54,8 @@
private static final String STOP = "stop";
private static final String ERROR = "error";
- private static final String[] EVENT_ATTRIBUTES = {
- "onstart", "onstop", "onerror", "onsuccess"
+ private static final String[] EVENT_NAMES = {
+ "start", "stop", "error", "success"
};
private static enum StatusState {
@@ -198,9 +199,13 @@
Map<String, Object> options = new HashMap<String, Object>();
Map<String, Object> attributes = ajaxStatus.getAttributes();
- for (String eventAttribute : EVENT_ATTRIBUTES) {
+ for (String eventName : EVENT_NAMES) {
+ String eventAttribute = "on" + eventName;
+ HandlersChain handlersChain = new HandlersChain(component);
+ handlersChain.addInlineHandlerFromAttribute(context, eventAttribute);
+ handlersChain.addBehaviors(context, eventName);
rendererUtils.addToScriptHash(options, eventAttribute,
- (String) attributes.get(eventAttribute), null,
+ handlersChain.toScript(), null,
ScriptHashVariableWrapper.EVENT_HANDLER);
}
Modified:
root/ui/trunk/components/core/src/main/templates/org/ajax4jsf/renderkit/html/button.template.xml
===================================================================
---
root/ui/trunk/components/core/src/main/templates/org/ajax4jsf/renderkit/html/button.template.xml 2009-08-27
16:15:31 UTC (rev 15354)
+++
root/ui/trunk/components/core/src/main/templates/org/ajax4jsf/renderkit/html/button.template.xml 2009-08-27
16:39:02 UTC (rev 15355)
@@ -13,6 +13,7 @@
name="#{clientId}"
cdk:passThroughWithExclusions="name onclick type id class"
onclick="#{this.getOnClick(context,component)}"
+ value="#{component.attributes['value']}"
class="#{component.attributes['styleClass']}"
<cdk:call
expression="encodeTypeAndImage(context,component);" />
Modified:
root/ui/trunk/components/core/src/main/templates/org/ajax4jsf/renderkit/html/log.template.xml
===================================================================
---
root/ui/trunk/components/core/src/main/templates/org/ajax4jsf/renderkit/html/log.template.xml 2009-08-27
16:15:31 UTC (rev 15354)
+++
root/ui/trunk/components/core/src/main/templates/org/ajax4jsf/renderkit/html/log.template.xml 2009-08-27
16:39:02 UTC (rev 15355)
@@ -3,7 +3,7 @@
<cdk:root
xmlns="http://richfaces.org/xhtml-el"
xmlns:cdk="http://richfaces.org/cdk"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
class="org.richfaces.renderkit.html.AjaxLogRenderer"
- superclass="javax.faces.render.Renderer"
+ superclass="org.ajax4jsf.renderkit.RendererBase"
componentclass="org.richfaces.component.UIAjaxLog">
<!-- f:clientid var="clientId"/ >
@@ -30,7 +30,7 @@
</cdk:otherwise>
</cdk:choose-->
<div id="richfaces.log" class="rich-log
#{component.attributes['styleClass']}"
- cdk:passThroughWithExclusions="class">
+ cdk:passThroughWithExclusions="id class">
<script type="text/javascript">
RichFaces.log.setLevel("#{component.attributes['level']}");
</script>