Examples of UIOutput


Examples of javax.faces.component.UIOutput

  @Override
  public void encodeChildren(FacesContext facesContext, UIComponent component) throws IOException {
   
    ResponseWriter responseWriter = facesContext.getResponseWriter();
    UIOutput uiOutput = (UIOutput) component;
    Object value = uiOutput.getValue();   
    responseWriter.write(""+value);
  }
View Full Code Here

Examples of javax.faces.component.UIOutput

    /**
     * Test method for {@link org.richfaces.component.UIDataTableBase#getHeader()}.
     */
    @Test
    public void testGetHeader() {
        UIOutput component = new UIOutput();
        table.getFacets().put("header", component);
        Assert.assertSame(component, table.getHeader());
    }
View Full Code Here

Examples of javax.faces.component.UIOutput

    /**
     * Test method for {@link org.richfaces.component.UIDataTableBase#getFooter()}.
     */
    @Test
    public void testGetFooter() {
        UIOutput component = new UIOutput();
        table.getFacets().put("footer", component);
        Assert.assertSame(component, table.getFooter());
    }
View Full Code Here

Examples of javax.faces.component.UIOutput

        UIColumn child = new UIColumn();
        List<UIComponent> children = table.getChildren();
        children.add(new UIColumn());
        children.add(child);
        Assert.assertFalse(table.isColumnFacetPresent(facetName));
        child.getFacets().put(facetName, new UIOutput());
        Assert.assertTrue(table.isColumnFacetPresent(facetName));
        child.setRendered(false);
        Assert.assertFalse(table.isColumnFacetPresent(facetName));
    }
View Full Code Here

Examples of javax.faces.component.UIOutput

        Facelet at = f.getFacelet("convertDateTime.xml");

        UIViewRoot root = faces.getViewRoot();
        at.apply(faces, root);

        UIOutput out1 = (UIOutput) root.findComponent("form:out1");
        UIOutput out2 = (UIOutput) root.findComponent("form:out2");
        UIOutput out3 = (UIOutput) root.findComponent("form:out3");
        UIOutput out4 = (UIOutput) root.findComponent("form:out4");
        UIOutput out5 = (UIOutput) root.findComponent("form:out5");
        UIOutput out6 = (UIOutput) root.findComponent("form:out6");

        assertNotNull("out1", out1);
        assertNotNull("out2", out2);
        assertNotNull("out3", out3);
        assertNotNull("out4", out4);
        assertNotNull("out5", out5);
        assertNotNull("out6", out6);

        assertNotNull("out1 converter", out1.getConverter());
        assertNotNull("out2 converter", out2.getConverter());
        assertNotNull("out3 converter", out3.getConverter());
        assertNotNull("out4 converter", out4.getConverter());
        assertNotNull("out5 converter", out5.getConverter());
        DateTimeConverter converter6 = (DateTimeConverter)out6.getConverter();

        assertEquals("out1 value", "12/24/69", out1.getConverter().getAsString(
                faces, out1, now));
        assertEquals("out2 value", "12/24/69 6:57:12 AM", out2.getConverter()
                .getAsString(faces, out2, now));
View Full Code Here

Examples of javax.faces.component.UIOutput

        Facelet at = f.getFacelet("converter.xml");

        UIViewRoot root = faces.getViewRoot();
        at.apply(faces, root);
       
        UIOutput out1 = (UIOutput) root.findComponent("out1");
       
        assertNotNull("out1", out1);
       
        assertNotNull("out1 converter", out1.getConverter());
       
        assertEquals("out1 value", new Double(42.5), out1.getConverter().getAsObject(faces, out1, out1.getLocalValue().toString()));
    }
View Full Code Here

