Package javax.faces.component

Examples of javax.faces.component.UIInput$ValueChangeListenerAdapter


    {
        if(inputCalendar.isAddResources())
            addScriptAndCSSResources(facesContext, inputCalendar);

         // Check for an enclosed converter:
         UIInput uiInput = (UIInput) inputCalendar;
         Converter converter = uiInput.getConverter();
         String dateFormat = null;
         if (converter != null && converter instanceof DateTimeConverter) {
             dateFormat = ((DateTimeConverter) converter).getPattern();
         }
         if (dateFormat == null) {
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();
        }
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

    @Override
    public void queueEvent(FacesEvent event) {
        if (event instanceof ValidationEvent && event.getComponent() == this) {
            UIComponent parent = getParent();
            if (parent instanceof UIInput) {
                UIInput input = (UIInput) parent;
                if (input.isImmediate()) {
                    event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
                } else {
                    event.setPhaseId(PhaseId.PROCESS_VALIDATIONS);
                }
            }
View Full Code Here

              column.toggleSortOrder();
            } else if(isSingleSortMode){
              column.setSortOrder(Ordering.UNSORTED);
            }
          }
          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);
      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

                                }
                            }
                        }
                    }

                    UIInput filterValueInput = (UIInput) column
                            .getFacet(FILTER_INPUT_FACET_NAME);
                    if (null != filterValueInput) {
                        filterValueInput.decode(context);
                        String oldFilterValue = column.getFilterValue();
                        Object submittedValue = filterValueInput
                                .getSubmittedValue();
                        String newFilterValue = null;
                        if (null != submittedValue) {
                            newFilterValue = filterValueInput
                                    .getSubmittedValue().toString();
                            if ((newFilterValue != null)
                                    && (newFilterValue.length() == 0)) {
                                newFilterValue = null;
                            }
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);
            filterValueInput.getAttributes().put(HTML.onclick_ATTRIBUTE,
                    "Event.stop(event);");
        }
        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 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 requestParameterMap = context.getExternalContext().getRequestParameterMap();
    if (requestParameterMap.containsKey(clientId)) {
      final String newValue = (String) 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

TOP

Related Classes of javax.faces.component.UIInput$ValueChangeListenerAdapter

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.