Examples of UIIn


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

      HtmlRendererUtils.renderFocusId(facesContext, input);

      // input suggest
      if (renderAjaxSuggest) {

        UIIn in = (UIIn) input;
        int suggestMinChars = in.getSuggestMinChars();
        int suggestDelay = in.getSuggestDelay();

        final String[] cmds = {
            "new Tobago.AutocompleterAjax(",
            "    '" + id + "',",
            "    " + required + ",",
View Full Code Here

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

    if (!(component instanceof UIIn)) {
      LOG.error("Wrong type: Need " + UIIn.class.getName() + ", but was " + component.getClass().getName());
      return;
    }

    final UIIn input = (UIIn) component;
    final MethodBinding methodBinding = input.getSuggestMethod();
    final AutoSuggestItems items
            = createAutoSuggestItems(methodBinding.invoke(facesContext, new Object[]{input}));
    final List<AutoSuggestItem> suggestItems = items.getItems();
    final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
View Full Code Here

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

      HtmlRendererUtils.renderFocusId(facesContext, input);

      // input suggest
      if (renderAjaxSuggest) {

        UIIn in = (UIIn) input;
        int suggestMinChars = in.getSuggestMinChars();
        int suggestDelay = in.getSuggestDelay();

        final String[] cmds = {
            "new Tobago.AutocompleterAjax(",
            "    '" + id + "',",
            "    " + required + ",",
View Full Code Here

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

    if (!(component instanceof UIIn)) {
      LOG.error("Wrong type: Need " + UIIn.class.getName() + ", but was " + component.getClass().getName());
      return;
    }

    final UIIn input = (UIIn) component;
    final MethodBinding methodBinding = input.getSuggestMethod();
    final AutoSuggestItems items
            = createAutoSuggestItems(methodBinding.invoke(facesContext, new Object[]{input}));
    final List<AutoSuggestItem> suggestItems = items.getItems();
    final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
View Full Code Here

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

  public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {

    final UISuggest suggest = (UISuggest) component;
    final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
    final String id  = suggest.getClientId(facesContext);
    final UIIn in = (UIIn) suggest.getParent();
    final MethodExpression suggestMethodExpression = suggest.getSuggestMethodExpression();
    final AutoSuggestItems items
        = createAutoSuggestItems(suggestMethodExpression.invoke(facesContext.getELContext(), new Object[]{in}));
    // todo: declare unused/unsupported stuff deprecated

    writer.startElement(HtmlElements.DIV, null);
    writer.writeClassAttribute(Classes.create(suggest));
    writer.writeIdAttribute(id);
    writer.writeAttribute(DataAttributes.FOR, in.getClientId(facesContext), false);
    writer.writeAttribute(DataAttributes.SUGGEST_MIN_CHARS, suggest.getMinimumCharacters());
    writer.writeAttribute(DataAttributes.SUGGEST_DELAY, suggest.getDelay());
    writer.writeAttribute(DataAttributes.SUGGEST_MAX_ITEMS, suggest.getMaximumItems());
    writer.writeAttribute(DataAttributes.SUGGEST_UPDATE, Boolean.toString(suggest.isUpdate()), false);
    int totalCount = suggest.getTotalCount();
View Full Code Here

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

  @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

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

  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

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

  }

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

    UIIn input = (UIIn) component;

    boolean previewState
        = ComponentUtils.getBooleanAttribute(input, Attributes.STATE_PREVIEW);
    // FIXME: remove this when i18n is ok

    String clientId = input.getClientId(facesContext);

    TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);

    writer.startElement(HtmlElements.DIV, input);
    writer.writeClassAttribute(Classes.create(input, "container"));
    HtmlRendererUtils.writeDataAttributes(facesContext, writer, input);
    Style style = new Style(facesContext, input);
    writer.writeStyleAttribute(style);

    UIComponent toolbar = input.getFacet(Facets.TOOL_BAR);
    if (toolbar == null) {
      toolbar = createToolbar(facesContext, input);
    }

    facesContext.getExternalContext().getRequestMap().put(
View Full Code Here

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

    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

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

    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
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.