You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2010/05/10 22:44:26 UTC
svn commit: r942895 - in /myfaces/core/trunk/impl/src:
main/java/org/apache/myfaces/view/facelets/
main/java/org/apache/myfaces/view/facelets/tag/composite/
test/java/org/apache/myfaces/view/facelets/
test/java/org/apache/myfaces/view/facelets/tag/comp...
Author: lu4242
Date: Mon May 10 20:44:25 2010
New Revision: 942895
URL: http://svn.apache.org/viewvc?rev=942895&view=rev
Log:
MYFACES-2702 Implement composite:clientBehavior
Added:
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/ClientBehaviorAttachedObjectTarget.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/ClientBehaviorAttachedObjectTargetImpl.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/ClientBehaviorHandler.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/ClientBehaviorRedirectBehaviorAttachedObjectHandlerWrapper.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/ClientBehaviorRedirectEventComponentWrapper.java
myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentClientBehaviorTestCase.java
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/javax.faces/
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/javax.faces/jsf.js
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testComposite/compositeClientBehavior.xhtml
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testComposite/compositeDoubleClientBehavior.xhtml
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testComposite/simpleClientBehavior.xhtml
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testComposite/simpleClientBehaviorDefault.xhtml
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testComposite/simpleClientBehaviorDefaultNoEvent.xhtml
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testCompositeClientBehavior.xhtml
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testCompositeDoubleClientBehavior.xhtml
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleClientBehavior.xhtml
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleClientBehaviorAjaxWrap.xhtml
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleClientBehaviorDefault.xhtml
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleClientBehaviorDefaultAjaxWrap.xhtml
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleClientBehaviorDefaultNoEvent.xhtml
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleClientBehaviorDefaultNoEventAjaxWrap.xhtml
Modified:
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/AttachedObjectTargetHandler.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeLibrary.java
myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/FaceletTestCase.java
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java?rev=942895&r1=942894&r2=942895&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java Mon May 10 20:44:25 2010
@@ -104,6 +104,9 @@ import org.apache.myfaces.view.facelets.
import org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory;
import org.apache.myfaces.view.facelets.impl.DefaultResourceResolver;
import org.apache.myfaces.view.facelets.tag.TagLibrary;
+import org.apache.myfaces.view.facelets.tag.composite.ClientBehaviorAttachedObjectTarget;
+import org.apache.myfaces.view.facelets.tag.composite.ClientBehaviorRedirectBehaviorAttachedObjectHandlerWrapper;
+import org.apache.myfaces.view.facelets.tag.composite.ClientBehaviorRedirectEventComponentWrapper;
import org.apache.myfaces.view.facelets.tag.composite.CompositeComponentResourceTagHandler;
import org.apache.myfaces.view.facelets.tag.composite.CompositeLibrary;
import org.apache.myfaces.view.facelets.tag.composite.CompositeResourceLibrary;
@@ -681,7 +684,17 @@ public class FaceletViewDeclarationLangu
// its tag handler is applied.
if (UIComponent.isCompositeComponent(component))
{
- CompositeComponentResourceTagHandler.addAttachedObjectHandler(component, currentHandler);
+ if (currentTarget instanceof ClientBehaviorAttachedObjectTarget)
+ {
+ CompositeComponentResourceTagHandler.addAttachedObjectHandler(component,
+ new ClientBehaviorRedirectBehaviorAttachedObjectHandlerWrapper(
+ (BehaviorHolderAttachedObjectHandler) currentHandler,
+ ((ClientBehaviorAttachedObjectTarget) currentTarget).getEvent()));
+ }
+ else
+ {
+ CompositeComponentResourceTagHandler.addAttachedObjectHandler(component, currentHandler);
+ }
List<AttachedObjectHandler> handlers = (List<AttachedObjectHandler>)
component.getAttributes().get(CompositeComponentResourceTagHandler.ATTACHED_OBJECT_HANDLERS_KEY);
@@ -690,7 +703,15 @@ public class FaceletViewDeclarationLangu
}
else
{
- currentHandler.applyAttachedObject(context, component);
+ if (currentHandler instanceof ClientBehaviorRedirectBehaviorAttachedObjectHandlerWrapper)
+ {
+ currentHandler.applyAttachedObject(context, new ClientBehaviorRedirectEventComponentWrapper(component,
+ ((ClientBehaviorRedirectBehaviorAttachedObjectHandlerWrapper) currentHandler).getWrappedEventName(), eventName));
+ }
+ else
+ {
+ currentHandler.applyAttachedObject(context, component);
+ }
}
}
}
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/AttachedObjectTargetHandler.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/AttachedObjectTargetHandler.java?rev=942895&r1=942894&r2=942895&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/AttachedObjectTargetHandler.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/AttachedObjectTargetHandler.java Mon May 10 20:44:25 2010
@@ -53,6 +53,8 @@ public abstract class AttachedObjectTarg
private static final Logger log = Logger.getLogger(AttachedObjectTargetHandler.class.getName());
/**
+ * Indicate the name of the attribute that the component should expose
+ * to page authors.
*
*/
@JSFFaceletAttribute(name="name",
Added: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/ClientBehaviorAttachedObjectTarget.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/ClientBehaviorAttachedObjectTarget.java?rev=942895&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/ClientBehaviorAttachedObjectTarget.java (added)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/ClientBehaviorAttachedObjectTarget.java Mon May 10 20:44:25 2010
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.view.facelets.tag.composite;
+
+import javax.faces.view.BehaviorHolderAttachedObjectTarget;
+
+/**
+ * @author Leonardo Uribe (latest modification by $Author: lu4242 $)
+ * @version $Revision: 808704 $ $Date: 2009-08-27 19:56:06 -0500 (jue, 27 ago 2009) $
+ */
+public interface ClientBehaviorAttachedObjectTarget extends BehaviorHolderAttachedObjectTarget
+{
+ public String getEvent();
+}
Added: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/ClientBehaviorAttachedObjectTargetImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/ClientBehaviorAttachedObjectTargetImpl.java?rev=942895&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/ClientBehaviorAttachedObjectTargetImpl.java (added)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/ClientBehaviorAttachedObjectTargetImpl.java Mon May 10 20:44:25 2010
@@ -0,0 +1,164 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.view.facelets.tag.composite;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import javax.el.ValueExpression;
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.component.behavior.ClientBehaviorHolder;
+import javax.faces.context.FacesContext;
+
+import org.apache.myfaces.shared_impl.util.StringUtils;
+
+/**
+ * @author Leonardo Uribe (latest modification by $Author: lu4242 $)
+ * @version $Revision: 808704 $ $Date: 2009-08-27 19:56:06 -0500 (jue, 27 ago 2009) $
+ */
+public class ClientBehaviorAttachedObjectTargetImpl
+ implements ClientBehaviorAttachedObjectTarget, Serializable
+{
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -4645087262404844925L;
+
+ protected ValueExpression _name;
+
+ protected ValueExpression _targets;
+
+ protected ValueExpression _event;
+
+ protected boolean _default;
+
+ public ClientBehaviorAttachedObjectTargetImpl()
+ {
+ }
+
+ public String getName()
+ {
+ if (_name != null)
+ {
+ return (String) _name.getValue(FacesContext.getCurrentInstance().getELContext());
+ }
+ return null;
+ }
+
+ public List<UIComponent> getTargets(UIComponent topLevelComponent)
+ {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ String [] targetsArray = getTargets(facesContext);
+
+ if (targetsArray.length > 0)
+ {
+ List<UIComponent> targetsList = new ArrayList<UIComponent>(targetsArray.length);
+ for (String target : targetsArray)
+ {
+ UIComponent innerComponent = topLevelComponent.findComponent(target);
+
+ if (innerComponent != null)
+ {
+ if (innerComponent instanceof ClientBehaviorHolder || UIComponent.isCompositeComponent(innerComponent))
+ {
+ targetsList.add(new ClientBehaviorRedirectEventComponentWrapper(innerComponent, getName(), getEvent()));
+ }
+ else
+ {
+ throw new FacesException("Component with clientId "+innerComponent.getClientId()+ "should be instance of ClientBehaviorHolder");
+ }
+ }
+ }
+ return targetsList;
+ }
+ else
+ {
+ // composite:actionSource/valueHolder/editableValueHolder
+ // "name" description says if targets is not set, name is
+ // the component id of the target component where
+ // it should be mapped to
+ String name = getName();
+ if (name != null)
+ {
+ UIComponent innerComponent = topLevelComponent.findComponent(getName());
+ if (innerComponent != null)
+ {
+ if (innerComponent instanceof ClientBehaviorHolder || UIComponent.isCompositeComponent(innerComponent))
+ {
+ List<UIComponent> targetsList = new ArrayList<UIComponent>(1);
+ targetsList.add(new ClientBehaviorRedirectEventComponentWrapper(innerComponent, getName(), getEvent()));
+ return targetsList;
+ }
+ else
+ {
+ throw new FacesException("Component with clientId "+innerComponent.getClientId()+ "should be instance of ClientBehaviorHolder");
+ }
+ }
+ }
+ return Collections.emptyList();
+ }
+ }
+
+ public String [] getTargets(FacesContext context)
+ {
+ if (_targets != null)
+ {
+ return StringUtils.splitShortString((String) _targets.getValue(context.getELContext()), ' ');
+ }
+ return org.apache.myfaces.shared_impl.util.ArrayUtils.EMPTY_STRING_ARRAY;
+ }
+
+ public void setName(ValueExpression name)
+ {
+ _name = name;
+ }
+
+ public void setTargets(ValueExpression ve)
+ {
+ _targets = ve;
+ }
+
+ public String getEvent()
+ {
+ if (_event != null)
+ {
+ return (String) _event.getValue(FacesContext.getCurrentInstance().getELContext());
+ }
+ return null;
+ }
+
+ public void setEvent(ValueExpression event)
+ {
+ this._event = event;
+ }
+
+ public boolean isDefaultEvent()
+ {
+ return _default;
+ }
+
+ public void setDefault(boolean default1)
+ {
+ _default = default1;
+ }
+}
Added: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/ClientBehaviorHandler.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/ClientBehaviorHandler.java?rev=942895&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/ClientBehaviorHandler.java (added)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/ClientBehaviorHandler.java Mon May 10 20:44:25 2010
@@ -0,0 +1,213 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.view.facelets.tag.composite;
+
+import java.beans.BeanDescriptor;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.faces.component.UIComponent;
+import javax.faces.view.AttachedObjectTarget;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.TagAttribute;
+import javax.faces.view.facelets.TagConfig;
+import javax.faces.view.facelets.TagHandler;
+
+import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFFaceletAttribute;
+import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFFaceletTag;
+
+/**
+ * @author Leonardo Uribe (latest modification by $Author: lu4242 $)
+ * @version $Revision: 808704 $ $Date: 2009-08-27 19:56:06 -0500 (jue, 27 ago 2009) $
+ */
+@JSFFaceletTag(name="composite:clientBehavior")
+public class ClientBehaviorHandler extends TagHandler implements InterfaceDescriptorCreator
+{
+
+ private static final Logger log = Logger.getLogger(ClientBehaviorHandler.class.getName());
+
+ /**
+ * This attribute is used as the target event
+ * name, so client behaviors pointing to "name"
+ * will be attached on the related components
+ * identified by "targets" attribute and on
+ * the event name this attribute holds. In other
+ * words, this is the "real" event name.
+ */
+ @JSFFaceletAttribute(name="event",
+ className="javax.el.ValueExpression",
+ deferredValueType="java.lang.String",
+ required=true)
+ protected final TagAttribute _event;
+
+ /**
+ * This attribute represents the source event name
+ * that is used when instances of the composite
+ * component are used. In other
+ * words, this is the "logical" event name.
+ *
+ */
+ @JSFFaceletAttribute(name="name",
+ className="javax.el.ValueExpression",
+ deferredValueType="java.lang.String",
+ required=true)
+ protected final TagAttribute _name;
+
+ /**
+ * Indicate this clientBehavior description is the one
+ * that has to be taken by default. There should be only
+ * one clientBehavior with this property set to true in
+ * a composite component interface description.
+ */
+ @JSFFaceletAttribute(name="default",
+ className="javax.el.ValueExpression",
+ deferredValueType="boolean")
+ protected final TagAttribute _default;
+
+ /**
+ * Contains a list of clientIds separated by spaces that
+ * identify the component(s) that will be used to attach
+ * client behaviors from the composite component.
+ *
+ */
+ @JSFFaceletAttribute(name="targets",
+ className="javax.el.ValueExpression",
+ deferredValueType="java.lang.String")
+ protected final TagAttribute _targets;
+
+ /**
+ * Check if the PropertyDescriptor instance created by this handler
+ * can be cacheable or not.
+ */
+ private boolean _cacheable;
+
+ private ClientBehaviorAttachedObjectTargetImpl _target;
+
+ public ClientBehaviorHandler(TagConfig config)
+ {
+ super(config);
+ _name = getRequiredAttribute("name");
+ _event = getAttribute("event");
+ _default = getAttribute("default");
+ _targets = getAttribute("targets");
+ if (_name.isLiteral() &&
+ (_event == null || _event.isLiteral()) &&
+ (_default == null || _default.isLiteral() ))
+ {
+ _cacheable = true;
+ }
+ else
+ {
+ _cacheable = false;
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public void apply(FaceletContext ctx, UIComponent parent)
+ throws IOException
+ {
+ CompositeComponentBeanInfo beanInfo =
+ (CompositeComponentBeanInfo) parent.getAttributes()
+ .get(UIComponent.BEANINFO_KEY);
+
+ if (beanInfo == null)
+ {
+ if (log.isLoggable(Level.SEVERE))
+ {
+ log.severe("Cannot found composite bean descriptor UIComponent.BEANINFO_KEY ");
+ }
+ return;
+ }
+
+ BeanDescriptor beanDescriptor = beanInfo.getBeanDescriptor();
+
+ //1. Obtain the list mentioned as "targetList" on ViewDeclarationLanguage.retargetAttachedObjects
+ List<AttachedObjectTarget> targetList = (List<AttachedObjectTarget>)
+ beanDescriptor.getValue(
+ AttachedObjectTarget.ATTACHED_OBJECT_TARGETS_KEY);
+
+ if (targetList == null)
+ {
+ //2. If not found create it and set
+ targetList = new ArrayList<AttachedObjectTarget>();
+ beanDescriptor.setValue(
+ AttachedObjectTarget.ATTACHED_OBJECT_TARGETS_KEY,
+ targetList);
+ }
+
+ //3. Create the instance of AttachedObjectTarget
+ if (isCacheable())
+ {
+ if (_target == null)
+ {
+ _target = createAttachedObjectTarget(ctx);
+ }
+ targetList.add(_target);
+ }
+ else
+ {
+ ClientBehaviorAttachedObjectTargetImpl target = createAttachedObjectTarget(ctx);
+ targetList.add(target);
+ }
+
+ this.nextHandler.apply(ctx, parent);
+ }
+
+ public boolean isCacheable()
+ {
+ return _cacheable;
+ }
+
+ public void setCacheable(boolean cacheable)
+ {
+ _cacheable = cacheable;
+ }
+
+ /**
+ * Create a new AttachedObjectTarget instance to be added on the
+ * target list.
+ *
+ * @return
+ */
+ protected ClientBehaviorAttachedObjectTargetImpl createAttachedObjectTarget(FaceletContext ctx)
+ {
+ ClientBehaviorAttachedObjectTargetImpl target = new ClientBehaviorAttachedObjectTargetImpl();
+
+ if (_event != null)
+ {
+ target.setEvent(_event.getValueExpression(ctx, String.class));
+ }
+ if (_name != null)
+ {
+ target.setName(_name.getValueExpression(ctx, String.class));
+ }
+ if (_default != null)
+ {
+ target.setDefault(_default.getBoolean(ctx));
+ }
+ if (_targets != null)
+ {
+ target.setTargets(_targets.getValueExpression(ctx, String.class));
+ }
+ return target;
+ }
+}
Added: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/ClientBehaviorRedirectBehaviorAttachedObjectHandlerWrapper.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/ClientBehaviorRedirectBehaviorAttachedObjectHandlerWrapper.java?rev=942895&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/ClientBehaviorRedirectBehaviorAttachedObjectHandlerWrapper.java (added)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/ClientBehaviorRedirectBehaviorAttachedObjectHandlerWrapper.java Mon May 10 20:44:25 2010
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.view.facelets.tag.composite;
+
+import javax.faces.FacesWrapper;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.view.BehaviorHolderAttachedObjectHandler;
+
+/**
+ * This wrapper is used in FaceletViewDeclarationLanguage.retargetAttachedObjects(FacesContext, UIComponent, List<AttachedObjectHandler>)
+ * to redirect the client behavior attached object when there is a chain of composite components.
+ *
+ * @author Leonardo Uribe (latest modification by $Author: lu4242 $)
+ * @version $Revision: 808704 $ $Date: 2009-08-27 19:56:06 -0500 (jue, 27 ago 2009) $
+ */
+public class ClientBehaviorRedirectBehaviorAttachedObjectHandlerWrapper implements BehaviorHolderAttachedObjectHandler, FacesWrapper<BehaviorHolderAttachedObjectHandler>
+{
+
+ private final BehaviorHolderAttachedObjectHandler _delegate;
+ private final String _eventName;
+
+ public ClientBehaviorRedirectBehaviorAttachedObjectHandlerWrapper(
+ BehaviorHolderAttachedObjectHandler delegate, String eventName)
+ {
+ super();
+ _delegate = delegate;
+ _eventName = eventName;
+ }
+
+ public void applyAttachedObject(FacesContext context, UIComponent parent)
+ {
+ _delegate.applyAttachedObject(context, parent);
+ }
+
+ public String getEventName()
+ {
+ return _eventName;
+ }
+
+ public String getWrappedEventName()
+ {
+ if (_delegate instanceof ClientBehaviorRedirectBehaviorAttachedObjectHandlerWrapper)
+ {
+ return ((ClientBehaviorRedirectBehaviorAttachedObjectHandlerWrapper) _delegate).getWrappedEventName();
+ }
+ else
+ {
+ return _delegate.getEventName();
+ }
+ }
+
+ public String getFor()
+ {
+ return _delegate.getFor();
+ }
+
+ public BehaviorHolderAttachedObjectHandler getWrapped()
+ {
+ return _delegate;
+ }
+}
Added: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/ClientBehaviorRedirectEventComponentWrapper.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/ClientBehaviorRedirectEventComponentWrapper.java?rev=942895&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/ClientBehaviorRedirectEventComponentWrapper.java (added)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/ClientBehaviorRedirectEventComponentWrapper.java Mon May 10 20:44:25 2010
@@ -0,0 +1,437 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.view.facelets.tag.composite;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.el.ValueExpression;
+import javax.faces.FacesException;
+import javax.faces.FacesWrapper;
+import javax.faces.component.ContextCallback;
+import javax.faces.component.UIComponent;
+import javax.faces.component.behavior.ClientBehavior;
+import javax.faces.component.behavior.ClientBehaviorHolder;
+import javax.faces.component.visit.VisitCallback;
+import javax.faces.component.visit.VisitContext;
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.ComponentSystemEvent;
+import javax.faces.event.ComponentSystemEventListener;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.FacesListener;
+import javax.faces.event.SystemEvent;
+import javax.faces.event.SystemEventListener;
+import javax.faces.render.Renderer;
+
+/**
+ * This class has two usages:
+ *
+ * 1. On ClientBehaviorAttachedObjectTargetImpl to redirect the incoming sourceEvent
+ * to the final targetEvent.
+ * 2. On FaceletsViewDeclarationLanguage.retargetAttachedObjects to redirect too, but
+ * this time is to allow chain events for nested composite components.
+ *
+ * This class also implements FacesWrapper interface, to make possible to retrieve the
+ * real component if necessary.
+ *
+ * @author Leonardo Uribe (latest modification by $Author: lu4242 $)
+ * @version $Revision: 808704 $ $Date: 2009-08-27 19:56:06 -0500 (jue, 27 ago 2009) $
+ */
+public class ClientBehaviorRedirectEventComponentWrapper extends UIComponent
+ implements FacesWrapper<UIComponent>, ClientBehaviorHolder
+{
+
+ private final UIComponent _delegate;
+ private final String _sourceEvent; //cc:clientBehavior "name"
+ private final String _targetEvent; //cc:clientBehavior "event"
+
+ public ClientBehaviorRedirectEventComponentWrapper(UIComponent delegate,
+ String sourceEvent, String targetEvent)
+ {
+ super();
+ _delegate = delegate;
+ _sourceEvent = sourceEvent;
+ _targetEvent = targetEvent;
+ }
+
+ public UIComponent getWrapped()
+ {
+ return _delegate;
+ }
+
+ public void addClientBehavior(String eventName, ClientBehavior behavior)
+ {
+ if (_sourceEvent.equals(eventName))
+ {
+ ((ClientBehaviorHolder)_delegate).addClientBehavior(_targetEvent == null ? ((ClientBehaviorHolder)_delegate).getDefaultEventName(): _targetEvent , behavior);
+ }
+ }
+
+ public Map<String, List<ClientBehavior>> getClientBehaviors()
+ {
+ Map<String, List<ClientBehavior>> clientBehaviors = new HashMap<String, List<ClientBehavior>>(1);
+ clientBehaviors.put(_sourceEvent, ((ClientBehaviorHolder)_delegate).getClientBehaviors().get(_targetEvent));
+ return Collections.unmodifiableMap(clientBehaviors);
+ }
+
+ public String getDefaultEventName()
+ {
+ if (_targetEvent == null )
+ {
+ // There is no targetEvent assigned, so we need to check if there is
+ // a default event name on the delegate, if so return sourceEvent, otherwise
+ // there is no default event and we can't resolve the redirection, so
+ // return null. Note this usually could cause another exception later
+ // (see AjaxHandler code
+ if (((ClientBehaviorHolder)_delegate).getDefaultEventName() != null)
+ {
+ return _sourceEvent;
+ }
+ else
+ {
+ return null;
+ }
+ }
+ else
+ {
+ // We have a target event, so in this case we have to return the sourceEvent,
+ // because it is expected the client behavior to be attached has this event name.
+ return _sourceEvent;
+ }
+ }
+
+ public Collection<String> getEventNames()
+ {
+ return Collections.singletonList(_sourceEvent);
+ }
+
+ // UIComponent wrapping. Just delegate.
+ public void broadcast(FacesEvent event) throws AbortProcessingException
+ {
+ _delegate.broadcast(event);
+ }
+
+ public void clearInitialState()
+ {
+ _delegate.clearInitialState();
+ }
+
+ public void decode(FacesContext context)
+ {
+ _delegate.decode(context);
+ }
+
+ public void encodeAll(FacesContext context) throws IOException
+ {
+ _delegate.encodeAll(context);
+ }
+
+ public void encodeBegin(FacesContext context) throws IOException
+ {
+ _delegate.encodeBegin(context);
+ }
+
+ public void encodeChildren(FacesContext context) throws IOException
+ {
+ _delegate.encodeChildren(context);
+ }
+
+ public void encodeEnd(FacesContext context) throws IOException
+ {
+ _delegate.encodeEnd(context);
+ }
+
+ public UIComponent findComponent(String expr)
+ {
+ return _delegate.findComponent(expr);
+ }
+
+ public Map<String, Object> getAttributes()
+ {
+ return _delegate.getAttributes();
+ }
+
+ public int getChildCount()
+ {
+ return _delegate.getChildCount();
+ }
+
+ public List<UIComponent> getChildren()
+ {
+ return _delegate.getChildren();
+ }
+
+ public String getClientId()
+ {
+ return _delegate.getClientId();
+ }
+
+ public String getClientId(FacesContext context)
+ {
+ return _delegate.getClientId(context);
+ }
+
+ public String getContainerClientId(FacesContext ctx)
+ {
+ return _delegate.getContainerClientId(ctx);
+ }
+
+ public UIComponent getFacet(String name)
+ {
+ return _delegate.getFacet(name);
+ }
+
+ public int getFacetCount()
+ {
+ return _delegate.getFacetCount();
+ }
+
+ public Map<String, UIComponent> getFacets()
+ {
+ return _delegate.getFacets();
+ }
+
+ public Iterator<UIComponent> getFacetsAndChildren()
+ {
+ return _delegate.getFacetsAndChildren();
+ }
+
+ public String getFamily()
+ {
+ return _delegate.getFamily();
+ }
+
+ public String getId()
+ {
+ return _delegate.getId();
+ }
+
+ public List<SystemEventListener> getListenersForEventClass(
+ Class<? extends SystemEvent> eventClass)
+ {
+ return _delegate.getListenersForEventClass(eventClass);
+ }
+
+ public UIComponent getNamingContainer()
+ {
+ return _delegate.getNamingContainer();
+ }
+
+ public UIComponent getParent()
+ {
+ return _delegate.getParent();
+ }
+
+ public String getRendererType()
+ {
+ return _delegate.getRendererType();
+ }
+
+ public boolean getRendersChildren()
+ {
+ return _delegate.getRendersChildren();
+ }
+
+ public Map<String, String> getResourceBundleMap()
+ {
+ return _delegate.getResourceBundleMap();
+ }
+
+ public ValueBinding getValueBinding(String name)
+ {
+ return _delegate.getValueBinding(name);
+ }
+
+ public ValueExpression getValueExpression(String name)
+ {
+ return _delegate.getValueExpression(name);
+ }
+
+ public boolean initialStateMarked()
+ {
+ return _delegate.initialStateMarked();
+ }
+
+ public boolean invokeOnComponent(FacesContext context, String clientId,
+ ContextCallback callback) throws FacesException
+ {
+ return _delegate.invokeOnComponent(context, clientId, callback);
+ }
+
+ public boolean isInView()
+ {
+ return _delegate.isInView();
+ }
+
+ public boolean isRendered()
+ {
+ return _delegate.isRendered();
+ }
+
+ public boolean isTransient()
+ {
+ return _delegate.isTransient();
+ }
+
+ public void markInitialState()
+ {
+ _delegate.markInitialState();
+ }
+
+ public void processDecodes(FacesContext context)
+ {
+ _delegate.processDecodes(context);
+ }
+
+ public void processEvent(ComponentSystemEvent event)
+ throws AbortProcessingException
+ {
+ _delegate.processEvent(event);
+ }
+
+ public void processRestoreState(FacesContext context, Object state)
+ {
+ _delegate.processRestoreState(context, state);
+ }
+
+ public Object processSaveState(FacesContext context)
+ {
+ return _delegate.processSaveState(context);
+ }
+
+ public void processUpdates(FacesContext context)
+ {
+ _delegate.processUpdates(context);
+ }
+
+ public void processValidators(FacesContext context)
+ {
+ _delegate.processValidators(context);
+ }
+
+ public void queueEvent(FacesEvent event)
+ {
+ _delegate.queueEvent(event);
+ }
+
+ public void restoreState(FacesContext context, Object state)
+ {
+ _delegate.restoreState(context, state);
+ }
+
+ public Object saveState(FacesContext context)
+ {
+ return _delegate.saveState(context);
+ }
+
+ public void setId(String id)
+ {
+ _delegate.setId(id);
+ }
+
+ public void setInView(boolean isInView)
+ {
+ _delegate.setInView(isInView);
+ }
+
+ public void setParent(UIComponent parent)
+ {
+ _delegate.setParent(parent);
+ }
+
+ public void setRendered(boolean rendered)
+ {
+ _delegate.setRendered(rendered);
+ }
+
+ public void setRendererType(String rendererType)
+ {
+ _delegate.setRendererType(rendererType);
+ }
+
+ public void setTransient(boolean newTransientValue)
+ {
+ _delegate.setTransient(newTransientValue);
+ }
+
+ public void setValueBinding(String name, ValueBinding binding)
+ {
+ _delegate.setValueBinding(name, binding);
+ }
+
+ public void setValueExpression(String name, ValueExpression expression)
+ {
+ _delegate.setValueExpression(name, expression);
+ }
+
+ public void subscribeToEvent(Class<? extends SystemEvent> eventClass,
+ ComponentSystemEventListener componentListener)
+ {
+ _delegate.subscribeToEvent(eventClass, componentListener);
+ }
+
+ public void unsubscribeFromEvent(Class<? extends SystemEvent> eventClass,
+ ComponentSystemEventListener componentListener)
+ {
+ _delegate.unsubscribeFromEvent(eventClass, componentListener);
+ }
+
+ public boolean visitTree(VisitContext context, VisitCallback callback)
+ {
+ return _delegate.visitTree(context, callback);
+ }
+
+ // Some methods of UIComponent are protected, but for the scope of this
+ // wrapper are never used, so it is safe to just do nothing or return null.
+
+ @Override
+ protected FacesContext getFacesContext()
+ {
+ return FacesContext.getCurrentInstance();
+ }
+
+ @Override
+ protected void addFacesListener(FacesListener listener)
+ {
+ }
+
+ @Override
+ protected FacesListener[] getFacesListeners(Class clazz)
+ {
+ return null;
+ }
+
+ @Override
+ protected Renderer getRenderer(FacesContext context)
+ {
+ return null;
+ }
+
+ @Override
+ protected void removeFacesListener(FacesListener listener)
+ {
+ }
+}
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeLibrary.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeLibrary.java?rev=942895&r1=942894&r2=942895&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeLibrary.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeLibrary.java Mon May 10 20:44:25 2010
@@ -36,6 +36,8 @@ public class CompositeLibrary extends Ab
addTagHandler("attribute", AttributeHandler.class);
+ addTagHandler("clientBehavior", ClientBehaviorHandler.class);
+
addTagHandler("editableValueHolder", EditableValueHolderHandler.class);
addTagHandler("extension", ExtensionHandler.class);
Modified: myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/FaceletTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/FaceletTestCase.java?rev=942895&r1=942894&r2=942895&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/FaceletTestCase.java (original)
+++ myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/FaceletTestCase.java Mon May 10 20:44:25 2010
@@ -46,6 +46,8 @@ import org.apache.myfaces.application.Vi
import org.apache.myfaces.config.FacesConfigDispenser;
import org.apache.myfaces.config.FacesConfigUnmarshaller;
import org.apache.myfaces.config.RuntimeConfig;
+import org.apache.myfaces.config.element.Behavior;
+import org.apache.myfaces.config.element.ClientBehaviorRenderer;
import org.apache.myfaces.config.element.Renderer;
import org.apache.myfaces.config.impl.digester.DigesterFacesConfigDispenserImpl;
import org.apache.myfaces.config.impl.digester.DigesterFacesConfigUnmarshallerImpl;
@@ -199,6 +201,7 @@ public abstract class FaceletTestCase ex
setupComponents();
setupConvertersAndValidators();
+ setupBehaviors();
setupRenderers();
// Redirect resource request to the directory where the test class is,
@@ -315,6 +318,15 @@ public abstract class FaceletTestCase ex
}
}
+ protected void setupBehaviors() throws Exception
+ {
+ loadStandardFacesConfig();
+ for (Behavior behavior : dispenser.getBehaviors())
+ {
+ application.addBehavior(behavior.getBehaviorId(), behavior.getBehaviorClass());
+ }
+ }
+
/**
* Override this methods and add just what it is necessary
* reduce execution time.
@@ -339,7 +351,25 @@ public abstract class FaceletTestCase ex
renderKit.addRenderer(element.getComponentFamily(), element
.getRendererType(), renderer);
- }
+ }
+
+ for (ClientBehaviorRenderer element : dispenser.getClientBehaviorRenderers(RenderKitFactory.HTML_BASIC_RENDER_KIT))
+ {
+ javax.faces.render.ClientBehaviorRenderer renderer;
+
+ try
+ {
+ renderer = (javax.faces.render.ClientBehaviorRenderer) ClassUtils
+ .newInstance(element.getRendererClass());
+ }
+ catch (Throwable e)
+ {
+ // ignore the failure so that the render kit is configured
+ continue;
+ }
+
+ renderKit.addClientBehaviorRenderer(element.getRendererType(), renderer);
+ }
}
/**
Added: myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentClientBehaviorTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentClientBehaviorTestCase.java?rev=942895&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentClientBehaviorTestCase.java (added)
+++ myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentClientBehaviorTestCase.java Mon May 10 20:44:25 2010
@@ -0,0 +1,264 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.view.facelets.tag.composite;
+
+import javax.faces.component.UICommand;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UINamingContainer;
+import javax.faces.component.UIViewRoot;
+
+import org.apache.myfaces.view.facelets.FaceletTestCase;
+import org.apache.myfaces.view.facelets.bean.HelloWorld;
+
+public class CompositeComponentClientBehaviorTestCase extends FaceletTestCase
+{
+ public void testSimpleClientBehavior() throws Exception
+ {
+ HelloWorld helloWorld = new HelloWorld();
+
+ facesContext.getExternalContext().getRequestMap().put("helloWorldBean",
+ helloWorld);
+
+ UIViewRoot root = facesContext.getViewRoot();
+ vdl.buildView(facesContext, root, "testSimpleClientBehavior.xhtml");
+
+ UIComponent form = root.findComponent("testForm1");
+ assertNotNull(form);
+ UINamingContainer compositeComponent = (UINamingContainer) form.getChildren().get(0);
+ assertNotNull(compositeComponent);
+ UICommand button = (UICommand) compositeComponent.findComponent("button");
+ assertNotNull(button);
+ assertNotNull(button.getClientBehaviors().get("action"));
+ assertEquals(1, button.getClientBehaviors().get("action").size());
+
+ //StringWriter sw = new StringWriter();
+ //MockResponseWriter mrw = new MockResponseWriter(sw);
+ //facesContext.setResponseWriter(mrw);
+
+ //root.encodeAll(facesContext);
+ //sw.flush();
+ //System.out.print(sw.toString());
+ }
+
+ public void testSimpleClientBehaviorDefault() throws Exception
+ {
+ HelloWorld helloWorld = new HelloWorld();
+
+ facesContext.getExternalContext().getRequestMap().put("helloWorldBean",
+ helloWorld);
+
+ UIViewRoot root = facesContext.getViewRoot();
+ vdl.buildView(facesContext, root, "testSimpleClientBehaviorDefault.xhtml");
+
+ UIComponent form = root.findComponent("testForm1");
+ assertNotNull(form);
+ UINamingContainer compositeComponent = (UINamingContainer) form.getChildren().get(0);
+ assertNotNull(compositeComponent);
+ UICommand button = (UICommand) compositeComponent.findComponent("button");
+ assertNotNull(button);
+ assertNotNull(button.getClientBehaviors().get("dblclick"));
+ assertEquals(1, button.getClientBehaviors().get("dblclick").size());
+
+ //StringWriter sw = new StringWriter();
+ //MockResponseWriter mrw = new MockResponseWriter(sw);
+ //facesContext.setResponseWriter(mrw);
+
+ //root.encodeAll(facesContext);
+ //sw.flush();
+ //System.out.print(sw.toString());
+ }
+
+ public void testSimpleClientBehaviorDefaultNoEvent() throws Exception
+ {
+ HelloWorld helloWorld = new HelloWorld();
+
+ facesContext.getExternalContext().getRequestMap().put("helloWorldBean",
+ helloWorld);
+
+ UIViewRoot root = facesContext.getViewRoot();
+ vdl.buildView(facesContext, root, "testSimpleClientBehaviorDefaultNoEvent.xhtml");
+
+ UIComponent form = root.findComponent("testForm1");
+ assertNotNull(form);
+ UINamingContainer compositeComponent = (UINamingContainer) form.getChildren().get(0);
+ assertNotNull(compositeComponent);
+ UICommand button = (UICommand) compositeComponent.findComponent("button");
+ assertNotNull(button);
+ assertNotNull(button.getClientBehaviors().get("action"));
+ assertEquals(1, button.getClientBehaviors().get("action").size());
+
+ //StringWriter sw = new StringWriter();
+ //MockResponseWriter mrw = new MockResponseWriter(sw);
+ //facesContext.setResponseWriter(mrw);
+
+ //root.encodeAll(facesContext);
+ //sw.flush();
+ //System.out.print(sw.toString());
+ }
+
+ public void testSimpleClientBehaviorAjaxWrap() throws Exception
+ {
+ HelloWorld helloWorld = new HelloWorld();
+
+ facesContext.getExternalContext().getRequestMap().put("helloWorldBean",
+ helloWorld);
+
+ UIViewRoot root = facesContext.getViewRoot();
+ vdl.buildView(facesContext, root, "testSimpleClientBehaviorAjaxWrap.xhtml");
+
+ UIComponent form = root.findComponent("testForm1");
+ assertNotNull(form);
+ UINamingContainer compositeComponent = (UINamingContainer) form.getChildren().get(0);
+ assertNotNull(compositeComponent);
+ UICommand button = (UICommand) compositeComponent.findComponent("button");
+ assertNotNull(button);
+ assertNotNull(button.getClientBehaviors().get("action"));
+ assertEquals(1, button.getClientBehaviors().get("action").size());
+
+ //StringWriter sw = new StringWriter();
+ //MockResponseWriter mrw = new MockResponseWriter(sw);
+ //facesContext.setResponseWriter(mrw);
+
+ //root.encodeAll(facesContext);
+ //sw.flush();
+ //System.out.print(sw.toString());
+ }
+
+ public void testSimpleClientBehaviorDefaultAjaxWrap() throws Exception
+ {
+ HelloWorld helloWorld = new HelloWorld();
+
+ facesContext.getExternalContext().getRequestMap().put("helloWorldBean",
+ helloWorld);
+
+ UIViewRoot root = facesContext.getViewRoot();
+ vdl.buildView(facesContext, root, "testSimpleClientBehaviorDefaultAjaxWrap.xhtml");
+
+ UIComponent form = root.findComponent("testForm1");
+ assertNotNull(form);
+ UINamingContainer compositeComponent = (UINamingContainer) form.getChildren().get(0);
+ assertNotNull(compositeComponent);
+ UICommand button = (UICommand) compositeComponent.findComponent("button");
+ assertNotNull(button);
+ assertNotNull(button.getClientBehaviors().get("dblclick"));
+ assertEquals(1, button.getClientBehaviors().get("dblclick").size());
+
+ //StringWriter sw = new StringWriter();
+ //MockResponseWriter mrw = new MockResponseWriter(sw);
+ //facesContext.setResponseWriter(mrw);
+
+ //root.encodeAll(facesContext);
+ //sw.flush();
+ //System.out.print(sw.toString());
+ }
+
+ public void testSimpleClientBehaviorDefaultNoEventAjaxWrap() throws Exception
+ {
+ HelloWorld helloWorld = new HelloWorld();
+
+ facesContext.getExternalContext().getRequestMap().put("helloWorldBean",
+ helloWorld);
+
+ UIViewRoot root = facesContext.getViewRoot();
+ vdl.buildView(facesContext, root, "testSimpleClientBehaviorDefaultNoEventAjaxWrap.xhtml");
+
+ UIComponent form = root.findComponent("testForm1");
+ assertNotNull(form);
+ UINamingContainer compositeComponent = (UINamingContainer) form.getChildren().get(0);
+ assertNotNull(compositeComponent);
+ UICommand button = (UICommand) compositeComponent.findComponent("button");
+ assertNotNull(button);
+ assertNotNull(button.getClientBehaviors().get("action"));
+ assertEquals(1, button.getClientBehaviors().get("action").size());
+
+ //StringWriter sw = new StringWriter();
+ //MockResponseWriter mrw = new MockResponseWriter(sw);
+ //facesContext.setResponseWriter(mrw);
+
+ //root.encodeAll(facesContext);
+ //sw.flush();
+ //System.out.print(sw.toString());
+ }
+
+ public void testCompositeClientBehavior() throws Exception
+ {
+ HelloWorld helloWorld = new HelloWorld();
+
+ facesContext.getExternalContext().getRequestMap().put("helloWorldBean",
+ helloWorld);
+
+ UIViewRoot root = facesContext.getViewRoot();
+ vdl.buildView(facesContext, root, "testCompositeClientBehavior.xhtml");
+
+ UIComponent form = root.findComponent("testForm1");
+ assertNotNull(form);
+ UINamingContainer compositeComponent = (UINamingContainer) form.getChildren().get(0);
+ assertNotNull(compositeComponent);
+ UINamingContainer compositeComponent2 = (UINamingContainer) compositeComponent.findComponent("button3");
+ assertNotNull(compositeComponent2);
+ UICommand button = (UICommand) compositeComponent2.findComponent("button");
+ assertNotNull(button);
+ //One added in testCompositeActionSource, the other one
+ //inside compositeActionSource.xhtml
+ assertNotNull(button.getClientBehaviors().get("action"));
+ assertEquals(1, button.getClientBehaviors().get("action").size());
+
+ //StringWriter sw = new StringWriter();
+ //MockResponseWriter mrw = new MockResponseWriter(sw);
+ //facesContext.setResponseWriter(mrw);
+
+ //root.encodeAll(facesContext);
+ //sw.flush();
+ //System.out.print(sw.toString());
+ }
+
+ public void testCompositeDoubleClientBehavior() throws Exception
+ {
+ HelloWorld helloWorld = new HelloWorld();
+
+ facesContext.getExternalContext().getRequestMap().put("helloWorldBean",
+ helloWorld);
+
+ UIViewRoot root = facesContext.getViewRoot();
+ vdl.buildView(facesContext, root, "testCompositeDoubleClientBehavior.xhtml");
+
+ UIComponent form = root.findComponent("testForm1");
+ assertNotNull(form);
+ UINamingContainer compositeComponent = (UINamingContainer) form.getChildren().get(0);
+ assertNotNull(compositeComponent);
+ UINamingContainer compositeComponent2 = (UINamingContainer) compositeComponent.findComponent("compositeClientBehavior");
+ assertNotNull(compositeComponent2);
+ UINamingContainer compositeComponent3 = (UINamingContainer) compositeComponent2.findComponent("button3");
+ assertNotNull(compositeComponent3);
+ UICommand button = (UICommand) compositeComponent3.findComponent("button");
+ assertNotNull(button);
+ //One added in testCompositeActionSource, the other one
+ //inside compositeActionSource.xhtml
+ assertNotNull(button.getClientBehaviors().get("action"));
+ assertEquals(1, button.getClientBehaviors().get("action").size());
+
+ //StringWriter sw = new StringWriter();
+ //MockResponseWriter mrw = new MockResponseWriter(sw);
+ //facesContext.setResponseWriter(mrw);
+
+ //root.encodeAll(facesContext);
+ //sw.flush();
+ //System.out.print(sw.toString());
+ }
+}
Added: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/javax.faces/jsf.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/javax.faces/jsf.js?rev=942895&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/javax.faces/jsf.js (added)
+++ myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/javax.faces/jsf.js Mon May 10 20:44:25 2010
@@ -0,0 +1 @@
+//Dummy class to make work h:outputScript
\ No newline at end of file
Added: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testComposite/compositeClientBehavior.xhtml
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testComposite/compositeClientBehavior.xhtml?rev=942895&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testComposite/compositeClientBehavior.xhtml (added)
+++ myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testComposite/compositeClientBehavior.xhtml Mon May 10 20:44:25 2010
@@ -0,0 +1,33 @@
+<!--
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ $Id: defineInclude.xml 804043 2009-08-13 22:08:44Z lu4242 $
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:composite="http://java.sun.com/jsf/composite"
+ xmlns:testComposite="http://java.sun.com/jsf/composite/testComposite">
+<head>
+</head>
+<body>
+<composite:interface>
+ <composite:clientBehavior name="pushOuterButton" event="pushButton" targets="button3"/>
+</composite:interface>
+<composite:implementation>
+<testComposite:simpleClientBehavior id="button3" >
+</testComposite:simpleClientBehavior>
+</composite:implementation>
+</body>
+</html>
\ No newline at end of file
Added: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testComposite/compositeDoubleClientBehavior.xhtml
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testComposite/compositeDoubleClientBehavior.xhtml?rev=942895&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testComposite/compositeDoubleClientBehavior.xhtml (added)
+++ myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testComposite/compositeDoubleClientBehavior.xhtml Mon May 10 20:44:25 2010
@@ -0,0 +1,33 @@
+<!--
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ $Id: defineInclude.xml 804043 2009-08-13 22:08:44Z lu4242 $
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:composite="http://java.sun.com/jsf/composite"
+ xmlns:testComposite="http://java.sun.com/jsf/composite/testComposite">
+<head>
+</head>
+<body>
+<composite:interface>
+ <composite:clientBehavior name="pushOuterOuterButton" event="pushOuterButton" targets="compositeClientBehavior"/>
+</composite:interface>
+<composite:implementation>
+<testComposite:compositeClientBehavior id="compositeClientBehavior" >
+</testComposite:compositeClientBehavior>
+</composite:implementation>
+</body>
+</html>
\ No newline at end of file
Added: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testComposite/simpleClientBehavior.xhtml
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testComposite/simpleClientBehavior.xhtml?rev=942895&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testComposite/simpleClientBehavior.xhtml (added)
+++ myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testComposite/simpleClientBehavior.xhtml Mon May 10 20:44:25 2010
@@ -0,0 +1,31 @@
+<!--
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ $Id: defineInclude.xml 804043 2009-08-13 22:08:44Z lu4242 $
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:composite="http://java.sun.com/jsf/composite">
+<head>
+</head>
+<body>
+<composite:interface>
+ <composite:clientBehavior name="pushButton" event="action" targets="button"/>
+</composite:interface>
+<composite:implementation>
+ <h:commandButton id="button" value="Press me!" />
+</composite:implementation>
+</body>
+</html>
\ No newline at end of file
Added: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testComposite/simpleClientBehaviorDefault.xhtml
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testComposite/simpleClientBehaviorDefault.xhtml?rev=942895&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testComposite/simpleClientBehaviorDefault.xhtml (added)
+++ myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testComposite/simpleClientBehaviorDefault.xhtml Mon May 10 20:44:25 2010
@@ -0,0 +1,31 @@
+<!--
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ $Id: defineInclude.xml 804043 2009-08-13 22:08:44Z lu4242 $
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:composite="http://java.sun.com/jsf/composite">
+<head>
+</head>
+<body>
+<composite:interface>
+ <composite:clientBehavior name="pushButton" default="true" event="dblclick" targets="button"/>
+</composite:interface>
+<composite:implementation>
+ <h:commandButton id="button" value="Press me!" />
+</composite:implementation>
+</body>
+</html>
\ No newline at end of file
Added: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testComposite/simpleClientBehaviorDefaultNoEvent.xhtml
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testComposite/simpleClientBehaviorDefaultNoEvent.xhtml?rev=942895&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testComposite/simpleClientBehaviorDefaultNoEvent.xhtml (added)
+++ myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testComposite/simpleClientBehaviorDefaultNoEvent.xhtml Mon May 10 20:44:25 2010
@@ -0,0 +1,31 @@
+<!--
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ $Id: defineInclude.xml 804043 2009-08-13 22:08:44Z lu4242 $
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:composite="http://java.sun.com/jsf/composite">
+<head>
+</head>
+<body>
+<composite:interface>
+ <composite:clientBehavior name="pushButton" default="true" targets="button"/>
+</composite:interface>
+<composite:implementation>
+ <h:commandButton id="button" value="Press me!" />
+</composite:implementation>
+</body>
+</html>
\ No newline at end of file
Added: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testCompositeClientBehavior.xhtml
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testCompositeClientBehavior.xhtml?rev=942895&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testCompositeClientBehavior.xhtml (added)
+++ myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testCompositeClientBehavior.xhtml Mon May 10 20:44:25 2010
@@ -0,0 +1,30 @@
+<!--
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ $Id: defineInclude.xml 804043 2009-08-13 22:08:44Z lu4242 $
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:testComposite="http://java.sun.com/jsf/composite/testComposite">
+<head>
+</head>
+<body>
+<h:form id="testForm1">
+<testComposite:compositeClientBehavior>
+ <f:ajax event="pushOuterButton"/>
+</testComposite:compositeClientBehavior>
+</h:form>
+</body>
+</html>
\ No newline at end of file
Added: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testCompositeDoubleClientBehavior.xhtml
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testCompositeDoubleClientBehavior.xhtml?rev=942895&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testCompositeDoubleClientBehavior.xhtml (added)
+++ myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testCompositeDoubleClientBehavior.xhtml Mon May 10 20:44:25 2010
@@ -0,0 +1,30 @@
+<!--
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ $Id: defineInclude.xml 804043 2009-08-13 22:08:44Z lu4242 $
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:testComposite="http://java.sun.com/jsf/composite/testComposite">
+<head>
+</head>
+<body>
+<h:form id="testForm1">
+<testComposite:compositeDoubleClientBehavior>
+ <f:ajax event="pushOuterOuterButton"/>
+</testComposite:compositeDoubleClientBehavior>
+</h:form>
+</body>
+</html>
\ No newline at end of file
Added: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleClientBehavior.xhtml
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleClientBehavior.xhtml?rev=942895&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleClientBehavior.xhtml (added)
+++ myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleClientBehavior.xhtml Mon May 10 20:44:25 2010
@@ -0,0 +1,30 @@
+<!--
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ $Id: defineInclude.xml 804043 2009-08-13 22:08:44Z lu4242 $
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:testComposite="http://java.sun.com/jsf/composite/testComposite">
+<head>
+</head>
+<body>
+<h:form id="testForm1">
+<testComposite:simpleClientBehavior>
+ <f:ajax event="pushButton"/>
+</testComposite:simpleClientBehavior>
+</h:form>
+</body>
+</html>
\ No newline at end of file
Added: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleClientBehaviorAjaxWrap.xhtml
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleClientBehaviorAjaxWrap.xhtml?rev=942895&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleClientBehaviorAjaxWrap.xhtml (added)
+++ myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleClientBehaviorAjaxWrap.xhtml Mon May 10 20:44:25 2010
@@ -0,0 +1,31 @@
+<!--
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ $Id: defineInclude.xml 804043 2009-08-13 22:08:44Z lu4242 $
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:testComposite="http://java.sun.com/jsf/composite/testComposite">
+<head>
+</head>
+<body>
+<h:form id="testForm1">
+<f:ajax event="pushButton">
+ <testComposite:simpleClientBehavior>
+ </testComposite:simpleClientBehavior>
+</f:ajax>
+</h:form>
+</body>
+</html>
\ No newline at end of file
Added: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleClientBehaviorDefault.xhtml
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleClientBehaviorDefault.xhtml?rev=942895&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleClientBehaviorDefault.xhtml (added)
+++ myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleClientBehaviorDefault.xhtml Mon May 10 20:44:25 2010
@@ -0,0 +1,30 @@
+<!--
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ $Id: defineInclude.xml 804043 2009-08-13 22:08:44Z lu4242 $
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:testComposite="http://java.sun.com/jsf/composite/testComposite">
+<head>
+</head>
+<body>
+<h:form id="testForm1">
+<testComposite:simpleClientBehaviorDefault>
+ <f:ajax/>
+</testComposite:simpleClientBehaviorDefault>
+</h:form>
+</body>
+</html>
\ No newline at end of file
Added: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleClientBehaviorDefaultAjaxWrap.xhtml
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleClientBehaviorDefaultAjaxWrap.xhtml?rev=942895&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleClientBehaviorDefaultAjaxWrap.xhtml (added)
+++ myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleClientBehaviorDefaultAjaxWrap.xhtml Mon May 10 20:44:25 2010
@@ -0,0 +1,31 @@
+<!--
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ $Id: defineInclude.xml 804043 2009-08-13 22:08:44Z lu4242 $
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:testComposite="http://java.sun.com/jsf/composite/testComposite">
+<head>
+</head>
+<body>
+<h:form id="testForm1">
+<f:ajax>
+<testComposite:simpleClientBehaviorDefault>
+</testComposite:simpleClientBehaviorDefault>
+</f:ajax>
+</h:form>
+</body>
+</html>
\ No newline at end of file
Added: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleClientBehaviorDefaultNoEvent.xhtml
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleClientBehaviorDefaultNoEvent.xhtml?rev=942895&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleClientBehaviorDefaultNoEvent.xhtml (added)
+++ myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleClientBehaviorDefaultNoEvent.xhtml Mon May 10 20:44:25 2010
@@ -0,0 +1,30 @@
+<!--
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ $Id: defineInclude.xml 804043 2009-08-13 22:08:44Z lu4242 $
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:testComposite="http://java.sun.com/jsf/composite/testComposite">
+<head>
+</head>
+<body>
+<h:form id="testForm1">
+<testComposite:simpleClientBehaviorDefaultNoEvent>
+ <f:ajax/>
+</testComposite:simpleClientBehaviorDefaultNoEvent>
+</h:form>
+</body>
+</html>
\ No newline at end of file
Added: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleClientBehaviorDefaultNoEventAjaxWrap.xhtml
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleClientBehaviorDefaultNoEventAjaxWrap.xhtml?rev=942895&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleClientBehaviorDefaultNoEventAjaxWrap.xhtml (added)
+++ myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleClientBehaviorDefaultNoEventAjaxWrap.xhtml Mon May 10 20:44:25 2010
@@ -0,0 +1,31 @@
+<!--
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ $Id: defineInclude.xml 804043 2009-08-13 22:08:44Z lu4242 $
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:testComposite="http://java.sun.com/jsf/composite/testComposite">
+<head>
+</head>
+<body>
+<h:form id="testForm1">
+<f:ajax>
+<testComposite:simpleClientBehaviorDefaultNoEvent>
+</testComposite:simpleClientBehaviorDefaultNoEvent>
+</f:ajax>
+</h:form>
+</body>
+</html>
\ No newline at end of file