Package org.apache.myfaces.tobago.component

Examples of org.apache.myfaces.tobago.component.UIIn


    Assert.assertEquals("tobago-in-sub", Classes.create(in, "sub").getStringValue());
  }

  @Test
  public void testMixed() {
    final UIIn in = (UIIn) CreateComponentUtils.createComponent(
        getFacesContext(), ComponentTypes.IN, RendererTypes.IN, "in");
    in.setDisabled(true);
    in.setReadonly(true);
    in.setValid(false);
    in.setMarkup(Markup.valueOf("important,deleted"));
    updateCurrentMarkup(in);
    Assert.assertEquals("tobago-in-sub tobago-in-sub-markup-important tobago-in-sub-markup-deleted "
        + "tobago-in-sub-markup-disabled tobago-in-sub-markup-readonly tobago-in-sub-markup-error",
        Classes.create(in, "sub").getStringValue());
  }
View Full Code Here


  private List<UIColumn> createSolarArrayColumns() {

    List<UIColumn> columns = new ArrayList<UIColumn>(3);

    FacesContext facesContext = FacesContext.getCurrentInstance();
    UIIn in = (UIIn)
        CreateComponentUtils.createComponent(facesContext, UIIn.COMPONENT_TYPE, RendererTypes.IN, "sac1i");
    in.setValueBinding(
        Attributes.VALUE, facesContext.getApplication().createValueBinding("#{luminary.population}"));

    columns.add(CreateComponentUtils.createColumn(
        "#{overviewBundle.solarArrayPopulation}", "true", null, in, "sac1"));
View Full Code Here

  private List<UIColumn> createSolarArrayColumns() {

    List<UIColumn> columns = new ArrayList<UIColumn>(3);

    FacesContext facesContext = FacesContext.getCurrentInstance();
    UIIn in = (UIIn)
        CreateComponentUtils.createComponent(facesContext, UIIn.COMPONENT_TYPE, RendererTypes.IN, "sac1i");
    in.setValueBinding(
        Attributes.VALUE, facesContext.getApplication().createValueBinding("#{luminary.population}"));

    columns.add(CreateComponentUtils.createColumn(
        "#{overviewBundle.solarArrayPopulation}", "true", null, in, "sac1"));
View Full Code Here

  @Override
  public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {
    super.encodeEnd(facesContext, component);

    UIIn in = (UIIn) component;
    for (String markup : in.getMarkup()) {
      if (markup.equals("changeaware")) {
        String id = in.getClientId(facesContext);
        final String[] cmds = {"new Example.ChangeAware('" + id + "');"};
        HtmlRendererUtils.writeScriptLoader(facesContext, null, cmds);
      }
      if (markup.equals("blink")) {
        String id = in.getClientId(facesContext);
        final String[] cmds = {"new Example.Blinker('" + id + "');"};
        HtmlRendererUtils.writeScriptLoader(facesContext, null, cmds);
      }
    }
  }
View Full Code Here

    parse("day", 1L, "24:00:00");
    parse("year", 1L, "8765:45:36");
  }

  private void format(String unit, Long aLong, String string) {
    UIIn input = new UIIn();
    String info = "Formatting numbers:"
        + " unit='" + unit + "'"
        + " long='" + aLong + "'";
    String result;
    if (unit != null) {
      input.getAttributes().put(Attributes.UNIT, unit);
    }
    result = converter.getAsString(null, input, aLong);
    Assert.assertEquals(info, string, result);
  }
View Full Code Here

    result = converter.getAsString(null, input, aLong);
    Assert.assertEquals(info, string, result);
  }

  private void parse(String unit, Long aLong, String string) {
    UIIn input = new UIIn();
    String info = "Parsing numbers:"
        + " unit='" + unit + "'"
        + " string='" + string + "'";
    Long result;
    if (unit != null) {
      input.getAttributes().put(Attributes.UNIT, unit);
    }
    result = (Long) converter.getAsObject(null, input, string);
    Assert.assertEquals(info, aLong, result);
  }
View Full Code Here

TOP

Related Classes of org.apache.myfaces.tobago.component.UIIn

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.