Package javax.faces.component.html

Examples of javax.faces.component.html.HtmlOutputText


            assertEquals(0, callback.get());
        }
    }

    private UIComponent createCallbackComponent(final TestCallback callback) throws Exception {
        return new HtmlOutputText() {
            private void notifyCallbacks() {
                callback.handle();
            }

            @Override
View Full Code Here


        builder.append("DEFAULT_REQUEST_TIME = " + DEFAULT_REQUEST_TIME + ";");
        builder.append("window.simulationContext = new SimulationContext(");
        builder.append(AJAX_SUBMIT);
        builder.append(");</script>");

        HtmlOutputText text = new HtmlOutputText();

        text.setEscape(false);
        text.setValue(builder.toString());

        List<UIComponent> childList = facesContext.getViewRoot().getChildren();

        childList.add(childList.size(), text);
    }
View Full Code Here

        setInputValue(input, ii);
    }
   
    protected UIComponent createUnitLabel(String tagStyle, InputInfo ii, String value)
    {
        HtmlOutputText text = new HtmlOutputText();
        text.setValue(value);
        // wrap
        HtmlPanelGroup span = new HtmlPanelGroup();
        String styleClass = TagEncodingHelper.getTagStyleClass(tagStyle, TagEncodingHelper.getDataTypeClass(ii.getColumn().getDataType()), null, null);
        span.getAttributes().put("styleClass", styleClass);
        span.getChildren().add(text);
View Full Code Here

   
    protected void addRequiredMark(HtmlOutputLabel label)
    {
        HtmlPanelGroup span = new HtmlPanelGroup();
        span.setStyleClass("required");
        HtmlOutputText text = new HtmlOutputText();
        text.setValue("*");
        span.getChildren().add(text);
        label.getChildren().add(span);
    }
View Full Code Here

    parameter.setValue(id);
    List children = link.getChildren();
    children.add(parameter);
    if (text != null)
    {
      HtmlOutputText uiText = (HtmlOutputText) application
              .createComponent(HtmlOutputText.COMPONENT_TYPE);
      uiText.setTransient(true);
      uiText.setValue(text);
      children.add(uiText);
    }
    scroller.getChildren().add(link);
    return link;
  }
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);
        //set on tag
        Assert.assertEquals("class1", text1.getStyleClass());
        //set as default
        Assert.assertEquals("background:red", text1.getStyle());
        //Check coercion of attribute using type value
        Assert.assertEquals(5, compositeComponent1.getAttributes().get("index"));
        //Check default coercion
        ValueExpression ve = facesContext.getApplication().getExpressionFactory().createValueExpression(
                facesContext.getELContext(), "#{cc.attrs.cols}", Object.class);
        Assert.assertEquals(1, ve.getValue(facesContext.getELContext()));
        text1.popComponentFromEL(facesContext);
        facet1.popComponentFromEL(facesContext);
        compositeComponent1.popComponentFromEL(facesContext);
       
        UIComponent panelGroup2 = root.findComponent("testGroup2");
        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);
        //set on tag
        Assert.assertEquals("background:green", text2.getStyle());
        // not set, should return null, but since there is a ValueExpression indirection,
        // coercing rules apply here, so null is converted as ""
        Assert.assertEquals("", text2.getStyleClass());
        text2.popComponentFromEL(facesContext);
        facet2.popComponentFromEL(facesContext);
        compositeComponent2.popComponentFromEL(facesContext);

        StringWriter sw = new StringWriter();
        MockResponseWriter mrw = new MockResponseWriter(sw);
View Full Code Here

                = (HtmlCommandLink)application.createComponent(HtmlCommandLink.COMPONENT_TYPE);
        link.setId(component.getId() + "_" + valueForLink.getTime() + "_link");
        link.setTransient(true);
        link.setImmediate(component.isImmediate());

        HtmlOutputText text
                = (HtmlOutputText)application.createComponent(HtmlOutputText.COMPONENT_TYPE);
        text.setValue(content);
        text.setId(component.getId() + "_" + valueForLink.getTime() + "_text");
        text.setTransient(true);

        UIParameter parameter
                = (UIParameter)application.createComponent(UIParameter.COMPONENT_TYPE);
        parameter.setId(component.getId() + "_" + valueForLink.getTime() + "_param");
        parameter.setTransient(true);
View Full Code Here

            throws IOException
    {
        Converter converter = getConverter(component);
        Application application = facesContext.getApplication();

        HtmlOutputText text
                = (HtmlOutputText)application.createComponent(HtmlOutputText.COMPONENT_TYPE);
        text.setValue(content);
        text.setId(component.getId() + "_" + valueForLink.getTime() + "_text");
        text.setTransient(true);

        HtmlInputCalendar calendar = (HtmlInputCalendar)component;
        if (calendar.isDisabled() || calendar.isReadonly())
        {
            component.getChildren().add(text);
View Full Code Here

  public void afterPhase(PhaseEvent event) {}

  public void beforePhase(PhaseEvent event) {   
    FacesContext fCon = event.getFacesContext();
    HtmlOutputText js = new HtmlOutputText()
    js.setEscape(false);
    js.setValueExpression("value", fCon.getApplication().getExpressionFactory().createValueExpression(fCon.getELContext(), "#{_YFJSBean.initScript}", String.class));
    //walk the ui tree and get the list of yui dependencies
    UIViewRoot root = fCon.getViewRoot();
    root.addComponentResource(fCon, js);
  }
View Full Code Here

    key = label = "";
    this.table = table;   
  }
  public void addHeaderCell(String val, boolean sortable){
    withHeader = true;
    HtmlOutputText outText = new HtmlOutputText();
    outText.setValue(val);
    addCell(outText, true);
    this.sortable = sortable;
  }
View Full Code Here

TOP

Related Classes of javax.faces.component.html.HtmlOutputText

Copyright © 2018 www.massapicom. 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.