use of javax.faces.component.UINamingContainer in project primefaces by primefaces.
the class SearchExpressionFacadeTest method resolveComponent_WidgetVarNext.
@Test
public void resolveComponent_WidgetVarNext() {
UIComponent root = new UIPanel();
FacesContext.getCurrentInstance().getViewRoot().getChildren().add(root);
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);
InputText input = new InputText();
input.setWidgetVar("myInput_Widget");
outerContainer.getChildren().add(input);
InputText input2 = new InputText();
input2.setWidgetVar("myInput_Widget2");
outerContainer.getChildren().add(input2);
assertEquals(input2, resolveComponent(source, " @widgetVar(myInput_Widget):@next"));
}
use of javax.faces.component.UINamingContainer in project primefaces by primefaces.
the class SearchExpressionFacadeTest method resolveClientId_AbsoluteId.
@Test
public void resolveClientId_AbsoluteId() {
UIComponent root = new UIPanel();
FacesContext.getCurrentInstance().getViewRoot().getChildren().add(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();
innerContainer.getChildren().add(component);
UIComponent source = new UICommand();
innerContainer.getChildren().add(source);
assertEquals("form", resolveClientId(source, " :form "));
}
use of javax.faces.component.UINamingContainer in project primefaces by primefaces.
the class SearchExpressionFacadeTest method resolveClientIds_RelativeAndParentParent.
@Test
public void resolveClientIds_RelativeAndParentParent() {
UIComponent root = new UIPanel();
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 form:outerContainer", resolveClientIds(source, " other @parent:@parent"));
}
use of javax.faces.component.UINamingContainer in project primefaces by primefaces.
the class SearchExpressionFacadeTest method resolveComponent_AbsoluteWithFormPrependIdFalse_InvokeOnComponentUnrendered.
@Test
public void resolveComponent_AbsoluteWithFormPrependIdFalse_InvokeOnComponentUnrendered() {
UIComponent root = new UIPanel();
FacesContext.getCurrentInstance().getViewRoot().getChildren().add(root);
UIForm form = new UIForm();
form.setId("form");
form.setPrependId(false);
root.getChildren().add(form);
UINamingContainer outerContainer = new UINamingContainer();
outerContainer.setId("outerContainer");
form.getChildren().add(outerContainer);
UINamingContainer innerContainer = new UINamingContainer();
innerContainer.setId("innerContainer");
innerContainer.setRendered(false);
outerContainer.getChildren().add(innerContainer);
UIComponent component = new UIOutput();
innerContainer.getChildren().add(component);
UIComponent source = new UICommand();
source.setId("source");
innerContainer.getChildren().add(source);
assertEquals(source, resolveComponent(source, " outerContainer:innerContainer:source "));
}
use of javax.faces.component.UINamingContainer in project primefaces by primefaces.
the class SearchExpressionFacadeTest method resolveComponent_ParentParent.
@Test
public void resolveComponent_ParentParent() {
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, "@parent:@parent"), "Failed");
}
Aggregations