Author: Alex.Kolonitsky
Date: 2011-03-09 10:11:51 -0500 (Wed, 09 Mar 2011)
New Revision: 22111
Added:
branches/4.0.X/ui/core/ui/src/main/resources/META-INF/cdk/attributes/ajaxBehavior-prop.xml
Modified:
branches/4.0.X/ui/core/ui/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java
Log:
(refactoring) RF-9952 Taglib: ajax has no attributes
- reviewed by Anton Belevich
Modified:
branches/4.0.X/ui/core/ui/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java
===================================================================
---
branches/4.0.X/ui/core/ui/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java 2011-03-09
15:09:44 UTC (rev 22110)
+++
branches/4.0.X/ui/core/ui/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java 2011-03-09
15:11:51 UTC (rev 22111)
@@ -54,7 +54,8 @@
*
*/
-@JsfBehavior(id = "org.ajax4jsf.behavior.Ajax", tag = @Tag(name =
"ajax", handler = "org.richfaces.view.facelets.html.AjaxHandler", type
= TagType.Facelets))
+@JsfBehavior(id = "org.ajax4jsf.behavior.Ajax", tag = @Tag(name =
"ajax", handler = "org.richfaces.view.facelets.html.AjaxHandler", type
= TagType.Facelets),
+ attributes = {"ajaxBehavior-prop.xml"})
public class AjaxBehavior extends ClientBehavior implements AjaxClientBehavior {
public static final String BEHAVIOR_ID = "org.ajax4jsf.behavior.Ajax";
@@ -64,7 +65,7 @@
enum PropertyKeys {
data, execute, onbeforedomupdate, onbegin, oncomplete, onerror, queueId, render,
- status, disabled, limitRender, immediate, bypassUpdates, onbeforesubmit, event,
listener
+ status, disabled, limitRender, immediate, bypassUpdates, onbeforesubmit
}
private Set<String> execute;
@@ -90,8 +91,6 @@
setOnbeforedomupdate((String) value);
} else if (compare(PropertyKeys.onbegin, name)) {
setOnbegin((String) value);
- } else if (compare(PropertyKeys.event, name)) {
- setEvent((String) value);
} else if (compare(PropertyKeys.oncomplete, name)) {
setOncomplete((String) value);
} else if (compare(PropertyKeys.onerror, name)) {
@@ -103,9 +102,6 @@
} else if (compare(PropertyKeys.disabled, name)) {
value = expFactory.coerceToType(value, Boolean.class);
setDisabled((Boolean)value);
- } else if (compare(PropertyKeys.listener, name)) {
- value = expFactory.coerceToType(value, MethodExpression.class);
- setListener((MethodExpression) value);
} else if (compare(PropertyKeys.limitRender, name)) {
value = expFactory.coerceToType(value, Boolean.class);
setLimitRender((Boolean) value);
@@ -143,26 +139,8 @@
public void setData(Object data) {
getStateHelper().put(PropertyKeys.data, data);
}
-
- @Attribute
- public MethodExpression getListener() {
- return (MethodExpression) getStateHelper().eval(PropertyKeys.listener);
- }
- public void setListener(MethodExpression listener) {
- getStateHelper().put(PropertyKeys.listener, listener);
- }
-
@Attribute
- public String getEvent() {
- return (String) getStateHelper().eval(PropertyKeys.event);
- }
-
- public void setEvent(String event) {
- getStateHelper().put(PropertyKeys.event, event);
- }
-
- @Attribute
public Collection<String> getExecute() {
return getCollectionValue(PropertyKeys.execute, execute);
}
Added:
branches/4.0.X/ui/core/ui/src/main/resources/META-INF/cdk/attributes/ajaxBehavior-prop.xml
===================================================================
---
branches/4.0.X/ui/core/ui/src/main/resources/META-INF/cdk/attributes/ajaxBehavior-prop.xml
(rev 0)
+++
branches/4.0.X/ui/core/ui/src/main/resources/META-INF/cdk/attributes/ajaxBehavior-prop.xml 2011-03-09
15:11:51 UTC (rev 22111)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- JBoss, Home of Professional Open Source Copyright ${year}, Red Hat,
+ Inc. and individual contributors by the @authors tag. See the copyright.txt
+ in the distribution for a full listing of individual contributors. This is
+ free software; you can redistribute it and/or modify it under the terms of
+ the GNU Lesser General Public License as published by the Free Software Foundation;
+ either version 2.1 of the License, or (at your option) any later version.
+ This software 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 software; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the
+ FSF site:
http://www.fsf.org. -->
+<cdk:properties
xmlns:xi="http://www.w3.org/2001/XInclude"
+
xmlns:cdk="http://jboss.org/schema/richfaces/cdk/extensions"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee">
+ <property>
+ <property-name>listener</property-name>
+ <property-class>javax.el.MethodExpression</property-class>
+ </property>
+ <property>
+ <property-name>event</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+</cdk:properties>