Package javax.faces.component

Examples of javax.faces.component.UIComponent.findComponent()


        for (int i = 0, size = children.size(); i < size; i++) {
            UIComponent comp = children.get(i);

            if (comp instanceof NamingContainer) {
                try {
                    retComp = comp.findComponent(forComponent);
                } catch (IllegalArgumentException iae) {
                    continue;
                }
            }
View Full Code Here


        vdl.buildView(facesContext, root, "testConditionalButtonTargets.xhtml");

        //The first component has a default command button
        UIComponent form = root.findComponent("testForm1");
        Assert.assertNotNull(form);
        UINamingContainer compositeComponent1 = (UINamingContainer) form.findComponent("actionSource1");
        Assert.assertNotNull(compositeComponent1);
        UICommand button1 = (UICommand) compositeComponent1.findComponent("button");
        Assert.assertNotNull(button1);
        Assert.assertEquals("submit", button1.getActionExpression().invoke(facesContext.getELContext(), null));
       
View Full Code Here

        Assert.assertEquals("submit", button1.getActionExpression().invoke(facesContext.getELContext(), null));
       
        Assert.assertNotNull(button1.getActionListeners());
        Assert.assertEquals(1, button1.getActionListeners().length);
       
        UINamingContainer compositeComponent2 = (UINamingContainer) form.findComponent("actionSource2");
        Assert.assertNotNull(compositeComponent2);
        UICommand button2 = (UICommand) compositeComponent2.findComponent("button");
        Assert.assertNotNull(button2);
        //Since the button is outside cc:implementation, by the spec it cannot be taken into account as a valid "targets" value.
        Assert.assertEquals("fail", button2.getActionExpression().invoke(facesContext.getELContext(), null));
View Full Code Here

        Assert.assertNotNull(panelGroup1);
        UINamingContainer compositeComponent1 = (UINamingContainer) panelGroup1.getChildren().get(0);
        Assert.assertNotNull(compositeComponent1);
        UIComponent facet1 = compositeComponent1.getFacet(UIComponent.COMPOSITE_FACET_NAME);
        Assert.assertNotNull(facet1);
        HtmlOutputText text1 = (HtmlOutputText) facet1.findComponent("text");
        Assert.assertNotNull(text1);
       
        compositeComponent1.pushComponentToEL(facesContext, compositeComponent1);
        facet1.pushComponentToEL(facesContext, facet1);
        text1.pushComponentToEL(facesContext, text1);
View Full Code Here

        Assert.assertNotNull(panelGroup2);
        UINamingContainer compositeComponent2 = (UINamingContainer) panelGroup2.getChildren().get(0);
        Assert.assertNotNull(compositeComponent2);
        UIComponent facet2 = compositeComponent2.getFacet(UIComponent.COMPOSITE_FACET_NAME);
        Assert.assertNotNull(facet2);       
        HtmlOutputText text2 = (HtmlOutputText) facet2.findComponent("text");
        Assert.assertNotNull(text2);
       
        compositeComponent2.pushComponentToEL(facesContext, compositeComponent2);
        facet2.pushComponentToEL(facesContext, facet2);
        text2.pushComponentToEL(facesContext, text2);
View Full Code Here

  private void applyConverterPattern(
      final FacesContext facesContext, final UIPopup popup, final String converterPattern) {
    final UIComponent box = popup.getChildren().get(0);
    final UIComponent timePanel = box.findComponent("timePanel");
    if (converterPattern != null && (converterPattern.indexOf('h') > -1 || converterPattern.indexOf('H') > -1)) {
      final UITime time = (UITime) timePanel.findComponent("time");
      final DateTimeConverter dateTimeConverter
          = (DateTimeConverter) facesContext.getApplication().createConverter(DateTimeConverter.CONVERTER_ID);
      if (converterPattern.indexOf('s') > -1) {
        dateTimeConverter.setPattern("HH:mm:ss");
      } else {
View Full Code Here

      if (from == null)
        return null;

      if (!(from instanceof NamingContainer))
        throw new IllegalArgumentException();
      return from.findComponent(id.substring(separatorIndex + 1));
    }
  }


View Full Code Here

    UIComponent target = null;
    for (Iterator<UIComponent> iter = root.getFacetsAndChildren(); iter.hasNext();) {
      UIComponent child = (UIComponent) iter.next();
      if (child instanceof NamingContainer) {
        try {
          target = child.findComponent(id);
        } catch (IllegalArgumentException iae) {
          continue;
        }
      }
      if (target == null) {
View Full Code Here

        // clear the property
        System.setProperty(DID_VALIDATE, EMPTY);

        try {
            userName =
                (UIInput) root.findComponent(
                    "basicForm" + NamingContainer.SEPARATOR_CHAR + "userName");
        } catch (Throwable e) {
            System.out.println(e.getMessage());
            assertTrue("Can't find userName in tree", false);
        }
View Full Code Here

        this.value = value;
    }

    public void textValue(ValueChangeEvent event) {
        UIComponent component = event.getComponent();
        HintLabel testComponent = (HintLabel) component.findComponent("a1");
        testComponent.setValue(event.getNewValue());
    }

}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.