Package de.hybris.yfaces.component

Examples of de.hybris.yfaces.component.YComponent


    // example for that are loops like dataList, table etc..
    // in that case UIComponents and YComponent instances are similar
    // therefore the YComponent instance is mapped to the UIComponent instance via it's clientid
    String key = super.getClientId(getFacesContext());
    Map<String, Object> map = getStateMap();
    YComponent result = (YComponent) map.get(key + "_COMPONENT");
    return result;
  }
View Full Code Here


  private void setVarValue(YComponent component) {
    getFacesContext().getExternalContext().getRequestMap().put(getVarName(), component);
  }

  private void refreshVarValue() {
    YComponent component = getYComponent();
    getFacesContext().getExternalContext().getRequestMap().put(getVarName(), component);
  }
View Full Code Here

   *
   * @see javax.faces.component.UIComponentBase#processDecodes(javax.faces.context .FacesContext)
   */
  @Override
  public void processDecodes(FacesContext context) {
    YComponent restored = getYComponent();

    // it's possible that a previously unrenderable component can be renderable after a
    // faces request, in that case a YComponent instance isn't available yet
    if (restored != null) {

      // set 'var' before any child processing starts
      // this is necessary to assure that 'rendered' Attributes work properly
      this.setVarValue(restored);

      // only has an affect when component is backed by a writable
      // ValueBinding
      // XXX 1.2 simulate old behavior that non-framed components aren't
      // available
      if (restored.getFrame() != null) {
        this.setValue(restored);
      }

      // process childs
      if (isRendered()) {
View Full Code Here

  @Override
  public void processUpdates(FacesContext arg0) {
    // set 'var' value again
    // necessary when using this component within a loop
    final YComponent restored = getYComponent();
    if (restored != null) {
      this.setVarValue(restored);
      super.processUpdates(arg0);
    }
  }
View Full Code Here

  @Override
  public void processValidators(FacesContext arg0) {
    // set 'var' value again
    // necessary when using this component within a loop
    YComponent restored = getYComponent();
    if (restored != null) {
      this.setVarValue(restored);
      super.processValidators(arg0);
    }
  }
View Full Code Here

    super.encodeBegin(context);

    // retrieve some meta information
    YComponentInfo cmpInfo = this.getYComponentInfo();

    YComponent cmp = this.getOrCreateYComponent(cmpInfo);

    // generate some html debug output when enabled
    if (YFacesConfig.ENABLE_HTML_DEBUG.getBoolean()) {
      this.generateHtmlDebug(cmp, "Start ");
    }

    // inject attributes
    this.injectAttributes(cmpInfo, cmp);

    // invoke components postinitialize()
    cmp.validate();

    this.verifyRenderTimeID();

    // set YComponent
    this.setYComponent(cmp);
View Full Code Here

    }
    return cmpInfo;
  }

  private YComponent getOrCreateYComponent(YComponentInfo cmpInfo) {
    YComponent cmp = null;

    // retrieve passed value (ycomponent instance)
    ValueExpression binding = getYComponentBinding();
    Object _cmp = binding != null ? binding.getValue(getFacesContext().getELContext()) : null;

    // when no value was passed...
    if (_cmp == null) {
      // create default implementation
      cmp = cmpInfo.createDefaultComponent();

      // only has an affect when component is backed by a writable
      // ValueBinding
      this.setValue(cmp);
    } else {
      Set<ERROR_STATE> errors = cmpInfo.assertCustomImplementationClass(_cmp.getClass());
      if (!errors.isEmpty()) {
        throw new YFacesException(ERROR_STATE.getFormattedErrorMessage(errors, cmpInfo,
            _cmp.getClass()));
      }

      cmp = (YComponent) _cmp;

      // When created via a Frame a YComponent has per default no ID
      // in that case use UIComponent id (the unchanged one before
      // duplicate check)
      if (cmp.getId() == null) {
        ((AbstractYComponent) cmp).setId(getId());
      }

      log.debug(logId + "found valid Component (" + cmp.getClass().getSimpleName() + ")");
    }

    return cmp;
  }
View Full Code Here

TOP

Related Classes of de.hybris.yfaces.component.YComponent

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.