Examples of PageState


Examples of org.apache.myfaces.tobago.model.PageState

    updatePageState(facesContext, component);
  }

  public void updatePageState(FacesContext facesContext, UIComponent component) {
    if (component instanceof UIPage) {
      PageState state = ((UIPage) component).getPageState(facesContext);
      String name;
      String value = null;
      try {
        name = component.getClientId(facesContext)
            + SUBCOMPONENT_SEP + "form-clientDimension";
        value = (String) facesContext.getExternalContext()
            .getRequestParameterMap().get(name);
        if (value != null) {
          StringTokenizer tokenizer = new StringTokenizer(value, ";");
          int width = Integer.parseInt(tokenizer.nextToken());
          int height = Integer.parseInt(tokenizer.nextToken());
          if (state != null) {
            state.setClientWidth(width);
            state.setClientHeight(height);
          }
          facesContext.getExternalContext().getRequestMap().put("tobago-page-clientDimension-width", width);
          facesContext.getExternalContext().getRequestMap().put("tobago-page-clientDimension-height", height);
        }
      } catch (Exception e) {
View Full Code Here

Examples of org.apache.myfaces.tobago.model.PageState

    super.processUpdates(context);
    updatePageState(context);
  }

  public void updatePageState(FacesContext facesContext) {
    PageState state = getPageState(facesContext);
    decodePageState(facesContext, state);
  }
View Full Code Here

Examples of org.apache.myfaces.tobago.model.PageState

  }

  public PageState getPageState(FacesContext facesContext) {
    ValueBinding stateBinding = getValueBinding(ATTR_STATE);
    if (stateBinding != null) {
      PageState state = (PageState) stateBinding.getValue(facesContext);
      if (state == null) {
        state = new PageStateImpl();
        stateBinding.setValue(facesContext, state);
      }
      return state;
View Full Code Here

Examples of org.apache.myfaces.tobago.model.PageState

    updatePageState(facesContext, component);
  }

  public void updatePageState(FacesContext facesContext, UIComponent component) {
    if (component instanceof UIPage) {
      PageState state = ((UIPage) component).getPageState(facesContext);
      String name;
      String value = null;
      try {
        name = component.getClientId(facesContext)
            + SUBCOMPONENT_SEP + "form-clientDimension";
        value = (String) facesContext.getExternalContext()
            .getRequestParameterMap().get(name);
        if (value != null) {
          StringTokenizer tokenizer = new StringTokenizer(value, ";");
          int width = Integer.parseInt(tokenizer.nextToken());
          int height = Integer.parseInt(tokenizer.nextToken());
          if (state != null) {
            state.setClientWidth(width);
            state.setClientHeight(height);
          }
          facesContext.getExternalContext().getRequestMap().put("tobago-page-clientDimension-width", width);
          facesContext.getExternalContext().getRequestMap().put("tobago-page-clientDimension-height", height);
        }
      } catch (Exception e) {
View Full Code Here

Examples of org.apache.myfaces.tobago.model.PageState

      if (value != null) {
        StringTokenizer tokenizer = new StringTokenizer(value, ";");
        final Measure width = Measure.valueOf(tokenizer.nextToken());
        final Measure height = Measure.valueOf(tokenizer.nextToken());
        // XXX remove me later
        PageState pageState = page.getPageState(facesContext);
        if (pageState != null) {
          pageState.setClientWidth(width.getPixel());
          pageState.setClientHeight(height.getPixel());
        }
        final ClientProperties clientProperties = ClientProperties.getInstance(facesContext);
        clientProperties.setPageWidth(width);
        clientProperties.setPageHeight(height);
      }
View Full Code Here

Examples of org.apache.myfaces.tobago.model.PageState

      if (StringUtils.isNotBlank(value)) {
        StringTokenizer tokenizer = new StringTokenizer(value, ";");
        Measure width = Measure.parse(tokenizer.nextToken());
        Measure height = Measure.parse(tokenizer.nextToken());
        // XXX remove me later
        PageState pageState = page.getPageState(facesContext);
        if (pageState != null) {
          pageState.setClientWidth(width.getPixel());
          pageState.setClientHeight(height.getPixel());
        }
        facesContext.getExternalContext().getRequestMap().put("tobago-page-clientDimension-width", width);
        facesContext.getExternalContext().getRequestMap().put("tobago-page-clientDimension-height", height);
      }
    } catch (Exception e) {
View Full Code Here

Examples of org.apache.myfaces.tobago.model.PageState

  @Deprecated
  public PageState getPageState(FacesContext facesContext) {
    final ValueExpression expression = getValueExpression(Attributes.STATE);
    if (expression != null) {
      final ELContext elContext = facesContext.getELContext();
      PageState state = (PageState) expression.getValue(elContext);
      if (state == null) {
        state = new PageStateImpl();
        expression.setValue(elContext, state);
      }
      return state;
View Full Code Here

Examples of org.apache.myfaces.tobago.model.PageState

    super.processUpdates(context);
    updatePageState(context);
  }

  public void updatePageState(FacesContext facesContext) {
    PageState state = getPageState(facesContext);
    if (state != null) {
      decodePageState(facesContext, state);
    }
  }
View Full Code Here

Examples of org.apache.myfaces.tobago.model.PageState

  }

  public PageState getPageState(FacesContext facesContext) {
    ValueBinding stateBinding = getValueBinding(ATTR_STATE);
    if (stateBinding != null) {
      PageState state = (PageState) stateBinding.getValue(facesContext);
      if (state == null) {
        state = new PageStateImpl();
        stateBinding.setValue(facesContext, state);
      }
      return state;
View Full Code Here

Examples of org.apache.myfaces.tobago.model.PageState

   * @deprecated PageState is deprecated since 1.5.0
   */
  @Deprecated
  public PageState getPageState(FacesContext facesContext) {
    if (FacesUtils.hasValueBindingOrValueExpression(this, Attributes.STATE)) {
      PageState state = (PageState)
          FacesUtils.getValueFromValueBindingOrValueExpression(facesContext, this, Attributes.STATE);
      if (state == null) {
        state = new PageStateImpl();
        FacesUtils.setValueOfBindingOrExpression(facesContext, state, this, Attributes.STATE);
      }
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.