use of javax.faces.component.UINamingContainer in project primefaces by primefaces.
the class SearchExpressionFacadeTest method resolveComponent_Namingcontainer.
@Test
public void resolveComponent_Namingcontainer() {
UIComponent root = new UIPanel();
UIForm form = new UIForm();
root.getChildren().add(form);
UINamingContainer outerContainer = new UINamingContainer();
form.getChildren().add(outerContainer);
UINamingContainer innerContainer = new UINamingContainer();
outerContainer.getChildren().add(innerContainer);
UIComponent component = new UIOutput();
innerContainer.getChildren().add(component);
UIComponent source = new UICommand();
innerContainer.getChildren().add(source);
assertSame(innerContainer, resolveComponent(source, "@namingcontainer"));
}
use of javax.faces.component.UINamingContainer in project primefaces by primefaces.
the class SearchExpressionFacadeTest method resolveClientId_PFS.
@Test
public void resolveClientId_PFS() {
UIComponent root = new UIPanel();
UIForm form = new UIForm();
root.getChildren().add(form);
UINamingContainer outerContainer = new UINamingContainer();
form.getChildren().add(outerContainer);
UINamingContainer innerContainer = new UINamingContainer();
outerContainer.getChildren().add(innerContainer);
UIComponent component = new UIOutput();
innerContainer.getChildren().add(component);
UIComponent source = new UICommand();
innerContainer.getChildren().add(source);
assertEquals("@(.myClass, div)", resolveClientId(source, "@(.myClass, div) "));
}
use of javax.faces.component.UINamingContainer in project primefaces by primefaces.
the class SearchExpressionFacadeTest method resolveComponent_FormParent.
@Test
public void resolveComponent_FormParent() {
UIComponent root = new UIPanel();
UIForm form = new UIForm();
root.getChildren().add(form);
UINamingContainer outerContainer = new UINamingContainer();
form.getChildren().add(outerContainer);
UINamingContainer innerContainer = new UINamingContainer();
outerContainer.getChildren().add(innerContainer);
UIComponent component = new UIOutput();
innerContainer.getChildren().add(component);
UIComponent source = new UICommand();
innerContainer.getChildren().add(source);
assertSame(root, resolveComponent(source, "@form:@parent"));
}
use of javax.faces.component.UINamingContainer in project primefaces by primefaces.
the class SearchExpressionFacadeTest method resolveClientId_ParentChild.
@Test
public void resolveClientId_ParentChild() {
UIComponent root = new UIPanel();
root.setId("root");
UIForm form = new UIForm();
form.setId("form");
root.getChildren().add(form);
UINamingContainer outerContainer = new UINamingContainer();
outerContainer.setId("outerContainer");
form.getChildren().add(outerContainer);
UINamingContainer innerContainer = new UINamingContainer();
innerContainer.setId("innerContainer");
outerContainer.getChildren().add(innerContainer);
UIComponent component = new UIOutput();
component.setId("other");
innerContainer.getChildren().add(component);
UIComponent source = new UICommand();
source.setId("source");
innerContainer.getChildren().add(source);
assertEquals("form:outerContainer:innerContainer:other", resolveClientId(source, " @parent:@child(0) "));
assertEquals("form:outerContainer:innerContainer:source", resolveClientId(source, " @parent:@child(1) "));
}
use of javax.faces.component.UINamingContainer in project primefaces by primefaces.
the class SearchExpressionFacadeTest method resolveComponent_NamingcontainerParent.
@Test
public void resolveComponent_NamingcontainerParent() {
UIComponent root = new UIPanel();
UIForm form = new UIForm();
root.getChildren().add(form);
UINamingContainer outerContainer = new UINamingContainer();
form.getChildren().add(outerContainer);
UINamingContainer innerContainer = new UINamingContainer();
outerContainer.getChildren().add(innerContainer);
UIComponent component = new UIOutput();
innerContainer.getChildren().add(component);
UIComponent source = new UICommand();
innerContainer.getChildren().add(source);
assertSame(outerContainer, resolveComponent(source, "@namingcontainer:@parent"));
}
Aggregations