Author: nbelaevski
Date: 2010-05-06 18:42:05 -0400 (Thu, 06 May 2010)
New Revision: 16912
Added:
root/ui/trunk/components/core/src/test/java/org/richfaces/view/
root/ui/trunk/components/core/src/test/java/org/richfaces/view/facelets/
root/ui/trunk/components/core/src/test/java/org/richfaces/view/facelets/html/
root/ui/trunk/components/core/src/test/java/org/richfaces/view/facelets/html/AttachQueueHandlerTest.java
root/ui/trunk/components/core/src/test/resources/org/richfaces/
root/ui/trunk/components/core/src/test/resources/org/richfaces/view/
root/ui/trunk/components/core/src/test/resources/org/richfaces/view/facelets/
root/ui/trunk/components/core/src/test/resources/org/richfaces/view/facelets/html/
root/ui/trunk/components/core/src/test/resources/org/richfaces/view/facelets/html/attachQueueWithNestedAjax.xhtml
root/ui/trunk/components/core/src/test/resources/org/richfaces/view/facelets/html/attachQueueWithParentComponent.xhtml
root/ui/trunk/components/core/src/test/resources/org/richfaces/view/facelets/html/attachQueueWithWrappingAjax.xhtml
root/ui/trunk/components/core/src/test/resources/org/richfaces/view/facelets/html/attachQueueWithWrappingBehaviors.xhtml
Modified:
root/ui/trunk/components/core/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java
root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractAttachQueue.java
root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/AjaxHandler.java
root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/AttachQueueHandler.java
root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/BehaviorsAddingComponentHandlerWrapper.java
Log:
https://jira.jboss.org/jira/browse/RFPL-518
Modified:
root/ui/trunk/components/core/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java
===================================================================
---
root/ui/trunk/components/core/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java 2010-05-06
22:38:53 UTC (rev 16911)
+++
root/ui/trunk/components/core/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java 2010-05-06
22:42:05 UTC (rev 16912)
@@ -6,7 +6,6 @@
import javax.el.ELContext;
import javax.el.ValueExpression;
-import javax.faces.component.UIComponent;
import javax.faces.component.UIComponentBase;
import javax.faces.component.behavior.FacesBehavior;
import javax.faces.context.FacesContext;
@@ -241,10 +240,6 @@
clearInitialState();
}
- public void attachToQueue(FacesContext context, UIComponent queueComponent) {
- setQueueId(queueComponent.getClientId(context));
- }
-
public boolean isLimitRender() {
if (this.limitRender != null) {
return this.limitRender.booleanValue();
Modified:
root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractAttachQueue.java
===================================================================
---
root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractAttachQueue.java 2010-05-06
22:38:53 UTC (rev 16911)
+++
root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractAttachQueue.java 2010-05-06
22:42:05 UTC (rev 16912)
@@ -21,10 +21,18 @@
*/
package org.richfaces.component;
+import java.util.ArrayList;
+import java.util.List;
+
import javax.faces.component.UIComponent;
import javax.faces.component.UIComponentBase;
-import javax.faces.context.FacesContext;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.ComponentSystemEvent;
+import javax.faces.event.ComponentSystemEventListener;
+import javax.faces.event.ListenerFor;
+import javax.faces.event.PostAddToViewEvent;
+import org.ajax4jsf.component.behavior.AjaxBehavior;
import org.richfaces.cdk.annotations.Attribute;
import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.annotations.Tag;
@@ -39,16 +47,17 @@
handler = "org.richfaces.view.facelets.html.AttachQueueHandler",
generate = false, type = TagType.Facelets)
)
-public abstract class AbstractAttachQueue extends UIComponentBase {
+@ListenerFor(systemEventClass = PostAddToViewEvent.class)
+public abstract class AbstractAttachQueue extends UIComponentBase implements
ComponentSystemEventListener {
public static final String COMPONENT_TYPE = "org.richfaces.AttachQueue";
public static final String QUEUE_ID_ATTRIBUTE = "queueId";
- private enum PropertyKeys {
- attachToParent
- }
+ private transient List<UIComponent> componentsToAssociate;
+ private transient List<AjaxBehavior> behaviorsToAssociate;
+
@Attribute
public abstract String getRequestSimilarityId();
@@ -72,37 +81,72 @@
return null;
}
- public boolean isAttachToParent() {
- Object propertyValue = getStateHelper().get(PropertyKeys.attachToParent);
- if (propertyValue == null) {
- //default value is true
- return true;
+ private static void immediateAssociateWith(UIComponent component, String queueId) {
+ component.getAttributes().put(QUEUE_ID_ATTRIBUTE, queueId);
+ }
+
+ private static void immediateAssociateWith(AjaxBehavior behavior, String queueId) {
+ behavior.setQueueId(queueId);
+ }
+
+ /**
+ * <p>Establishes association between attachQueue component and component
passed as method argument.</p>
+ * <p>Association can be established either immediately just before returning
from this method, or postponed
+ * until attachQueue component will be added to view.</p>
+ *
+ * @param component
+ */
+ public void associateWith(UIComponent component) {
+ if (isInView()) {
+ immediateAssociateWith(component, getClientId());
} else {
- return Boolean.TRUE.equals(propertyValue);
+ if (componentsToAssociate == null) {
+ componentsToAssociate = new ArrayList<UIComponent>(2);
+ }
+
+ componentsToAssociate.add(component);
}
}
+
+ /**
+ * <p>Establishes association between attachQueue component and behavior passed
as method argument.</p>
+ * <p>Association can be established either immediately just before returning
from this method, or postponed
+ * until attachQueue component will be added to view.</p>
+ *
+ * @param behavior
+ */
+ public void associateWith(AjaxBehavior behavior) {
+ if (isInView()) {
+ immediateAssociateWith(behavior, getClientId());
+ } else {
+ if (behaviorsToAssociate == null) {
+ behaviorsToAssociate = new ArrayList<AjaxBehavior>(2);
+ }
- public void setAttachToParent(boolean attachToParent) {
- getStateHelper().put(PropertyKeys.attachToParent, attachToParent);
+ behaviorsToAssociate.add(behavior);
+ }
}
@Override
- public void setParent(UIComponent parent) {
- UIComponent oldParent = getParent();
+ public void processEvent(ComponentSystemEvent event) throws AbortProcessingException
{
+ super.processEvent(event);
- super.setParent(parent);
+ String queueId = getClientId();
- if (isAttachToParent()) {
- if (oldParent != null) {
- oldParent.getAttributes().remove(QUEUE_ID_ATTRIBUTE);
+ if (componentsToAssociate != null) {
+ for (UIComponent componentToAssociate : componentsToAssociate) {
+ immediateAssociateWith(componentToAssociate, queueId);
}
- if (parent != null) {
- FacesContext context = getFacesContext();
- String clientId = getClientId(context);
-
- parent.getAttributes().put(QUEUE_ID_ATTRIBUTE, clientId);
+ componentsToAssociate = null;
+ }
+
+ if (behaviorsToAssociate != null) {
+ for (AjaxBehavior ajaxBehavior : behaviorsToAssociate) {
+ immediateAssociateWith(ajaxBehavior, queueId);
}
+
+ behaviorsToAssociate = null;
}
}
}
Modified:
root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/AjaxHandler.java
===================================================================
---
root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/AjaxHandler.java 2010-05-06
22:38:53 UTC (rev 16911)
+++
root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/AjaxHandler.java 2010-05-06
22:42:05 UTC (rev 16912)
@@ -113,8 +113,23 @@
if (behaviorInfo != null) {
if (behaviorInfo.isWrapping()) {
AbstractAttachQueue attachQueue = attachQueueInfo.getAttachQueue();
- assignAttachQueueComponent(context, attachQueue,
behaviorInfo.getBehaviors());
+ if (attachQueue != null) {
+ List<ClientBehavior> behaviors = behaviorInfo.getBehaviors();
+ if (behaviors != null) {
+ for (ClientBehavior behavior : behaviors) {
+ if (behavior instanceof AjaxBehavior) {
+ AjaxBehavior createdAjaxBehavior = (AjaxBehavior)
behavior;
+ attachQueue.associateWith(createdAjaxBehavior);
+ }
+ }
+ }
+ }
} else {
+ AbstractAttachQueue attachQueue = attachQueueInfo.getAttachQueue();
+ if (attachQueue != null) {
+ attachQueue.associateWith(ajaxBehavior);
+ }
+
applyNested(ctx, parent, ajaxBehavior);
}
} else {
@@ -194,21 +209,6 @@
}
}
- private void assignAttachQueueComponent(FacesContext context, AbstractAttachQueue
attachQueue,
- List<ClientBehavior> behaviors) {
-
- if (behaviors != null && attachQueue != null) {
- for (ClientBehavior behavior : behaviors) {
- if (!(behavior instanceof AjaxBehavior)) {
- continue;
- }
-
- AjaxBehavior ajaxBehavior = (AjaxBehavior) behavior;
- ajaxBehavior.attachToQueue(context, attachQueue);
- }
- }
- }
-
private String resolveEventName(ClientBehaviorHolder bHolder) {
String eventName = getEventName();
if (null == eventName) {
Modified:
root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/AttachQueueHandler.java
===================================================================
---
root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/AttachQueueHandler.java 2010-05-06
22:38:53 UTC (rev 16911)
+++
root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/AttachQueueHandler.java 2010-05-06
22:42:05 UTC (rev 16912)
@@ -45,17 +45,23 @@
public void onComponentCreated(FaceletContext ctx, UIComponent c, UIComponent parent)
{
super.onComponentCreated(ctx, c, parent);
+ AbstractAttachQueue attachQueue = ((AbstractAttachQueue) c);
+ boolean associateWithParent = true;
+
AttachQueueStack attachQueueStack =
AttachQueueStack.getStack(ctx.getFacesContext(), false);
if (attachQueueStack != null) {
AttachQueueInfo attachQueueInfo = attachQueueStack.peek();
if (attachQueueInfo != null) {
UIComponent queueInfoParent = attachQueueInfo.getParentComponent();
if (queueInfoParent.equals(parent)) {
- AbstractAttachQueue attachQueue = ((AbstractAttachQueue) c);
attachQueueInfo.setAttachQueue(attachQueue);
- attachQueue.setAttachToParent(false);
+ associateWithParent = false;
}
}
}
+
+ if (associateWithParent) {
+ attachQueue.associateWith(parent);
+ }
}
}
Modified:
root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/BehaviorsAddingComponentHandlerWrapper.java
===================================================================
---
root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/BehaviorsAddingComponentHandlerWrapper.java 2010-05-06
22:38:53 UTC (rev 16911)
+++
root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/BehaviorsAddingComponentHandlerWrapper.java 2010-05-06
22:42:05 UTC (rev 16912)
@@ -36,6 +36,8 @@
import javax.faces.view.facelets.Tag;
import javax.faces.view.facelets.TagAttribute;
+import org.richfaces.component.AbstractAttachQueue;
+
/**
* @author Nick Belaevski
*/
@@ -100,7 +102,9 @@
BehaviorStack behaviorStack = BehaviorStack.getBehaviorStack(facesContext,
false);
if (behaviorStack != null && !behaviorStack.isEmpty()) {
- behaviorStack.markWrapping();
+ if (!(c instanceof AbstractAttachQueue)) {
+ behaviorStack.markWrapping();
+ }
if (c instanceof ClientBehaviorHolder) {
ClientBehaviorHolder behaviorHolder = (ClientBehaviorHolder) c;
Added:
root/ui/trunk/components/core/src/test/java/org/richfaces/view/facelets/html/AttachQueueHandlerTest.java
===================================================================
---
root/ui/trunk/components/core/src/test/java/org/richfaces/view/facelets/html/AttachQueueHandlerTest.java
(rev 0)
+++
root/ui/trunk/components/core/src/test/java/org/richfaces/view/facelets/html/AttachQueueHandlerTest.java 2010-05-06
22:42:05 UTC (rev 16912)
@@ -0,0 +1,202 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, 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.
+ */
+package org.richfaces.view.facelets.html;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.util.List;
+
+import javax.faces.application.ViewHandler;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIViewRoot;
+import javax.faces.component.behavior.ClientBehavior;
+import javax.faces.component.behavior.ClientBehaviorHolder;
+import javax.faces.context.FacesContext;
+import javax.faces.view.ViewDeclarationLanguage;
+
+import org.ajax4jsf.component.behavior.AjaxBehavior;
+import org.jboss.test.faces.FacesEnvironment;
+import org.jboss.test.faces.FacesEnvironment.FacesRequest;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.richfaces.component.AbstractAttachQueue;
+
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class AttachQueueHandlerTest {
+
+ private FacesEnvironment environment;
+
+ private FacesRequest facesRequest;
+
+ private FacesContext facesContext;
+
+ private UIViewRoot viewRoot;
+
+ @Before
+ public void setUp() throws Exception {
+ environment = FacesEnvironment.createEnvironment();
+
+ environment.withWebRoot(
+
getClass().getResource("/org/richfaces/view/facelets/html/attachQueueWithNestedAjax.xhtml"));
+
+ environment.start();
+
+ facesRequest = environment.createFacesRequest();
+ facesRequest.start();
+
+ facesContext = FacesContext.getCurrentInstance();
+ viewRoot = facesContext.getViewRoot();
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ viewRoot = null;
+ facesContext = null;
+
+ facesRequest.release();
+ facesRequest = null;
+
+ environment.release();
+ environment = null;
+ }
+
+ private void buildView(String viewId) throws IOException {
+ viewRoot.setViewId(viewId);
+ ViewHandler viewHandler = facesContext.getApplication().getViewHandler();
+ ViewDeclarationLanguage vdl =
viewHandler.getViewDeclarationLanguage(facesContext, viewRoot.getViewId());
+ vdl.buildView(facesContext, viewRoot);
+ }
+
+ private AjaxBehavior getAjaxBehavior(String componentId, String eventName) {
+ UIComponent component = viewRoot.findComponent(componentId);
+ assertNotNull(component);
+
+ ClientBehaviorHolder behaviorHolder = (ClientBehaviorHolder) component;
+
+ String localEventName = eventName;
+ if (localEventName == null) {
+ localEventName = behaviorHolder.getDefaultEventName();
+ }
+
+ List<ClientBehavior> behaviors =
behaviorHolder.getClientBehaviors().get(localEventName);
+ if (behaviors != null) {
+ for (ClientBehavior behavior : behaviors) {
+ if (behavior instanceof AjaxBehavior) {
+ return (AjaxBehavior) behavior;
+ }
+ }
+ }
+
+ return null;
+ }
+
+ private void checkNotAssignedToParent(String attachQueueId) {
+ UIComponent attachQueue = viewRoot.findComponent(attachQueueId);
+
+ assertTrue(attachQueue instanceof AbstractAttachQueue);
+
assertNull(attachQueue.getParent().getAttributes().get(AbstractAttachQueue.QUEUE_ID_ATTRIBUTE));
+ }
+
+ @Test
+ public void testAttachQueueWithNestedAjax() throws Exception {
+ buildView("/attachQueueWithNestedAjax.xhtml");
+
+ AjaxBehavior defaultEvent = getAjaxBehavior(":form:defaultEventText",
null);
+ assertNotNull(defaultEvent);
+ assertEquals("form:defaultEventQueue", defaultEvent.getQueueId());
+
+ AjaxBehavior keyup = getAjaxBehavior(":form:keyupText",
"keyup");
+ assertNotNull(keyup);
+ assertEquals("form:keyupQueue", keyup.getQueueId());
+
+ checkNotAssignedToParent(":form:defaultEventQueue");
+ checkNotAssignedToParent(":form:keyupQueue");
+ }
+
+ @Test
+ public void testAttachQueueWithParentComponent() throws Exception {
+ buildView("/attachQueueWithParentComponent.xhtml");
+
+ UIComponent link = viewRoot.findComponent(":form:link");
+ assertEquals("form:attachQueue",
link.getAttributes().get(AbstractAttachQueue.QUEUE_ID_ATTRIBUTE));
+ }
+
+ @Test
+ public void testAttachQueueWithWrappingAjax() throws Exception {
+ buildView("/attachQueueWithWrappingAjax.xhtml");
+
+ AjaxBehavior defaultEventInput =
getAjaxBehavior(":form:defaultEventInput", null);
+ assertNotNull(defaultEventInput);
+ assertEquals("form:defaultEventQueue",
defaultEventInput.getQueueId());
+
+ AjaxBehavior defaultEventLinkBehavior =
getAjaxBehavior(":form:defaultEventLink", null);
+ assertNotNull(defaultEventLinkBehavior);
+ assertEquals("form:defaultEventQueue",
defaultEventLinkBehavior.getQueueId());
+
+ AjaxBehavior valueChangeInput =
getAjaxBehavior(":form:valueChangeInput", null);
+ assertNotNull(valueChangeInput);
+ assertEquals("form:valueChangeQueue", valueChangeInput.getQueueId());
+
+ AjaxBehavior valueChangeLink = getAjaxBehavior(":form:valueChangeLink",
null);
+ assertNull(valueChangeLink);
+
+ checkNotAssignedToParent(":form:defaultEventQueue");
+ checkNotAssignedToParent(":form:valueChangeQueue");
+ }
+
+ @Test
+ public void testAttachQueueWithWrappingBehaviors() throws Exception {
+ buildView("/attachQueueWithWrappingBehaviors.xhtml");
+
+ AjaxBehavior input = getAjaxBehavior(":form:input",
"click");
+ assertNotNull(input);
+ assertEquals("form:clickQueue", input.getQueueId());
+
+ AjaxBehavior button = getAjaxBehavior(":form:button",
"click");
+ assertNotNull(button);
+ assertEquals("form:clickQueue", button.getQueueId());
+
+ AjaxBehavior nestedInputClick = getAjaxBehavior(":form:nestedInput",
"click");
+ assertNotNull(nestedInputClick);
+ assertEquals("form:clickQueue", nestedInputClick.getQueueId());
+
+ AjaxBehavior nestedInputChange = getAjaxBehavior(":form:nestedInput",
"valueChange");
+ assertNotNull(nestedInputChange);
+ assertEquals("form:valueChangeQueue", nestedInputChange.getQueueId());
+
+ AjaxBehavior nestedButtonClick = getAjaxBehavior(":form:nestedButton",
"click");
+ assertNotNull(nestedButtonClick);
+ assertEquals("form:clickQueue", nestedButtonClick.getQueueId());
+
+ checkNotAssignedToParent(":form:valueChangeQueue");
+ checkNotAssignedToParent(":form:clickQueue");
+ }
+}
Added:
root/ui/trunk/components/core/src/test/resources/org/richfaces/view/facelets/html/attachQueueWithNestedAjax.xhtml
===================================================================
---
root/ui/trunk/components/core/src/test/resources/org/richfaces/view/facelets/html/attachQueueWithNestedAjax.xhtml
(rev 0)
+++
root/ui/trunk/components/core/src/test/resources/org/richfaces/view/facelets/html/attachQueueWithNestedAjax.xhtml 2010-05-06
22:42:05 UTC (rev 16912)
@@ -0,0 +1,20 @@
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:a4j="http://richfaces.org/a4j">
+
+ <h:form id="form">
+ <h:inputText id="defaultEventText">
+ <a4j:ajax>
+ <a4j:attachQueue id="defaultEventQueue" />
+ </a4j:ajax>
+ </h:inputText>
+
+ <h:inputText id="keyupText">
+ <a4j:ajax event="keyup">
+ <a4j:attachQueue id="keyupQueue" />
+ </a4j:ajax>
+ </h:inputText>
+ </h:form>
+</ui:composition>
\ No newline at end of file
Added:
root/ui/trunk/components/core/src/test/resources/org/richfaces/view/facelets/html/attachQueueWithParentComponent.xhtml
===================================================================
---
root/ui/trunk/components/core/src/test/resources/org/richfaces/view/facelets/html/attachQueueWithParentComponent.xhtml
(rev 0)
+++
root/ui/trunk/components/core/src/test/resources/org/richfaces/view/facelets/html/attachQueueWithParentComponent.xhtml 2010-05-06
22:42:05 UTC (rev 16912)
@@ -0,0 +1,13 @@
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:a4j="http://richfaces.org/a4j">
+
+ <h:form id="form">
+ <a4j:commandLink id="link">
+ <a4j:attachQueue id="attachQueue" />
+ </a4j:commandLink>
+ </h:form>
+
+</ui:composition>
\ No newline at end of file
Added:
root/ui/trunk/components/core/src/test/resources/org/richfaces/view/facelets/html/attachQueueWithWrappingAjax.xhtml
===================================================================
---
root/ui/trunk/components/core/src/test/resources/org/richfaces/view/facelets/html/attachQueueWithWrappingAjax.xhtml
(rev 0)
+++
root/ui/trunk/components/core/src/test/resources/org/richfaces/view/facelets/html/attachQueueWithWrappingAjax.xhtml 2010-05-06
22:42:05 UTC (rev 16912)
@@ -0,0 +1,23 @@
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:a4j="http://richfaces.org/a4j">
+
+
+ <h:form id="form">
+ <a4j:ajax>
+ <h:inputText id="defaultEventInput" />
+ <h:commandLink id="defaultEventLink" />
+
+ <a4j:attachQueue id="defaultEventQueue" />
+ </a4j:ajax>
+
+ <a4j:ajax event="valueChange">
+ <h:inputText id="valueChangeInput" />
+ <h:commandLink id="valueChangeLink" />
+
+ <a4j:attachQueue id="valueChangeQueue" />
+ </a4j:ajax>
+ </h:form>
+</ui:composition>
\ No newline at end of file
Added:
root/ui/trunk/components/core/src/test/resources/org/richfaces/view/facelets/html/attachQueueWithWrappingBehaviors.xhtml
===================================================================
---
root/ui/trunk/components/core/src/test/resources/org/richfaces/view/facelets/html/attachQueueWithWrappingBehaviors.xhtml
(rev 0)
+++
root/ui/trunk/components/core/src/test/resources/org/richfaces/view/facelets/html/attachQueueWithWrappingBehaviors.xhtml 2010-05-06
22:42:05 UTC (rev 16912)
@@ -0,0 +1,22 @@
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:a4j="http://richfaces.org/a4j">
+
+ <h:form id="form">
+ <a4j:ajax event="click">
+ <a4j:attachQueue id="clickQueue" /> (1)
+
+ <h:inputText id="input" />
+ <h:commandButton id="button" /> "click" support applied
there so (1) used
+
+ <a4j:ajax event="valueChange">
+ <a4j:attachQueue id="valueChangeQueue" /> (2)
+
+ <h:inputText id="nestedInput" /> (2) used when
"valueChange" occurs and (1) on click
+ <h:commandButton id="nestedButton" /> "click" support
applied there so also (1) used
+ </a4j:ajax>
+ </a4j:ajax>
+ </h:form>
+</ui:composition>
\ No newline at end of file