Package javax.faces.component

Examples of javax.faces.component.UIInput


            }
        }
    }

    protected void addInplaceInput(FacesContext context, UIComponent column) throws IOException {
        UIInput filterValueInput = (UIInput) column
                .getFacet(FILTER_INPUT_FACET_NAME);
        if (null == filterValueInput) {
            filterValueInput = (UIInput) context.getApplication()
                    .createComponent(UIInput.COMPONENT_TYPE);
            filterValueInput.setId(column.getId() + SORT_FILTER_PARAMETER);
            filterValueInput.setImmediate(true);
            filterValueInput.getAttributes().put(HTML.STYLE_CLASS_ATTR, "rich-filter-input");
            column.getFacets().put(FILTER_INPUT_FACET_NAME, filterValueInput);
            filterValueInput.getAttributes().put(HTML.onclick_ATTRIBUTE,
                    "Event.stop(event);");
        }
        String filterEvent = (String) column.getAttributes().get("filterEvent");
        if (null == filterEvent || "".equals(filterEvent)) {
            filterEvent = "onchange";
        }

        String buffer = buildAjaxFunction(
            context,
            column,
            false,
            buildSetFocusFunctionDef(filterValueInput.getClientId(context)));
        filterValueInput.getAttributes().put(filterEvent, buffer);
        filterValueInput.setValue(column.getAttributes().get("filterValue"));

        getUtils().encodeBeginFormIfNessesary(context, column);
        renderChild(context, filterValueInput);
        getUtils().encodeEndFormIfNessesary(context, column);
    }
View Full Code Here


            }
           
            RequestContext requestContext = RequestContext.getInstance(context);
            requestContext.setAttribute(columnClientId + SORT_DIV, Boolean.TRUE);
          }
          UIInput filterValueInput = (UIInput)child.getFacet(FILTER_INPUT_FACET_NAME);
          if (null != filterValueInput) {
            filterValueInput.setId(filterValueInput.getId());
            filterValueInput.decode(context);
            Object submittedValue = filterValueInput.getSubmittedValue();
            if (null != submittedValue) {
              column.setFilterValue(filterValueInput.getSubmittedValue().toString());
            }
          }
        }

      }
View Full Code Here

    }
  }
 
  protected void addInplaceInput(FacesContext context, UIComponent column,
      String buffer) throws IOException {
    UIInput filterValueInput = (UIInput) column
        .getFacet(FILTER_INPUT_FACET_NAME);
    if (null == filterValueInput) {
      filterValueInput = (UIInput) context.getApplication().createComponent(UIInput.COMPONENT_TYPE);
      filterValueInput.setId(column.getId() + SORT_FILTER_PARAMETER);
      filterValueInput.setImmediate(true);
      column.getFacets().put(FILTER_INPUT_FACET_NAME, filterValueInput);
     
      //Event.stop requires prototype.js
      setRequiresScripts(context);
     
      filterValueInput.getAttributes().put(HTML.onclick_ATTRIBUTE, "Event.stop(event);");
      filterValueInput.getAttributes().put(HTML.STYLE_CLASS_ATTR, "rich-filter-input");
    }
    String filterEvent = (String) column.getAttributes().get("filterEvent");
    if (null == filterEvent || "".equals(filterEvent)) {
      filterEvent = "onchange";
    }
   
    filterValueInput.getAttributes().put(filterEvent, buffer);   
    filterValueInput.setValue(column.getAttributes().get("filterValue"));

    getUtils().encodeBeginFormIfNessesary(context, column);
    renderChild(context, filterValueInput);
    getUtils().encodeEndFormIfNessesary(context, column);
  }