Examples of javax.faces.component.UIOutput

        Facelet at = f.getFacelet("convertNumber.xml");

        UIViewRoot root = faces.getViewRoot();
        at.apply(faces, root);
       
        UIOutput out1 = (UIOutput) root.findComponent("out1");
        UIOutput out2 = (UIOutput) root.findComponent("out2");
        UIOutput out3 = (UIOutput) root.findComponent("out3");
        UIOutput out4 = (UIOutput) root.findComponent("out4");
        UIOutput out5 = (UIOutput) root.findComponent("out5");

        assertNotNull("out1", out1);
        assertNotNull("out2", out2);
        assertNotNull("out3", out3);
        assertNotNull("out4", out4);
        assertNotNull("out5", out5);

        assertNotNull("out1 converter", out1.getConverter());
        assertNotNull("out2 converter", out2.getConverter());
        assertNotNull("out3 converter", out3.getConverter());
        assertNotNull("out4 converter", out4.getConverter());
        assertNotNull("out5 converter", out5.getConverter());

        assertEquals("out1 value", "12", out1.getConverter().getAsString(
                faces, out1, new Double(12.001)));
        assertEquals("out2 value", "$12.00", out2.getConverter()
                .getAsString(faces, out2, new Double(12.00)));
        assertEquals("out3 value", "00,032", out3.getConverter()
                .getAsString(faces, out3, new Double(32)));
        assertEquals("out4 value", "0.67", out4.getConverter()
                .getAsString(faces, out4, new Double(2.0/3.0)));
        assertEquals("out5 value", "67%", out5.getConverter()
                .getAsString(faces, out5, new Double(0.67)));
    }
View Full Code Here

Examples of javax.faces.component.UIOutput

        {
            Application application = context.getApplication();
           
            // Create a UIOutput instance by passing javax.faces.Output. to
            // Application.createComponent(java.lang.String).
            UIOutput output = (UIOutput) application.createComponent(UIOutput.COMPONENT_TYPE);
           
            // Get the annotation instance from the class and obtain the values of the name, library, and
            // target attributes.
            String name = annotation.name();
            if (name != null && name.length() > 0)
            {
                name = ELText.parse(getExpressionFactory(), context.getELContext(), name).toString(context.getELContext());
            }
           
            // Obtain the renderer-type for the resource name by passing name to
            // ResourceHandler.getRendererTypeForResourceName(java.lang.String).
            String rendererType = application.getResourceHandler().getRendererTypeForResourceName(name);
           
            // Call setRendererType on the UIOutput instance, passing the renderer-type.
            output.setRendererType(rendererType);
           
            // Obtain the Map of attributes from the UIOutput component by calling UIComponent.getAttributes().
            Map<String, Object> attributes = output.getAttributes();
           
            // Store the name into the attributes Map under the key "name".
            attributes.put("name", name);
           
            // If library is the empty string, let library be null.
View Full Code Here

Examples of javax.faces.component.UIOutput

        // If this annotation is not present on the class in question, no action must be taken.
        if (annotation != null)
        {
            // Create a UIOutput instance by passing javax.faces.Output. to
            // Application.createComponent(java.lang.String).
            UIOutput output = (UIOutput) createComponent(UIOutput.COMPONENT_TYPE);

            // Get the annotation instance from the class and obtain the values of the name, library, and
            // target attributes.
            String name = annotation.name();
            if (name != null && name.length() > 0)
            {
                name = ELText.parse(getExpressionFactory(), context.getELContext(), name).toString(context.getELContext());
            }

            // Obtain the renderer-type for the resource name by passing name to
            // ResourceHandler.getRendererTypeForResourceName(java.lang.String).
            String rendererType = getResourceHandler().getRendererTypeForResourceName(name);

            // Call setRendererType on the UIOutput instance, passing the renderer-type.
            output.setRendererType(rendererType);

            // Obtain the Map of attributes from the UIOutput component by calling UIComponent.getAttributes().
            Map<String, Object> attributes = output.getAttributes();

            // Store the name into the attributes Map under the key "name".
            attributes.put("name", name);

            // If library is the empty string, let library be null.
View Full Code Here

Examples of javax.faces.component.UIOutput

                StringBuffer buf = new StringBuffer();
                for (int i = 0; i < level * 4; i++) buf.append(' ');
                String value;
                if (item.getChildren().size() > 0 && item.getChildren().get(0) instanceof UIOutput)
                {
                    UIOutput uiOutput = (UIOutput) item.getChildren().get(0);
                    value = uiOutput.getValue() != null ? uiOutput.getValue().toString() : "?";
                }
                else
                {
                    value = item.getValue() != null ? item.getValue().toString() : "";
                }
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.