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 2013/09/24 14:29:05 UTC
svn commit: r1525868 [1/2] - in /myfaces/core/trunk/impl/src:
main/java/org/apache/myfaces/view/facelets/
main/java/org/apache/myfaces/view/facelets/impl/
main/java/org/apache/myfaces/view/facelets/tag/composite/
main/java/org/apache/myfaces/view/facel...
Author: lu4242
Date: Tue Sep 24 12:29:05 2013
New Revision: 1525868
URL: http://svn.apache.org/r1525868
Log:
MYFACES-3733 Implement vdl.createComponent(...) (review how cc:insertChildren works and the ordering problem)
Added:
myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIAddSimpleCCVDL3.java
- copied, changed from r1525536, myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIAddSimpleCCVDL.java
myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIAddSimpleCCVDL4.java
- copied, changed from r1525536, myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIAddSimpleCCVDL.java
myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIAddSimpleCCVDL5.java
- copied, changed from r1525606, myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIAddSimpleCCVDL2.java
myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIAddSimpleCCVDL6.java
- copied, changed from r1525606, myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIAddSimpleCCVDL2.java
myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingVDLBean3.java
- copied, changed from r1525536, myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingVDLBean1.java
myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingVDLBean4.java
- copied, changed from r1525536, myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingVDLBean1.java
myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingVDLBean5.java
- copied, changed from r1525606, myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingVDLBean2.java
myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingVDLBean6.java
- copied, changed from r1525606, myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingVDLBean2.java
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/addSimpleCCVDL3.xhtml
- copied, changed from r1525536, myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/addSimpleCCVDL.xhtml
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/addSimpleCCVDL4.xhtml
- copied, changed from r1525536, myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/addSimpleCCVDL.xhtml
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/addSimpleCCVDL5.xhtml
- copied, changed from r1525606, myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/addSimpleCCVDL2.xhtml
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/addSimpleCCVDL6.xhtml
- copied, changed from r1525606, myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/addSimpleCCVDL2.xhtml
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBindingVDL_3.xhtml
- copied, changed from r1525606, myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBindingVDL_2.xhtml
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBindingVDL_4.xhtml
- copied, changed from r1525606, myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBindingVDL_2.xhtml
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBindingVDL_5.xhtml
- copied, changed from r1525606, myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBindingVDL_2.xhtml
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBindingVDL_6.xhtml
- copied, changed from r1525606, myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBindingVDL_2.xhtml
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/resources/testComposite/dynComp_3.xhtml
- copied, changed from r1525536, myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/resources/testComposite/dynComp_1.xhtml
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/resources/testComposite/dynComp_4.xhtml
- copied, changed from r1525536, myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/resources/testComposite/dynComp_1.xhtml
Modified:
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletCompositionContext.java
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/impl/DefaultFacelet.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/impl/FaceletCompositionContextImpl.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentResourceTagHandler.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentSupport.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentTagHandlerDelegate.java
myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/AcidMyFacesRequestTestCase.java
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletCompositionContext.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletCompositionContext.java?rev=1525868&r1=1525867&r2=1525868&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletCompositionContext.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletCompositionContext.java Tue Sep 24 12:29:05 2013
@@ -641,4 +641,26 @@ abstract public class FaceletComposition
public void popDynamicComponentSection()
{
}
+
+ /**
+ * Check if the algorithm is applying a dynamic component and the current component
+ * is the top level one. This is necessary to avoid remove/add the component under
+ * a refresh and in that way change the position of the component in the tree. Remember
+ * facelets algorithm removes/add components to sort the components under a refresh, but
+ * in this case, it is up to the user to put the component in the tree, so the idea is
+ * do not make interference with the user's code. Note if the dynamic content is wrapped
+ * by a generated panel, the top level component is the wrapper itself, which has no
+ * attached tag handler.
+ *
+ * @since 2.2
+ * @return
+ */
+ public boolean isDynamicComponentTopLevel()
+ {
+ return false;
+ }
+
+ public void setDynamicComponentTopLevel(boolean value)
+ {
+ }
}
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=1525868&r1=1525867&r2=1525868&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 Tue Sep 24 12:29:05 2013
@@ -2810,9 +2810,6 @@ public class FaceletViewDeclarationLangu
super(viewId);
}
- /**
- * {@inheritDoc}
- */
@Override
public UIViewRoot createMetadataView(FacesContext context)
{
@@ -2899,7 +2896,6 @@ public class FaceletViewDeclarationLangu
{
return null;
}
-
// Create a temporal component base class where all components will be put, but we are only
// interested in the inner UIComponent and if multiple are created, return this one.
UIPanel tempParent
@@ -2924,6 +2920,7 @@ public class FaceletViewDeclarationLangu
// Multiple child. The tempParent will be returned. No need to
// save MARK_CREATED.
createdComponent = tempParent;
+ tempParent.getAttributes().put("oam.vf.DYN_WRAPPER", baseKey);
tempParent.subscribeToEvent(PostRestoreStateEvent.class, new
RefreshDynamicComponentListener(taglibURI, tagName, attributes, baseKey));
}
@@ -2967,6 +2964,7 @@ public class FaceletViewDeclarationLangu
// that content into a component. Requires refresh. No need to
// save MARK_CREATED.
createdComponent = tempParent;
+ tempParent.getAttributes().put("oam.vf.DYN_WRAPPER", baseKey);
createdComponent.subscribeToEvent(PostRestoreStateEvent.class, new
RefreshDynamicComponentListener(taglibURI, tagName, attributes, baseKey));
}
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFacelet.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFacelet.java?rev=1525868&r1=1525867&r2=1525868&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFacelet.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFacelet.java Tue Sep 24 12:29:05 2013
@@ -253,6 +253,13 @@ final class DefaultFacelet extends Abstr
pushDynCompSection = true;
fcctx.pushDynamicComponentSection(baseKey);
}
+ // Disable dynamic component top level if the parent is a
+ // dynamic wrapper, to allow the content to be reorganized properly under
+ // a refresh.
+ if (parent.getAttributes().containsKey("oam.vf.DYN_WRAPPER"))
+ {
+ fcctx.setDynamicComponentTopLevel(false);
+ }
FaceletContext oldCtx = (FaceletContext) facesContext.getAttributes().get(
FaceletContext.FACELET_CONTEXT_KEY);
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/impl/FaceletCompositionContextImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/impl/FaceletCompositionContextImpl.java?rev=1525868&r1=1525867&r2=1525868&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/impl/FaceletCompositionContextImpl.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/impl/FaceletCompositionContextImpl.java Tue Sep 24 12:29:05 2013
@@ -151,6 +151,7 @@ public class FaceletCompositionContextIm
private boolean _dynamicComponentHandler;
private boolean _oldRefreshingTransientBuild;
+ private boolean _dynamicComponentTopLevel;
public FaceletCompositionContextImpl(FaceletFactory factory, FacesContext facesContext)
{
@@ -207,6 +208,7 @@ public class FaceletCompositionContextIm
_sectionUniqueComponentIdCounter = new SectionUniqueIdCounter("_"+ base +"_");
_sectionUniqueNormalIdCounter = _sectionUniqueIdCounter;
_sectionUniqueComponentNormalIdCounter = _sectionUniqueComponentIdCounter;
+ _dynamicComponentTopLevel = true;
}
@@ -1133,6 +1135,7 @@ public class FaceletCompositionContextIm
_sectionUniqueComponentIdCounter = new SectionUniqueIdCounter("_"+ base +"_");
_sectionUniqueNormalIdCounter = _sectionUniqueIdCounter;
_sectionUniqueComponentNormalIdCounter = _sectionUniqueComponentIdCounter;
+ _dynamicComponentTopLevel = true;
}
@Override
@@ -1151,8 +1154,18 @@ public class FaceletCompositionContextIm
_sectionUniqueNormalIdCounter = _sectionUniqueIdCounter;
_sectionUniqueComponentNormalIdCounter = _sectionUniqueComponentIdCounter;
+ _dynamicComponentTopLevel = false;
}
+ public boolean isDynamicComponentTopLevel()
+ {
+ return _dynamicComponentTopLevel;
+ }
+
+ public void setDynamicComponentTopLevel(boolean value)
+ {
+ _dynamicComponentTopLevel = value;
+ }
private static class KeyEntryIterator<K, V> implements Iterator<K>
{
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentResourceTagHandler.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentResourceTagHandler.java?rev=1525868&r1=1525867&r2=1525868&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentResourceTagHandler.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentResourceTagHandler.java Tue Sep 24 12:29:05 2013
@@ -561,6 +561,8 @@ public class CompositeComponentResourceT
{
if (innerCompositeComponent.getChildCount() > 0)
{
+ String facetName = (String) parent.getAttributes().get(
+ org.apache.myfaces.view.facelets.tag.jsf.core.FacetHandler.KEY);
// Insert children
List<UIComponent> children = new ArrayList<UIComponent>(
innerCompositeComponent.getChildCount());
@@ -570,12 +572,95 @@ public class CompositeComponentResourceT
}
while (children.size() > 0)
{
- parent.getChildren().add(children.remove(0));
+ UIComponent child = children.remove(0);
+ child.getAttributes().put(InsertChildrenHandler.INSERT_CHILDREN_USED,
+ Boolean.TRUE);
+ if (facetName != null)
+ {
+ ComponentSupport.addFacet(ctx, parent, child, facetName);
+ }
+ else
+ {
+ parent.getChildren().add(child);
+ }
}
}
return true;
}
}
+ else if (step != null && step.intValue() > 1)
+ {
+ // refresh case, in facet case it is not necessary to remove/add the facet, because there
+ // is no relative order (it is always on the same spot).
+ if (name == null)
+ {
+ String facetName = (String) parent.getAttributes().get(
+ org.apache.myfaces.view.facelets.tag.jsf.core.FacetHandler.KEY);
+ // refresh case, remember the inserted children does not have any
+ // associated tag handler, so in this case we just need to remove and add them in the same order
+ // we found them
+ List<UIComponent> children = null;
+ if (facetName == null)
+ {
+ children = new ArrayList<UIComponent>(parent.getChildCount());
+ int i = 0;
+ while (parent.getChildCount()-i > 0)
+ {
+ UIComponent child = parent.getChildren().get(i);
+ if (Boolean.TRUE.equals(child.getAttributes().get(
+ InsertChildrenHandler.INSERT_CHILDREN_USED)))
+ {
+ children.add(parent.getChildren().remove(i));
+ }
+ else
+ {
+ i++;
+ }
+ }
+ }
+ else
+ {
+ children = new ArrayList<UIComponent>();
+ UIComponent child = parent.getFacet(facetName);
+ if (Boolean.TRUE.equals(child.getAttributes().get(
+ InsertChildrenHandler.INSERT_CHILDREN_USED)))
+ {
+ parent.getFacets().remove(facetName);
+ children.add(child);
+ }
+ else
+ {
+ UIComponent parentToApply = child;
+ int i = 0;
+ while (parentToApply.getChildCount()-i > 0)
+ {
+ child = parentToApply.getChildren().get(i);
+ if (Boolean.TRUE.equals(child.getAttributes().get(
+ InsertChildrenHandler.INSERT_CHILDREN_USED)))
+ {
+ children.add(parentToApply.getChildren().remove(i));
+ }
+ else
+ {
+ i++;
+ }
+ }
+ }
+ }
+ while (children.size() > 0)
+ {
+ UIComponent child = children.remove(0);
+ if (facetName != null)
+ {
+ ComponentSupport.addFacet(ctx, parent, child, facetName);
+ }
+ else
+ {
+ parent.getChildren().add(child);
+ }
+ }
+ }
+ }
return true;
}
if (name != null)
@@ -722,5 +807,4 @@ public class CompositeComponentResourceT
}
}
}
-
}
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentSupport.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentSupport.java?rev=1525868&r1=1525867&r2=1525868&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentSupport.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentSupport.java Tue Sep 24 12:29:05 2013
@@ -255,7 +255,6 @@ public final class ComponentSupport
return facet;
}
}
- return facet;
}
return null;
}
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentTagHandlerDelegate.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentTagHandlerDelegate.java?rev=1525868&r1=1525867&r2=1525868&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentTagHandlerDelegate.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentTagHandlerDelegate.java Tue Sep 24 12:29:05 2013
@@ -313,12 +313,22 @@ public class ComponentTagHandlerDelegate
{
mctx.pushUniqueIdVendorToStack((UniqueIdVendor)c);
}
- // first allow c to get populated
- _delegate.applyNextHandler(ctx, c);
-
+
+ if (mctx.isDynamicComponentTopLevel())
+ {
+ mctx.setDynamicComponentTopLevel(false);
+ _delegate.applyNextHandler(ctx, c);
+ mctx.setDynamicComponentTopLevel(true);
+ }
+ else
+ {
+ // first allow c to get populated
+ _delegate.applyNextHandler(ctx, c);
+ }
+
boolean oldProcessingEvents = facesContext.isProcessingEvents();
// finish cleaning up orphaned children
- if (componentFound)
+ if (componentFound && !mctx.isDynamicComponentTopLevel())
{
mctx.finalizeForDeletion(c);
@@ -376,23 +386,26 @@ public class ComponentTagHandlerDelegate
_delegate.onComponentPopulated(ctx, c, oldParent);
- if (componentFound && mctx.isRefreshingSection())
- {
- facesContext.setProcessingEvents(false);
- ComponentSupport.setCachedFacesContext(c, facesContext);
- }
- if (facetName == null)
- {
- parent.getChildren().add(c);
- }
- else
- {
- ComponentSupport.addFacet(ctx, parent, c, facetName);
- }
- if (componentFound && mctx.isRefreshingSection())
+ if (!mctx.isDynamicComponentTopLevel() || !componentFound)
{
- ComponentSupport.setCachedFacesContext(c, null);
- facesContext.setProcessingEvents(oldProcessingEvents);
+ if (componentFound && mctx.isRefreshingSection())
+ {
+ facesContext.setProcessingEvents(false);
+ ComponentSupport.setCachedFacesContext(c, facesContext);
+ }
+ if (facetName == null)
+ {
+ parent.getChildren().add(c);
+ }
+ else
+ {
+ ComponentSupport.addFacet(ctx, parent, c, facetName);
+ }
+ if (componentFound && mctx.isRefreshingSection())
+ {
+ ComponentSupport.setCachedFacesContext(c, null);
+ facesContext.setProcessingEvents(oldProcessingEvents);
+ }
}
if (c instanceof UniqueIdVendor)
Modified: myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/AcidMyFacesRequestTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/AcidMyFacesRequestTestCase.java?rev=1525868&r1=1525867&r2=1525868&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/AcidMyFacesRequestTestCase.java (original)
+++ myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/AcidMyFacesRequestTestCase.java Tue Sep 24 12:29:05 2013
@@ -26,13 +26,12 @@ import javax.faces.component.UIInput;
import javax.faces.component.UIPanel;
import javax.faces.component.html.HtmlDataTable;
-import junit.framework.Assert;
-
import org.apache.myfaces.mc.test.core.AbstractMyFacesRequestTestCase;
import org.apache.myfaces.shared.config.MyfacesConfig;
import org.apache.myfaces.test.mock.MockPrintWriter;
import org.apache.myfaces.view.facelets.pss.acid.managed.CheckActionEventBean;
import org.apache.myfaces.view.facelets.pss.acid.managed.ResourceDependencyBean;
+import org.junit.Assert;
import org.junit.Test;
public class AcidMyFacesRequestTestCase extends AbstractMyFacesRequestTestCase
@@ -784,6 +783,219 @@ public class AcidMyFacesRequestTestCase
}
@Test
+ public void testAddSimpleCCVDL3() throws Exception
+ {
+ setupRequest("/addSimpleCCVDL3.xhtml");
+ processLifecycleExecuteAndRender();
+
+ UIComponent comp = facesContext.getViewRoot().findComponent("mainForm:component");
+ Assert.assertEquals(1, comp.getChildCount());
+ UIComponent wrapper = comp.getChildren().get(0);
+ Assert.assertNotNull(wrapper);
+ Assert.assertTrue(UIComponent.isCompositeComponent(wrapper));
+ UIComponent ccContent = wrapper.getFacet(UIComponent.COMPOSITE_FACET_NAME);
+ Assert.assertNotNull(ccContent);
+ Assert.assertEquals(3, ccContent.getChildCount());
+ //Assert.assertEquals("Dynamically added header",
+ // ccContent.getChildren().get(0).getFacet("header").getAttributes().get("value"));
+ Assert.assertEquals("Dynamically added child", ccContent.getChildren().get(2).getAttributes().get("value"));
+ MockPrintWriter writer1 = (MockPrintWriter) response.getWriter();
+ String content1 = new String(writer1.content());
+ Assert.assertTrue(content1.contains("Dynamically added markup"));
+ int indexDynHeader1_1 = content1.indexOf("Start Dynamic Header");
+ int indexDynHeader1_2 = content1.indexOf("Dynamically added header", indexDynHeader1_1);
+ int indexDynHeader1_3 = content1.indexOf("End Dynamic Header", indexDynHeader1_2);
+ Assert.assertNotSame(-1, indexDynHeader1_1);
+ Assert.assertNotSame(-1, indexDynHeader1_2);
+ Assert.assertNotSame(-1, indexDynHeader1_3);
+
+ UICommand button = (UICommand) facesContext.getViewRoot().findComponent("mainForm:postback");
+ submit(button);
+ processLifecycleExecuteAndRender();
+
+ comp = facesContext.getViewRoot().findComponent("mainForm:component");
+ Assert.assertEquals(1, comp.getChildCount());
+ wrapper = comp.getChildren().get(0);
+ Assert.assertNotNull(wrapper);
+ Assert.assertTrue(UIComponent.isCompositeComponent(wrapper));
+ ccContent = wrapper.getFacet(UIComponent.COMPOSITE_FACET_NAME);
+ Assert.assertNotNull(ccContent);
+ Assert.assertEquals(3, ccContent.getChildCount());
+ //Assert.assertEquals("Dynamically added header",
+ // ccContent.getChildren().get(0).getFacet("header").getAttributes().get("value"));
+ Assert.assertEquals("Dynamically added child", ccContent.getChildren().get(2).getAttributes().get("value"));
+ MockPrintWriter writer2 = (MockPrintWriter) response.getWriter();
+ String content2 = new String(writer2.content());
+ Assert.assertTrue(content2.contains("Dynamically added markup"));
+ int indexDynHeader1 = content2.indexOf("Start Dynamic Header");
+ int indexDynHeader2 = content2.indexOf("Dynamically added header", indexDynHeader1);
+ int indexDynHeader3 = content2.indexOf("End Dynamic Header", indexDynHeader2);
+ Assert.assertNotSame(-1, indexDynHeader1);
+ Assert.assertNotSame(-1, indexDynHeader2);
+ Assert.assertNotSame(-1, indexDynHeader3);
+
+ tearDownRequest();
+ }
+
+ @Test
+ public void testAddSimpleCCVDL4() throws Exception
+ {
+ setupRequest("/addSimpleCCVDL4.xhtml");
+ processLifecycleExecuteAndRender();
+
+ UIComponent comp = facesContext.getViewRoot().findComponent("mainForm:component");
+ Assert.assertEquals(1, comp.getChildCount());
+ UIComponent wrapper = comp.getChildren().get(0);
+ Assert.assertNotNull(wrapper);
+ Assert.assertTrue(UIComponent.isCompositeComponent(wrapper));
+ UIComponent ccContent = wrapper.getFacet(UIComponent.COMPOSITE_FACET_NAME);
+ Assert.assertNotNull(ccContent);
+ Assert.assertEquals(3, ccContent.getChildCount());
+ //Assert.assertEquals("Dynamically added header",
+ // ccContent.getChildren().get(0).getFacet("header").getAttributes().get("value"));
+ Assert.assertEquals("Dynamically added child", ccContent.getChildren().get(2).getAttributes().get("value"));
+ MockPrintWriter writer1 = (MockPrintWriter) response.getWriter();
+ String content1 = new String(writer1.content());
+ Assert.assertTrue(content1.contains("Dynamically added markup"));
+ int indexDynHeader1_1 = content1.indexOf("Start Dynamic Header");
+ int indexDynHeader1_2 = content1.indexOf("Dynamically added header", indexDynHeader1_1);
+ int indexDynHeader1_3 = content1.indexOf("End Dynamic Header", indexDynHeader1_2);
+ Assert.assertNotSame(-1, indexDynHeader1_1);
+ Assert.assertNotSame(-1, indexDynHeader1_2);
+ Assert.assertNotSame(-1, indexDynHeader1_3);
+
+ UICommand button = (UICommand) facesContext.getViewRoot().findComponent("mainForm:postback");
+ submit(button);
+ processLifecycleExecuteAndRender();
+
+ comp = facesContext.getViewRoot().findComponent("mainForm:component");
+ Assert.assertEquals(1, comp.getChildCount());
+ wrapper = comp.getChildren().get(0);
+ Assert.assertNotNull(wrapper);
+ Assert.assertTrue(UIComponent.isCompositeComponent(wrapper));
+ ccContent = wrapper.getFacet(UIComponent.COMPOSITE_FACET_NAME);
+ Assert.assertNotNull(ccContent);
+ Assert.assertEquals(3, ccContent.getChildCount());
+ //Assert.assertEquals("Dynamically added header",
+ // ccContent.getChildren().get(0).getFacet("header").getAttributes().get("value"));
+ Assert.assertEquals("Dynamically added child", ccContent.getChildren().get(2).getAttributes().get("value"));
+ MockPrintWriter writer2 = (MockPrintWriter) response.getWriter();
+ String content2 = new String(writer2.content());
+ Assert.assertTrue(content2.contains("Dynamically added markup"));
+ int indexDynHeader1 = content2.indexOf("Start Dynamic Header");
+ int indexDynHeader2 = content2.indexOf("Dynamically added header", indexDynHeader1);
+ int indexDynHeader3 = content2.indexOf("End Dynamic Header", indexDynHeader2);
+ Assert.assertNotSame(-1, indexDynHeader1);
+ Assert.assertNotSame(-1, indexDynHeader2);
+ Assert.assertNotSame(-1, indexDynHeader3);
+
+ tearDownRequest();
+ }
+
+ @Test
+ public void testAddSimpleCCVDL5() throws Exception
+ {
+ setupRequest("/addSimpleCCVDL5.xhtml");
+ processLifecycleExecuteAndRender();
+
+ UIComponent comp = facesContext.getViewRoot().findComponent("mainForm:component");
+ Assert.assertEquals(1, comp.getChildCount());
+ UIComponent wrapper = comp.getChildren().get(0);
+ Assert.assertNotNull(wrapper);
+ Assert.assertTrue(UIComponent.isCompositeComponent(wrapper));
+ UIComponent ccContent = wrapper.getFacet(UIComponent.COMPOSITE_FACET_NAME);
+ Assert.assertNotNull(ccContent);
+ Assert.assertEquals(3, ccContent.getChildCount());
+ Assert.assertEquals("Dynamically added child", ccContent.getChildren().get(2).getAttributes().get("value"));
+ MockPrintWriter writer1 = (MockPrintWriter) response.getWriter();
+ String content1 = new String(writer1.content());
+ Assert.assertTrue(content1.contains("Dynamically added markup"));
+ int indexDynHeader1_1 = content1.indexOf("Start Dynamic Header");
+ int indexDynHeader1_2 = content1.indexOf("Dynamically added header", indexDynHeader1_1);
+ int indexDynHeader1_3 = content1.indexOf("End Dynamic Header", indexDynHeader1_2);
+ Assert.assertNotSame(-1, indexDynHeader1_1);
+ Assert.assertNotSame(-1, indexDynHeader1_2);
+ Assert.assertNotSame(-1, indexDynHeader1_3);
+
+ UICommand button = (UICommand) facesContext.getViewRoot().findComponent("mainForm:postback");
+ submit(button);
+ processLifecycleExecuteAndRender();
+
+ comp = facesContext.getViewRoot().findComponent("mainForm:component");
+ Assert.assertEquals(1, comp.getChildCount());
+ wrapper = comp.getChildren().get(0);
+ Assert.assertNotNull(wrapper);
+ Assert.assertTrue(UIComponent.isCompositeComponent(wrapper));
+ ccContent = wrapper.getFacet(UIComponent.COMPOSITE_FACET_NAME);
+ Assert.assertNotNull(ccContent);
+ Assert.assertEquals(3, ccContent.getChildCount());
+ Assert.assertEquals("Dynamically added child", ccContent.getChildren().get(2).getAttributes().get("value"));
+ MockPrintWriter writer2 = (MockPrintWriter) response.getWriter();
+ String content2 = new String(writer2.content());
+ Assert.assertTrue(content2.contains("Dynamically added markup"));
+ int indexDynHeader2_1 = content2.indexOf("Start Dynamic Header");
+ int indexDynHeader2_2 = content2.indexOf("Dynamically added header", indexDynHeader2_1);
+ int indexDynHeader2_3 = content2.indexOf("End Dynamic Header", indexDynHeader2_2);
+ Assert.assertNotSame(-1, indexDynHeader2_1);
+ Assert.assertNotSame(-1, indexDynHeader2_2);
+ Assert.assertNotSame(-1, indexDynHeader2_3);
+
+
+ tearDownRequest();
+ }
+
+ @Test
+ public void testAddSimpleCCVDL6() throws Exception
+ {
+ setupRequest("/addSimpleCCVDL6.xhtml");
+ processLifecycleExecuteAndRender();
+
+ UIComponent comp = facesContext.getViewRoot().findComponent("mainForm:component");
+ Assert.assertEquals(1, comp.getChildCount());
+ UIComponent wrapper = comp.getChildren().get(0);
+ Assert.assertNotNull(wrapper);
+ Assert.assertTrue(UIComponent.isCompositeComponent(wrapper));
+ UIComponent ccContent = wrapper.getFacet(UIComponent.COMPOSITE_FACET_NAME);
+ Assert.assertNotNull(ccContent);
+ Assert.assertEquals(3, ccContent.getChildCount());
+ Assert.assertEquals("Dynamically added child", ccContent.getChildren().get(2).getAttributes().get("value"));
+ MockPrintWriter writer1 = (MockPrintWriter) response.getWriter();
+ String content1 = new String(writer1.content());
+ Assert.assertTrue(content1.contains("Dynamically added markup"));
+ int indexDynHeader1_1 = content1.indexOf("Start Dynamic Header");
+ int indexDynHeader1_2 = content1.indexOf("Dynamically added header", indexDynHeader1_1);
+ int indexDynHeader1_3 = content1.indexOf("End Dynamic Header", indexDynHeader1_2);
+ Assert.assertNotSame(-1, indexDynHeader1_1);
+ Assert.assertNotSame(-1, indexDynHeader1_2);
+ Assert.assertNotSame(-1, indexDynHeader1_3);
+
+ UICommand button = (UICommand) facesContext.getViewRoot().findComponent("mainForm:postback");
+ submit(button);
+ processLifecycleExecuteAndRender();
+
+ comp = facesContext.getViewRoot().findComponent("mainForm:component");
+ Assert.assertEquals(1, comp.getChildCount());
+ wrapper = comp.getChildren().get(0);
+ Assert.assertNotNull(wrapper);
+ Assert.assertTrue(UIComponent.isCompositeComponent(wrapper));
+ ccContent = wrapper.getFacet(UIComponent.COMPOSITE_FACET_NAME);
+ Assert.assertNotNull(ccContent);
+ Assert.assertEquals(3, ccContent.getChildCount());
+ Assert.assertEquals("Dynamically added child", ccContent.getChildren().get(2).getAttributes().get("value"));
+ MockPrintWriter writer2 = (MockPrintWriter) response.getWriter();
+ String content2 = new String(writer2.content());
+ Assert.assertTrue(content2.contains("Dynamically added markup"));
+ int indexDynHeader2_1 = content2.indexOf("Start Dynamic Header");
+ int indexDynHeader2_2 = content2.indexOf("Dynamically added header", indexDynHeader2_1);
+ int indexDynHeader2_3 = content2.indexOf("End Dynamic Header", indexDynHeader2_2);
+ Assert.assertNotSame(-1, indexDynHeader2_1);
+ Assert.assertNotSame(-1, indexDynHeader2_2);
+ Assert.assertNotSame(-1, indexDynHeader2_3);
+
+ tearDownRequest();
+ }
+
+ @Test
public void testComponentBindingVDL_1() throws Exception
{
setupRequest("/componentBindingVDL_1.xhtml");
@@ -948,4 +1160,402 @@ public class AcidMyFacesRequestTestCase
tearDownRequest();
}
+
+ @Test
+ public void testComponentBindingVDL_3() throws Exception
+ {
+ setupRequest("/componentBindingVDL_3.xhtml");
+ processLifecycleExecuteAndRender();
+
+ UIComponent comp = facesContext.getViewRoot().findComponent("mainForm:panel");
+ Assert.assertNotNull(comp);
+ Assert.assertEquals(2, comp.getChildCount());
+
+ UIComponent wrapper = comp.getChildren().get(1);
+ Assert.assertNotNull(wrapper);
+ Assert.assertTrue(UIComponent.isCompositeComponent(wrapper));
+ UIComponent ccContent = wrapper.getFacet(UIComponent.COMPOSITE_FACET_NAME);
+ Assert.assertNotNull(ccContent);
+ Assert.assertEquals(3, ccContent.getChildCount());
+ //Assert.assertEquals("Dynamically added header",
+ // ccContent.getChildren().get(0).getFacet("header").getAttributes().get("value"));
+ Assert.assertEquals("Dynamically added child", ccContent.getChildren().get(2).getAttributes().get("value"));
+ MockPrintWriter writer1 = (MockPrintWriter) response.getWriter();
+ String content1 = new String(writer1.content());
+ Assert.assertTrue(content1.contains("Dynamically added markup"));
+ int indexDynHeader1_1 = content1.indexOf("Start Dynamic Header");
+ int indexDynHeader1_2 = content1.indexOf("Dynamically added header", indexDynHeader1_1);
+ int indexDynHeader1_3 = content1.indexOf("End Dynamic Header", indexDynHeader1_2);
+ Assert.assertNotSame(-1, indexDynHeader1_1);
+ Assert.assertNotSame(-1, indexDynHeader1_2);
+ Assert.assertNotSame(-1, indexDynHeader1_3);
+
+ UICommand button = (UICommand) facesContext.getViewRoot().findComponent("mainForm:postback");
+ submit(button);
+ processLifecycleExecuteAndRender();
+ Assert.assertNotNull(comp);
+ Assert.assertEquals(2, comp.getChildCount());
+
+ comp = facesContext.getViewRoot().findComponent("mainForm:panel");
+
+ Assert.assertEquals("value1", comp.getAttributes().get("attr1"));
+ Assert.assertEquals("value2", comp.getChildren().get(0).getAttributes().get("attr2"));
+
+ wrapper = comp.getChildren().get(1);
+ Assert.assertNotNull(wrapper);
+ Assert.assertTrue(UIComponent.isCompositeComponent(wrapper));
+ ccContent = wrapper.getFacet(UIComponent.COMPOSITE_FACET_NAME);
+ Assert.assertNotNull(ccContent);
+ Assert.assertEquals(3, ccContent.getChildCount());
+ //Assert.assertEquals("Dynamically added header",
+ // ccContent.getChildren().get(0).getFacet("header").getAttributes().get("value"));
+ Assert.assertEquals("Dynamically added child", ccContent.getChildren().get(2).getAttributes().get("value"));
+ MockPrintWriter writer2 = (MockPrintWriter) response.getWriter();
+ String content2 = new String(writer2.content());
+ Assert.assertTrue(content2.contains("Dynamically added markup"));
+ int indexDynHeader2_1 = content2.indexOf("Start Dynamic Header");
+ int indexDynHeader2_2 = content2.indexOf("Dynamically added header", indexDynHeader2_1);
+ int indexDynHeader2_3 = content2.indexOf("End Dynamic Header", indexDynHeader2_2);
+ Assert.assertNotSame(-1, indexDynHeader2_1);
+ Assert.assertNotSame(-1, indexDynHeader2_2);
+ Assert.assertNotSame(-1, indexDynHeader2_3);
+
+ button = (UICommand) facesContext.getViewRoot().findComponent("mainForm:postback");
+ submit(button);
+ processLifecycleExecuteAndRender();
+ Assert.assertNotNull(comp);
+ Assert.assertEquals(2, comp.getChildCount());
+
+ comp = facesContext.getViewRoot().findComponent("mainForm:panel");
+
+ Assert.assertEquals("value1", comp.getAttributes().get("attr1"));
+ Assert.assertEquals("value2", comp.getChildren().get(0).getAttributes().get("attr2"));
+
+ wrapper = comp.getChildren().get(1);
+ Assert.assertNotNull(wrapper);
+ Assert.assertTrue(UIComponent.isCompositeComponent(wrapper));
+ ccContent = wrapper.getFacet(UIComponent.COMPOSITE_FACET_NAME);
+ Assert.assertNotNull(ccContent);
+ Assert.assertEquals(3, ccContent.getChildCount());
+ //Assert.assertEquals("Dynamically added header",
+ // ccContent.getChildren().get(0).getFacet("header").getAttributes().get("value"));
+ Assert.assertEquals("Dynamically added child", ccContent.getChildren().get(2).getAttributes().get("value"));
+ MockPrintWriter writer3 = (MockPrintWriter) response.getWriter();
+ String content3 = new String(writer3.content());
+ Assert.assertTrue(content3.contains("Dynamically added markup"));
+ int indexDynHeader3_1 = content3.indexOf("Start Dynamic Header");
+ int indexDynHeader3_2 = content3.indexOf("Dynamically added header", indexDynHeader3_1);
+ int indexDynHeader3_3 = content3.indexOf("End Dynamic Header", indexDynHeader3_2);
+ Assert.assertNotSame(-1, indexDynHeader3_1);
+ Assert.assertNotSame(-1, indexDynHeader3_2);
+ Assert.assertNotSame(-1, indexDynHeader3_3);
+
+ tearDownRequest();
+ }
+
+ @Test
+ public void testComponentBindingVDL_4() throws Exception
+ {
+ setupRequest("/componentBindingVDL_4.xhtml");
+ processLifecycleExecuteAndRender();
+
+ UIComponent comp = facesContext.getViewRoot().findComponent("mainForm:panel");
+ Assert.assertNotNull(comp);
+ Assert.assertEquals(2, comp.getChildCount());
+
+ UIComponent wrapper = comp.getChildren().get(1);
+ Assert.assertNotNull(wrapper);
+ Assert.assertTrue(UIComponent.isCompositeComponent(wrapper));
+ UIComponent ccContent = wrapper.getFacet(UIComponent.COMPOSITE_FACET_NAME);
+ Assert.assertNotNull(ccContent);
+ Assert.assertEquals(3, ccContent.getChildCount());
+ //Assert.assertEquals("Dynamically added header",
+ // ccContent.getChildren().get(0).getFacet("header").getAttributes().get("value"));
+ Assert.assertEquals("Dynamically added child", ccContent.getChildren().get(2).getAttributes().get("value"));
+ MockPrintWriter writer1 = (MockPrintWriter) response.getWriter();
+ String content1 = new String(writer1.content());
+ Assert.assertTrue(content1.contains("Dynamically added markup"));
+ int indexDynHeader1_1 = content1.indexOf("Start Dynamic Header");
+ int indexDynHeader1_2 = content1.indexOf("Dynamically added header", indexDynHeader1_1);
+ int indexDynHeader1_3 = content1.indexOf("End Dynamic Header", indexDynHeader1_2);
+ Assert.assertNotSame(-1, indexDynHeader1_1);
+ Assert.assertNotSame(-1, indexDynHeader1_2);
+ Assert.assertNotSame(-1, indexDynHeader1_3);
+
+ UICommand button = (UICommand) facesContext.getViewRoot().findComponent("mainForm:postback");
+ submit(button);
+ processLifecycleExecuteAndRender();
+ Assert.assertNotNull(comp);
+ Assert.assertEquals(2, comp.getChildCount());
+
+ comp = facesContext.getViewRoot().findComponent("mainForm:panel");
+
+ Assert.assertEquals("value1", comp.getAttributes().get("attr1"));
+ Assert.assertEquals("value2", comp.getChildren().get(0).getAttributes().get("attr2"));
+
+ wrapper = comp.getChildren().get(1);
+ Assert.assertNotNull(wrapper);
+ Assert.assertTrue(UIComponent.isCompositeComponent(wrapper));
+ ccContent = wrapper.getFacet(UIComponent.COMPOSITE_FACET_NAME);
+ Assert.assertNotNull(ccContent);
+ Assert.assertEquals(3, ccContent.getChildCount());
+ //Assert.assertEquals("Dynamically added header",
+ // ccContent.getChildren().get(0).getFacet("header").getAttributes().get("value"));
+ Assert.assertEquals("Dynamically added child", ccContent.getChildren().get(2).getAttributes().get("value"));
+ MockPrintWriter writer2 = (MockPrintWriter) response.getWriter();
+ String content2 = new String(writer2.content());
+ Assert.assertTrue(content2.contains("Dynamically added markup"));
+ int indexDynHeader2_1 = content2.indexOf("Start Dynamic Header");
+ int indexDynHeader2_2 = content2.indexOf("Dynamically added header", indexDynHeader2_1);
+ int indexDynHeader2_3 = content2.indexOf("End Dynamic Header", indexDynHeader2_2);
+ Assert.assertNotSame(-1, indexDynHeader2_1);
+ Assert.assertNotSame(-1, indexDynHeader2_2);
+ Assert.assertNotSame(-1, indexDynHeader2_3);
+
+ button = (UICommand) facesContext.getViewRoot().findComponent("mainForm:postback");
+ submit(button);
+ processLifecycleExecuteAndRender();
+ Assert.assertNotNull(comp);
+ Assert.assertEquals(2, comp.getChildCount());
+
+ comp = facesContext.getViewRoot().findComponent("mainForm:panel");
+
+ Assert.assertEquals("value1", comp.getAttributes().get("attr1"));
+ Assert.assertEquals("value2", comp.getChildren().get(0).getAttributes().get("attr2"));
+
+ wrapper = comp.getChildren().get(1);
+ Assert.assertNotNull(wrapper);
+ Assert.assertTrue(UIComponent.isCompositeComponent(wrapper));
+ ccContent = wrapper.getFacet(UIComponent.COMPOSITE_FACET_NAME);
+ Assert.assertNotNull(ccContent);
+ Assert.assertEquals(3, ccContent.getChildCount());
+ //Assert.assertEquals("Dynamically added header",
+ // ccContent.getChildren().get(0).getFacet("header").getAttributes().get("value"));
+ Assert.assertEquals("Dynamically added child", ccContent.getChildren().get(2).getAttributes().get("value"));
+ MockPrintWriter writer3 = (MockPrintWriter) response.getWriter();
+ String content3 = new String(writer3.content());
+ Assert.assertTrue(content3.contains("Dynamically added markup"));
+ int indexDynHeader3_1 = content3.indexOf("Start Dynamic Header");
+ int indexDynHeader3_2 = content3.indexOf("Dynamically added header", indexDynHeader3_1);
+ int indexDynHeader3_3 = content3.indexOf("End Dynamic Header", indexDynHeader3_2);
+ Assert.assertNotSame(-1, indexDynHeader3_1);
+ Assert.assertNotSame(-1, indexDynHeader3_2);
+ Assert.assertNotSame(-1, indexDynHeader3_3);
+
+ tearDownRequest();
+ }
+
+ @Test
+ public void testComponentBindingVDL_5() throws Exception
+ {
+ setupRequest("/componentBindingVDL_5.xhtml");
+ processLifecycleExecuteAndRender();
+
+ UIComponent comp = facesContext.getViewRoot().findComponent("mainForm:panel");
+ Assert.assertNotNull(comp);
+ Assert.assertEquals(2, comp.getChildCount());
+
+ UIComponent wrapper = comp.getChildren().get(1);
+ Assert.assertNotNull(wrapper);
+ Assert.assertTrue(UIComponent.isCompositeComponent(wrapper));
+ UIComponent ccContent = wrapper.getFacet(UIComponent.COMPOSITE_FACET_NAME);
+ Assert.assertNotNull(ccContent);
+ Assert.assertEquals(3, ccContent.getChildCount());
+ Assert.assertEquals("Dynamically added child", ccContent.getChildren().get(2).getAttributes().get("value"));
+ MockPrintWriter writer1 = (MockPrintWriter) response.getWriter();
+ String content1 = new String(writer1.content());
+ Assert.assertTrue(content1.contains("Dynamically added markup"));
+ int indexDynHeader1_1 = content1.indexOf("Start Dynamic Header");
+ int indexDynHeader1_2 = content1.indexOf("Dynamically added header", indexDynHeader1_1);
+ int indexDynHeader1_3 = content1.indexOf("End Dynamic Header", indexDynHeader1_2);
+ Assert.assertNotSame(-1, indexDynHeader1_1);
+ Assert.assertNotSame(-1, indexDynHeader1_2);
+ Assert.assertNotSame(-1, indexDynHeader1_3);
+
+ UIComponent ccpanel = facesContext.getViewRoot().findComponent("mainForm:ccpanel");
+ Assert.assertNotNull(ccpanel);
+ UIComponent ccinnerpanel = facesContext.getViewRoot().findComponent("mainForm:ccpanel:component");
+ Assert.assertNotNull(ccinnerpanel);
+ UICommand button = (UICommand) facesContext.getViewRoot().findComponent("mainForm:ccpanel:component:increment");
+ Assert.assertNotNull(button);
+
+ CheckActionEventBean checkBean = facesContext.getApplication().evaluateExpressionGet(facesContext,
+ "#{checkActionEventBean}", CheckActionEventBean.class);
+ int oldcount1 = checkBean.getActionListenerCount();
+
+ submit(button);
+ processLifecycleExecute();
+
+ Assert.assertEquals("event not called", oldcount1+1, checkBean.getActionListenerCount());
+ processRender();
+
+ Assert.assertNotNull(comp);
+ Assert.assertEquals(2, comp.getChildCount());
+
+ comp = facesContext.getViewRoot().findComponent("mainForm:panel");
+
+ Assert.assertEquals("value1", comp.getAttributes().get("attr1"));
+ Assert.assertEquals("value2", comp.getChildren().get(0).getAttributes().get("attr2"));
+
+ wrapper = comp.getChildren().get(1);
+ Assert.assertNotNull(wrapper);
+ Assert.assertTrue(UIComponent.isCompositeComponent(wrapper));
+ ccContent = wrapper.getFacet(UIComponent.COMPOSITE_FACET_NAME);
+ Assert.assertNotNull(ccContent);
+ Assert.assertEquals(3, ccContent.getChildCount());
+ Assert.assertEquals("Dynamically added child", ccContent.getChildren().get(2).getAttributes().get("value"));
+ MockPrintWriter writer2 = (MockPrintWriter) response.getWriter();
+ String content2 = new String(writer2.content());
+ Assert.assertTrue(content2.contains("Dynamically added markup"));
+ int indexDynHeader2_1 = content2.indexOf("Start Dynamic Header");
+ int indexDynHeader2_2 = content2.indexOf("Dynamically added header", indexDynHeader2_1);
+ int indexDynHeader2_3 = content2.indexOf("End Dynamic Header", indexDynHeader2_2);
+ Assert.assertNotSame(-1, indexDynHeader2_1);
+ Assert.assertNotSame(-1, indexDynHeader2_2);
+ Assert.assertNotSame(-1, indexDynHeader2_3);
+
+ button = (UICommand) facesContext.getViewRoot().findComponent("mainForm:ccpanel:component:increment");
+ Assert.assertNotNull(button);
+ int oldcount2 = checkBean.getActionListenerCount();
+
+ submit(button);
+ processLifecycleExecute();
+
+ Assert.assertEquals("event not called", oldcount2+1, checkBean.getActionListenerCount());
+
+ processRender();
+ Assert.assertNotNull(comp);
+ Assert.assertEquals(2, comp.getChildCount());
+
+ comp = facesContext.getViewRoot().findComponent("mainForm:panel");
+
+ Assert.assertEquals("value1", comp.getAttributes().get("attr1"));
+ Assert.assertEquals("value2", comp.getChildren().get(0).getAttributes().get("attr2"));
+
+ wrapper = comp.getChildren().get(1);
+ Assert.assertNotNull(wrapper);
+ Assert.assertTrue(UIComponent.isCompositeComponent(wrapper));
+ ccContent = wrapper.getFacet(UIComponent.COMPOSITE_FACET_NAME);
+ Assert.assertNotNull(ccContent);
+ Assert.assertEquals(3, ccContent.getChildCount());
+ Assert.assertEquals("Dynamically added child", ccContent.getChildren().get(2).getAttributes().get("value"));
+ MockPrintWriter writer3 = (MockPrintWriter) response.getWriter();
+ String content3 = new String(writer3.content());
+ Assert.assertTrue(content3.contains("Dynamically added markup"));
+ int indexDynHeader3_1 = content3.indexOf("Start Dynamic Header");
+ int indexDynHeader3_2 = content3.indexOf("Dynamically added header", indexDynHeader3_1);
+ int indexDynHeader3_3 = content3.indexOf("End Dynamic Header", indexDynHeader3_2);
+ Assert.assertNotSame(-1, indexDynHeader3_1);
+ Assert.assertNotSame(-1, indexDynHeader3_2);
+ Assert.assertNotSame(-1, indexDynHeader3_3);
+
+ tearDownRequest();
+ }
+
+ @Test
+ public void testComponentBindingVDL_6() throws Exception
+ {
+ setupRequest("/componentBindingVDL_6.xhtml");
+ processLifecycleExecuteAndRender();
+
+ UIComponent comp = facesContext.getViewRoot().findComponent("mainForm:panel");
+ Assert.assertNotNull(comp);
+ Assert.assertEquals(2, comp.getChildCount());
+
+ UIComponent wrapper = comp.getChildren().get(1);
+ Assert.assertNotNull(wrapper);
+ Assert.assertTrue(UIComponent.isCompositeComponent(wrapper));
+ UIComponent ccContent = wrapper.getFacet(UIComponent.COMPOSITE_FACET_NAME);
+ Assert.assertNotNull(ccContent);
+ Assert.assertEquals(3, ccContent.getChildCount());
+ Assert.assertEquals("Dynamically added child", ccContent.getChildren().get(2).getAttributes().get("value"));
+ MockPrintWriter writer1 = (MockPrintWriter) response.getWriter();
+ String content1 = new String(writer1.content());
+ Assert.assertTrue(content1.contains("Dynamically added markup"));
+ int indexDynHeader1_1 = content1.indexOf("Start Dynamic Header");
+ int indexDynHeader1_2 = content1.indexOf("Dynamically added header", indexDynHeader1_1);
+ int indexDynHeader1_3 = content1.indexOf("End Dynamic Header", indexDynHeader1_2);
+ Assert.assertNotSame(-1, indexDynHeader1_1);
+ Assert.assertNotSame(-1, indexDynHeader1_2);
+ Assert.assertNotSame(-1, indexDynHeader1_3);
+
+ UIComponent ccpanel = facesContext.getViewRoot().findComponent("mainForm:ccpanel");
+ Assert.assertNotNull(ccpanel);
+ UIComponent ccinnerpanel = facesContext.getViewRoot().findComponent("mainForm:ccpanel:component");
+ Assert.assertNotNull(ccinnerpanel);
+ UICommand button = (UICommand) facesContext.getViewRoot().findComponent("mainForm:ccpanel:component:increment");
+ Assert.assertNotNull(button);
+
+ CheckActionEventBean checkBean = facesContext.getApplication().evaluateExpressionGet(facesContext,
+ "#{checkActionEventBean}", CheckActionEventBean.class);
+ int oldcount1 = checkBean.getActionListenerCount();
+
+ submit(button);
+ processLifecycleExecute();
+
+ Assert.assertEquals("event not called", oldcount1+1, checkBean.getActionListenerCount());
+ processRender();
+
+ Assert.assertNotNull(comp);
+ Assert.assertEquals(2, comp.getChildCount());
+
+ comp = facesContext.getViewRoot().findComponent("mainForm:panel");
+
+ Assert.assertEquals("value1", comp.getAttributes().get("attr1"));
+ Assert.assertEquals("value2", comp.getChildren().get(0).getAttributes().get("attr2"));
+
+ wrapper = comp.getChildren().get(1);
+ Assert.assertNotNull(wrapper);
+ Assert.assertTrue(UIComponent.isCompositeComponent(wrapper));
+ ccContent = wrapper.getFacet(UIComponent.COMPOSITE_FACET_NAME);
+ Assert.assertNotNull(ccContent);
+ Assert.assertEquals(3, ccContent.getChildCount());
+ Assert.assertEquals("Dynamically added child", ccContent.getChildren().get(2).getAttributes().get("value"));
+ MockPrintWriter writer2 = (MockPrintWriter) response.getWriter();
+ String content2 = new String(writer2.content());
+ Assert.assertTrue(content2.contains("Dynamically added markup"));
+ int indexDynHeader2_1 = content2.indexOf("Start Dynamic Header");
+ int indexDynHeader2_2 = content2.indexOf("Dynamically added header", indexDynHeader2_1);
+ int indexDynHeader2_3 = content2.indexOf("End Dynamic Header", indexDynHeader2_2);
+ Assert.assertNotSame(-1, indexDynHeader2_1);
+ Assert.assertNotSame(-1, indexDynHeader2_2);
+ Assert.assertNotSame(-1, indexDynHeader2_3);
+
+ button = (UICommand) facesContext.getViewRoot().findComponent("mainForm:ccpanel:component:increment");
+ Assert.assertNotNull(button);
+ int oldcount2 = checkBean.getActionListenerCount();
+
+ submit(button);
+ processLifecycleExecute();
+
+ Assert.assertEquals("event not called", oldcount2+1, checkBean.getActionListenerCount());
+
+ processRender();
+ Assert.assertNotNull(comp);
+ Assert.assertEquals(2, comp.getChildCount());
+
+ comp = facesContext.getViewRoot().findComponent("mainForm:panel");
+
+ Assert.assertEquals("value1", comp.getAttributes().get("attr1"));
+ Assert.assertEquals("value2", comp.getChildren().get(0).getAttributes().get("attr2"));
+
+ wrapper = comp.getChildren().get(1);
+ Assert.assertNotNull(wrapper);
+ Assert.assertTrue(UIComponent.isCompositeComponent(wrapper));
+ ccContent = wrapper.getFacet(UIComponent.COMPOSITE_FACET_NAME);
+ Assert.assertNotNull(ccContent);
+ Assert.assertEquals(3, ccContent.getChildCount());
+ Assert.assertEquals("Dynamically added child", ccContent.getChildren().get(2).getAttributes().get("value"));
+ MockPrintWriter writer3 = (MockPrintWriter) response.getWriter();
+ String content3 = new String(writer3.content());
+ Assert.assertTrue(content3.contains("Dynamically added markup"));
+ int indexDynHeader3_1 = content3.indexOf("Start Dynamic Header");
+ int indexDynHeader3_2 = content3.indexOf("Dynamically added header", indexDynHeader3_1);
+ int indexDynHeader3_3 = content3.indexOf("End Dynamic Header", indexDynHeader3_2);
+ Assert.assertNotSame(-1, indexDynHeader3_1);
+ Assert.assertNotSame(-1, indexDynHeader3_2);
+ Assert.assertNotSame(-1, indexDynHeader3_3);
+
+ tearDownRequest();
+ }
}
Copied: myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIAddSimpleCCVDL3.java (from r1525536, myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIAddSimpleCCVDL.java)
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIAddSimpleCCVDL3.java?p2=myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIAddSimpleCCVDL3.java&p1=myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIAddSimpleCCVDL.java&r1=1525536&r2=1525868&rev=1525868&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIAddSimpleCCVDL.java (original)
+++ myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIAddSimpleCCVDL3.java Tue Sep 24 12:29:05 2013
@@ -32,8 +32,9 @@ import javax.faces.event.SystemEvent;
import javax.faces.event.SystemEventListener;
import javax.faces.view.ViewDeclarationLanguage;
-@FacesComponent(value = "com.myapp.UIAddSimpleCCVDL")
-public class UIAddSimpleCCVDL extends UIComponentBase implements
+@FacesComponent(value = "com.myapp.UIAddSimpleCCVDL3", createTag=true,
+ namespace="http://testcomponent", tagName="addSimpleCCVDL3")
+public class UIAddSimpleCCVDL3 extends UIComponentBase implements
SystemEventListener
{
@@ -41,14 +42,16 @@ public class UIAddSimpleCCVDL extends UI
// Constructor
//
- public UIAddSimpleCCVDL()
+ public UIAddSimpleCCVDL3()
{
setRendererType(null);
FacesContext context = FacesContext.getCurrentInstance();
UIViewRoot root = context.getViewRoot();
-
- root.subscribeToViewEvent(PreRenderViewEvent.class, this);
+ if (root != null)
+ {
+ root.subscribeToViewEvent(PreRenderViewEvent.class, this);
+ }
}
//
@@ -80,11 +83,11 @@ public class UIAddSimpleCCVDL extends UI
Map<String, Object> attributes = new HashMap<String, Object>();
UIComponent component = vdl.createComponent(facesContext,
"http://java.sun.com/jsf/composite/testComposite",
- "dynComp_1", attributes);
+ "dynComp_3", attributes);
UIOutput text = (UIOutput) facesContext.getApplication().
createComponent(UIOutput.COMPONENT_TYPE);
text.setValue("Dynamically added header");
- component.getFacets().put("header", text);
+ component.getChildren().add(text);
getChildren().add(component);
}
Copied: myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIAddSimpleCCVDL4.java (from r1525536, myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIAddSimpleCCVDL.java)
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIAddSimpleCCVDL4.java?p2=myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIAddSimpleCCVDL4.java&p1=myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIAddSimpleCCVDL.java&r1=1525536&r2=1525868&rev=1525868&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIAddSimpleCCVDL.java (original)
+++ myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIAddSimpleCCVDL4.java Tue Sep 24 12:29:05 2013
@@ -32,8 +32,9 @@ import javax.faces.event.SystemEvent;
import javax.faces.event.SystemEventListener;
import javax.faces.view.ViewDeclarationLanguage;
-@FacesComponent(value = "com.myapp.UIAddSimpleCCVDL")
-public class UIAddSimpleCCVDL extends UIComponentBase implements
+@FacesComponent(value = "com.myapp.UIAddSimpleCCVDL4", createTag=true,
+ namespace="http://testcomponent", tagName="addSimpleCCVDL4")
+public class UIAddSimpleCCVDL4 extends UIComponentBase implements
SystemEventListener
{
@@ -41,14 +42,16 @@ public class UIAddSimpleCCVDL extends UI
// Constructor
//
- public UIAddSimpleCCVDL()
+ public UIAddSimpleCCVDL4()
{
setRendererType(null);
FacesContext context = FacesContext.getCurrentInstance();
UIViewRoot root = context.getViewRoot();
-
- root.subscribeToViewEvent(PreRenderViewEvent.class, this);
+ if (root != null)
+ {
+ root.subscribeToViewEvent(PreRenderViewEvent.class, this);
+ }
}
//
@@ -80,11 +83,11 @@ public class UIAddSimpleCCVDL extends UI
Map<String, Object> attributes = new HashMap<String, Object>();
UIComponent component = vdl.createComponent(facesContext,
"http://java.sun.com/jsf/composite/testComposite",
- "dynComp_1", attributes);
+ "dynComp_4", attributes);
UIOutput text = (UIOutput) facesContext.getApplication().
createComponent(UIOutput.COMPONENT_TYPE);
text.setValue("Dynamically added header");
- component.getFacets().put("header", text);
+ component.getChildren().add(text);
getChildren().add(component);
}
Copied: myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIAddSimpleCCVDL5.java (from r1525606, myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIAddSimpleCCVDL2.java)
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIAddSimpleCCVDL5.java?p2=myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIAddSimpleCCVDL5.java&p1=myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIAddSimpleCCVDL2.java&r1=1525606&r2=1525868&rev=1525868&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIAddSimpleCCVDL2.java (original)
+++ myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIAddSimpleCCVDL5.java Tue Sep 24 12:29:05 2013
@@ -31,9 +31,9 @@ import javax.faces.event.SystemEvent;
import javax.faces.event.SystemEventListener;
import javax.faces.view.ViewDeclarationLanguage;
-@FacesComponent(value = "com.myapp.UIAddSimpleCCVDL2", createTag=true,
- namespace="http://testcomponent", tagName="addSimpleCCVDL2")
-public class UIAddSimpleCCVDL2 extends UIComponentBase implements
+@FacesComponent(value = "com.myapp.UIAddSimpleCCVDL5", createTag=true,
+ namespace="http://testcomponent", tagName="addSimpleCCVDL5")
+public class UIAddSimpleCCVDL5 extends UIComponentBase implements
SystemEventListener
{
@@ -41,7 +41,7 @@ public class UIAddSimpleCCVDL2 extends U
// Constructor
//
- public UIAddSimpleCCVDL2()
+ public UIAddSimpleCCVDL5()
{
setRendererType(null);
@@ -82,14 +82,14 @@ public class UIAddSimpleCCVDL2 extends U
Map<String, Object> attributes = new HashMap<String, Object>();
UIComponent component = vdl.createComponent(facesContext,
"http://java.sun.com/jsf/composite/testComposite",
- "dynComp_1", attributes);
+ "dynComp_3", attributes);
Map<String, Object> attributes2 = new HashMap<String, Object>();
UIComponent text = (UIComponent) vdl.createComponent(facesContext,
"http://java.sun.com/jsf/composite/testComposite",
"dynComp_2", attributes2);
- component.getFacets().put("header", text);
+ component.getChildren().add(text);
getChildren().add(component);
}
Copied: myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIAddSimpleCCVDL6.java (from r1525606, myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIAddSimpleCCVDL2.java)
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIAddSimpleCCVDL6.java?p2=myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIAddSimpleCCVDL6.java&p1=myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIAddSimpleCCVDL2.java&r1=1525606&r2=1525868&rev=1525868&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIAddSimpleCCVDL2.java (original)
+++ myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIAddSimpleCCVDL6.java Tue Sep 24 12:29:05 2013
@@ -31,9 +31,9 @@ import javax.faces.event.SystemEvent;
import javax.faces.event.SystemEventListener;
import javax.faces.view.ViewDeclarationLanguage;
-@FacesComponent(value = "com.myapp.UIAddSimpleCCVDL2", createTag=true,
- namespace="http://testcomponent", tagName="addSimpleCCVDL2")
-public class UIAddSimpleCCVDL2 extends UIComponentBase implements
+@FacesComponent(value = "com.myapp.UIAddSimpleCCVDL6", createTag=true,
+ namespace="http://testcomponent", tagName="addSimpleCCVDL6")
+public class UIAddSimpleCCVDL6 extends UIComponentBase implements
SystemEventListener
{
@@ -41,7 +41,7 @@ public class UIAddSimpleCCVDL2 extends U
// Constructor
//
- public UIAddSimpleCCVDL2()
+ public UIAddSimpleCCVDL6()
{
setRendererType(null);
@@ -82,14 +82,14 @@ public class UIAddSimpleCCVDL2 extends U
Map<String, Object> attributes = new HashMap<String, Object>();
UIComponent component = vdl.createComponent(facesContext,
"http://java.sun.com/jsf/composite/testComposite",
- "dynComp_1", attributes);
+ "dynComp_4", attributes);
Map<String, Object> attributes2 = new HashMap<String, Object>();
UIComponent text = (UIComponent) vdl.createComponent(facesContext,
"http://java.sun.com/jsf/composite/testComposite",
"dynComp_2", attributes2);
- component.getFacets().put("header", text);
+ component.getChildren().add(text);
getChildren().add(component);
}
Copied: myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingVDLBean3.java (from r1525536, myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingVDLBean1.java)
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingVDLBean3.java?p2=myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingVDLBean3.java&p1=myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingVDLBean1.java&r1=1525536&r2=1525868&rev=1525868&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingVDLBean1.java (original)
+++ myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingVDLBean3.java Tue Sep 24 12:29:05 2013
@@ -33,9 +33,9 @@ import javax.faces.view.ViewDeclarationL
*
* @author Leonardo Uribe
*/
-@ManagedBean(name="componentBindingVDLBean1")
+@ManagedBean(name="componentBindingVDLBean3")
@RequestScoped
-public class ComponentBindingVDLBean1
+public class ComponentBindingVDLBean3
{
private UIPanel panel;
@@ -65,11 +65,11 @@ public class ComponentBindingVDLBean1
Map<String, Object> attributes = new HashMap<String, Object>();
UIComponent cc = vdl.createComponent(facesContext,
"http://java.sun.com/jsf/composite/testComposite",
- "dynComp_1", attributes);
+ "dynComp_3", attributes);
UIOutput text = (UIOutput) facesContext.getApplication().
createComponent(UIOutput.COMPONENT_TYPE);
text.setValue("Dynamically added header");
- cc.getFacets().put("header", text);
+ cc.getChildren().add(text);
panel.getChildren().add(cc);
if (!facesContext.isPostback())
Copied: myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingVDLBean4.java (from r1525536, myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingVDLBean1.java)
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingVDLBean4.java?p2=myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingVDLBean4.java&p1=myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingVDLBean1.java&r1=1525536&r2=1525868&rev=1525868&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingVDLBean1.java (original)
+++ myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingVDLBean4.java Tue Sep 24 12:29:05 2013
@@ -33,9 +33,9 @@ import javax.faces.view.ViewDeclarationL
*
* @author Leonardo Uribe
*/
-@ManagedBean(name="componentBindingVDLBean1")
+@ManagedBean(name="componentBindingVDLBean4")
@RequestScoped
-public class ComponentBindingVDLBean1
+public class ComponentBindingVDLBean4
{
private UIPanel panel;
@@ -65,11 +65,11 @@ public class ComponentBindingVDLBean1
Map<String, Object> attributes = new HashMap<String, Object>();
UIComponent cc = vdl.createComponent(facesContext,
"http://java.sun.com/jsf/composite/testComposite",
- "dynComp_1", attributes);
+ "dynComp_4", attributes);
UIOutput text = (UIOutput) facesContext.getApplication().
createComponent(UIOutput.COMPONENT_TYPE);
text.setValue("Dynamically added header");
- cc.getFacets().put("header", text);
+ cc.getChildren().add(text);
panel.getChildren().add(cc);
if (!facesContext.isPostback())
Copied: myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingVDLBean5.java (from r1525606, myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingVDLBean2.java)
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingVDLBean5.java?p2=myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingVDLBean5.java&p1=myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingVDLBean2.java&r1=1525606&r2=1525868&rev=1525868&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingVDLBean2.java (original)
+++ myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingVDLBean5.java Tue Sep 24 12:29:05 2013
@@ -33,9 +33,9 @@ import javax.faces.view.ViewDeclarationL
*
* @author Leonardo Uribe
*/
-@ManagedBean(name="componentBindingVDLBean2")
+@ManagedBean(name="componentBindingVDLBean5")
@RequestScoped
-public class ComponentBindingVDLBean2
+public class ComponentBindingVDLBean5
{
private UIPanel panel;
@@ -65,7 +65,7 @@ public class ComponentBindingVDLBean2
Map<String, Object> attributes = new HashMap<String, Object>();
UIComponent cc = vdl.createComponent(facesContext,
"http://java.sun.com/jsf/composite/testComposite",
- "dynComp_1", attributes);
+ "dynComp_3", attributes);
cc.setId("ccpanel");
Map<String, Object> attributes2 = new HashMap<String, Object>();
@@ -74,7 +74,7 @@ public class ComponentBindingVDLBean2
"dynComp_2", attributes2);
text.setId("component");
- cc.getFacets().put("header", text);
+ cc.getChildren().add(text);
panel.getChildren().add(cc);
if (!facesContext.isPostback())
Copied: myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingVDLBean6.java (from r1525606, myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingVDLBean2.java)
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingVDLBean6.java?p2=myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingVDLBean6.java&p1=myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingVDLBean2.java&r1=1525606&r2=1525868&rev=1525868&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingVDLBean2.java (original)
+++ myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingVDLBean6.java Tue Sep 24 12:29:05 2013
@@ -33,9 +33,9 @@ import javax.faces.view.ViewDeclarationL
*
* @author Leonardo Uribe
*/
-@ManagedBean(name="componentBindingVDLBean2")
+@ManagedBean(name="componentBindingVDLBean6")
@RequestScoped
-public class ComponentBindingVDLBean2
+public class ComponentBindingVDLBean6
{
private UIPanel panel;
@@ -65,7 +65,7 @@ public class ComponentBindingVDLBean2
Map<String, Object> attributes = new HashMap<String, Object>();
UIComponent cc = vdl.createComponent(facesContext,
"http://java.sun.com/jsf/composite/testComposite",
- "dynComp_1", attributes);
+ "dynComp_4", attributes);
cc.setId("ccpanel");
Map<String, Object> attributes2 = new HashMap<String, Object>();
@@ -74,7 +74,7 @@ public class ComponentBindingVDLBean2
"dynComp_2", attributes2);
text.setId("component");
- cc.getFacets().put("header", text);
+ cc.getChildren().add(text);
panel.getChildren().add(cc);
if (!facesContext.isPostback())
Copied: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/addSimpleCCVDL3.xhtml (from r1525536, myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/addSimpleCCVDL.xhtml)
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/addSimpleCCVDL3.xhtml?p2=myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/addSimpleCCVDL3.xhtml&p1=myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/addSimpleCCVDL.xhtml&r1=1525536&r2=1525868&rev=1525868&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/addSimpleCCVDL.xhtml (original)
+++ myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/addSimpleCCVDL3.xhtml Tue Sep 24 12:29:05 2013
@@ -30,7 +30,7 @@
<h:form id="mainForm">
- <test:addSimpleCCVDL id="component"/>
+ <test:addSimpleCCVDL3 id="component"/>
<br/>
<h:commandButton id="postback" value="POSTback" action="#{testManagedBean.save}"/>
Copied: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/addSimpleCCVDL4.xhtml (from r1525536, myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/addSimpleCCVDL.xhtml)
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/addSimpleCCVDL4.xhtml?p2=myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/addSimpleCCVDL4.xhtml&p1=myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/addSimpleCCVDL.xhtml&r1=1525536&r2=1525868&rev=1525868&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/addSimpleCCVDL.xhtml (original)
+++ myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/addSimpleCCVDL4.xhtml Tue Sep 24 12:29:05 2013
@@ -30,7 +30,7 @@
<h:form id="mainForm">
- <test:addSimpleCCVDL id="component"/>
+ <test:addSimpleCCVDL4 id="component"/>
<br/>
<h:commandButton id="postback" value="POSTback" action="#{testManagedBean.save}"/>
Copied: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/addSimpleCCVDL5.xhtml (from r1525606, myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/addSimpleCCVDL2.xhtml)
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/addSimpleCCVDL5.xhtml?p2=myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/addSimpleCCVDL5.xhtml&p1=myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/addSimpleCCVDL2.xhtml&r1=1525606&r2=1525868&rev=1525868&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/addSimpleCCVDL2.xhtml (original)
+++ myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/addSimpleCCVDL5.xhtml Tue Sep 24 12:29:05 2013
@@ -30,7 +30,7 @@
<h:form id="mainForm">
- <test:addSimpleCCVDL2 id="component"/>
+ <test:addSimpleCCVDL5 id="component"/>
<br/>
Copied: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/addSimpleCCVDL6.xhtml (from r1525606, myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/addSimpleCCVDL2.xhtml)
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/addSimpleCCVDL6.xhtml?p2=myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/addSimpleCCVDL6.xhtml&p1=myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/addSimpleCCVDL2.xhtml&r1=1525606&r2=1525868&rev=1525868&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/addSimpleCCVDL2.xhtml (original)
+++ myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/addSimpleCCVDL6.xhtml Tue Sep 24 12:29:05 2013
@@ -30,7 +30,7 @@
<h:form id="mainForm">
- <test:addSimpleCCVDL2 id="component"/>
+ <test:addSimpleCCVDL6 id="component"/>
<br/>
Copied: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBindingVDL_3.xhtml (from r1525606, myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBindingVDL_2.xhtml)
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBindingVDL_3.xhtml?p2=myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBindingVDL_3.xhtml&p1=myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBindingVDL_2.xhtml&r1=1525606&r2=1525868&rev=1525868&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBindingVDL_2.xhtml (original)
+++ myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBindingVDL_3.xhtml Tue Sep 24 12:29:05 2013
@@ -20,7 +20,7 @@
</h:head>
<h:body>
<h:form id="mainForm">
- <h:panelGroup id="panel" binding="#{componentBindingVDLBean2.panel}"/>
+ <h:panelGroup id="panel" binding="#{componentBindingVDLBean3.panel}"/>
<h:commandButton id="postback" value="POSTBACK"/>
</h:form>
</h:body>
Copied: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBindingVDL_4.xhtml (from r1525606, myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBindingVDL_2.xhtml)
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBindingVDL_4.xhtml?p2=myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBindingVDL_4.xhtml&p1=myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBindingVDL_2.xhtml&r1=1525606&r2=1525868&rev=1525868&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBindingVDL_2.xhtml (original)
+++ myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBindingVDL_4.xhtml Tue Sep 24 12:29:05 2013
@@ -20,7 +20,7 @@
</h:head>
<h:body>
<h:form id="mainForm">
- <h:panelGroup id="panel" binding="#{componentBindingVDLBean2.panel}"/>
+ <h:panelGroup id="panel" binding="#{componentBindingVDLBean4.panel}"/>
<h:commandButton id="postback" value="POSTBACK"/>
</h:form>
</h:body>
Copied: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBindingVDL_5.xhtml (from r1525606, myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBindingVDL_2.xhtml)
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBindingVDL_5.xhtml?p2=myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBindingVDL_5.xhtml&p1=myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBindingVDL_2.xhtml&r1=1525606&r2=1525868&rev=1525868&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBindingVDL_2.xhtml (original)
+++ myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBindingVDL_5.xhtml Tue Sep 24 12:29:05 2013
@@ -20,7 +20,7 @@
</h:head>
<h:body>
<h:form id="mainForm">
- <h:panelGroup id="panel" binding="#{componentBindingVDLBean2.panel}"/>
+ <h:panelGroup id="panel" binding="#{componentBindingVDLBean5.panel}"/>
<h:commandButton id="postback" value="POSTBACK"/>
</h:form>
</h:body>
Copied: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBindingVDL_6.xhtml (from r1525606, myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBindingVDL_2.xhtml)
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBindingVDL_6.xhtml?p2=myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBindingVDL_6.xhtml&p1=myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBindingVDL_2.xhtml&r1=1525606&r2=1525868&rev=1525868&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBindingVDL_2.xhtml (original)
+++ myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBindingVDL_6.xhtml Tue Sep 24 12:29:05 2013
@@ -20,7 +20,7 @@
</h:head>
<h:body>
<h:form id="mainForm">
- <h:panelGroup id="panel" binding="#{componentBindingVDLBean2.panel}"/>
+ <h:panelGroup id="panel" binding="#{componentBindingVDLBean6.panel}"/>
<h:commandButton id="postback" value="POSTBACK"/>
</h:form>
</h:body>