View Full Code Here

    public Object getConvertedValue(FacesContext facesContext, UIComponent uiComponent, Object submittedValue) throws ConverterException
    {
        RendererUtils.checkParamValidity(facesContext, uiComponent, HtmlInputCalendar.class);

        UIInput uiInput = (UIInput) uiComponent;

        Converter converter = uiInput.getConverter();

        if(converter==null)
            converter = new CalendarDateTimeConverter();

        if (submittedValue != null && !(submittedValue instanceof String))
View Full Code Here

    writeSliderJavaScript(facesContext, slider, writer);
    //HtmlRendererUtils.renderFocusId(facesContext, slider);
  }

  public void decode(FacesContext context, UIComponent component) {
    UIInput uiInput;
    if (component instanceof UIInput && !ComponentUtils.isOutputOnly(component)) {
      uiInput = (UIInput) component;
    } else {
      return;
    }
    String inputId = getIdForInputField(context, component);
    Map requestParameterMap = context.getExternalContext().getRequestParameterMap();
    if (requestParameterMap.containsKey(inputId)) {
      String newValue = (String) requestParameterMap.get(inputId);
      uiInput.setSubmittedValue(newValue);
    }
  }
View Full Code Here

    }
    if (ComponentUtils.getBooleanAttribute(component, Attributes.INLINE)) {
      addAspectClass(rendererName, Aspect.INLINE);
    }
    if (component instanceof UIInput) {
      UIInput input = (UIInput) component;
      if (ComponentUtils.isError(input)) {
        addAspectClass(rendererName, Aspect.ERROR);
      }
      if (input.isRequired()) {
        addAspectClass(rendererName, Aspect.REQUIRED);
      }
    }
  }
View Full Code Here

public class InputRendererBase extends LayoutComponentRendererBase {

  private static final Logger LOG = LoggerFactory.getLogger(InputRendererBase.class);

  public void decode(FacesContext context, UIComponent component) {
    final UIInput uiInput;
    if (component instanceof UIInput) {
      uiInput = (UIInput) component;
    } else {
      return; // no decoding required
    }

    if (ComponentUtils.isOutputOnly(component)) {
      return;
    }

    final String clientId = component.getClientId(context);

    final Map<String, String> requestParameterMap = context.getExternalContext().getRequestParameterMap();
    if (requestParameterMap.containsKey(clientId)) {
      final String newValue = requestParameterMap.get(clientId);
      if (LOG.isDebugEnabled()) {
        final boolean password = ComponentUtils.getBooleanAttribute(component, Attributes.PASSWORD);
        LOG.debug("clientId = '" + clientId + "'");
        LOG.debug("requestParameterMap.get(clientId) = '"
            + (password ? StringUtils.leftPad("", newValue.length(), '*') : newValue) + "'");
      }
      uiInput.setSubmittedValue(newValue);
    }
  }
View Full Code Here

  private static final Logger LOG = LoggerFactory.getLogger(SelectBooleanCheckboxRenderer.class);

  public void decode(FacesContext facesContext, UIComponent component) {

    UIInput input = (UIInput) component;

    if (ComponentUtils.isOutputOnly(input)) {
      return;
    }

    String newValue = (String) facesContext.getExternalContext()
        .getRequestParameterMap().get(input.getClientId(facesContext));

    if (LOG.isDebugEnabled()) {
      LOG.debug("new value = '" + newValue + "'");
    }

    input.setSubmittedValue("true".equals(newValue) ? "true" : "false");
  }
View Full Code Here

    }
    if (ComponentUtils.getBooleanAttribute(component, Attributes.READONLY)) {
      markup = markup.add(Markup.READONLY);
    }
    if (component instanceof UIInput) {
      UIInput input = (UIInput) component;

      final FacesMessage.Severity maximumSeverity = ComponentUtils.getMaximumSeverity(input);
      markup = markup.add(markupOfSeverity(maximumSeverity));

      if (input.isRequired()) {
        markup = markup.add(Markup.REQUIRED);
      }
    }
    return markup;
  }
View Full Code Here

        return disabled;       
    }

    private boolean isRowSelected(UIComponent component)
    {
        UIInput input = (UIInput) component;
        Object value = input.getValue();

        int currentRowIndex = getCurrentRowIndex(component);

        return (value != null)
                && (currentRowIndex == ((Long) value).intValue());
View Full Code Here

TOP

Related Classes of javax.faces.component.UIInput

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.