Package org.apache.myfaces.tobago.component

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


      throws IOException {
    if (renderErrorFocusId(facesContext, component)) {
      return;
    }
    if (ComponentUtil.getBooleanAttribute(component, ATTR_FOCUS)) {
      UIPage page = ComponentUtil.findPage(facesContext, component);
      String id = component.getClientId(facesContext);
      if (!StringUtils.isBlank(page.getFocusId()) && !page.getFocusId().equals(id)) {
        LOG.warn("page focusId = \"" + page.getFocusId() + "\" ignoring new value \""
            + id + "\"");
      } else {
        TobagoResponseWriter writer = HtmlRendererUtil.getTobagoResponseWriter(facesContext);
        writer.writeJavascript("Tobago.focusId = '" + id + "';");
      }
View Full Code Here


  private String style;

  public int doEndTag() throws JspException {

    FacesContext facesContext = FacesContext.getCurrentInstance();
    UIPage page = ComponentUtil.findPage(facesContext);
    if (page == null) {
      throw new JspException("The StyleTag cannot find the UIPage. "
          + "Check you have defined the StyleTag inside of the PageTag!");
    }

    if (style != null) {
      page.getStyleFiles().add(ComponentUtil.getValueFromEl(style));
    }

    if (bodyContent != null) {
      String classes = bodyContent.getString();
      bodyContent.clearBody();
      page.getStyleBlocks().add(ComponentUtil.getValueFromEl(classes));
    }

    return EVAL_PAGE;
  }
View Full Code Here

    attributes.put(TobagoConstants.ATTR_POPUP_CLOSE, "immediate");
    //cancelButton.setActionListener(datePickerController);

    applyConverterPattern(facesContext, popup, converterPattern);

    UIPage page = ComponentUtil.findPage(facesContext, link);
    page.getPopups().add(popup);

    if (!ComponentUtil.containsPopupActionListener(link)) {
      link.addActionListener(new PopupActionListener(popup.getId()));
    }
    super.encodeBegin(facesContext, component);
View Full Code Here

    PageWidthMapper(TagAttribute attribute) {
      this.attribute = attribute;
    }

    public void applyMetadata(FaceletContext ctx, Object instance) {
      UIPage page = (UIPage) instance;
      page.setWidth(new Integer(ComponentUtil.removePx(attribute.getValue())));
    }
View Full Code Here

    PageHeightMapper(TagAttribute attribute) {
      this.attribute = attribute;
    }

    public void applyMetadata(FaceletContext ctx, Object instance) {
      UIPage page = (UIPage) instance;
      page.setHeight(new Integer(ComponentUtil.removePx(attribute.getValue())));
    }
View Full Code Here

    // input suggest
    if (renderAjaxSuggest) {

      String popupId = id + SUBCOMPONENT_SEP + "ajaxPopup";

      final UIPage page = ComponentUtil.findPage(facesContext, input);
      page.getScriptFiles().add("script/effects.js");
      page.getScriptFiles().add("script/dragdrop.js");
      page.getScriptFiles().add("script/controls.js");
      page.getScriptFiles().add("script/inputSuggest.js");

      writer.startElement(HtmlConstants.DIV, null);
      writer.writeClassAttribute("tobago-in-suggest-popup");
      writer.writeStyleAttribute("display: none;");
      writer.writeIdAttribute(popupId);
      writer.endElement(HtmlConstants.DIV);

      final String[] scripts = new String[]{
          "script/effects.js",
          "script/dragdrop.js",
          "script/controls.js",
          "script/inputSuggest.js"
      };

      final String[] cmds = {
          "new Tobago.Autocompleter(",
          "    '" + id + "',",
          "    '" + page.getClientId(facesContext) + "',",
          "    { method:       'post',",
          "      asynchronous: true,",
          "      parameters: ''",
          "    });"
      };
View Full Code Here

  public boolean execute(FacesContext facesContext) {
    Map<String, UIComponent> ajaxComponents
        = AjaxUtils.parseAndStoreComponents(facesContext);
    if (ajaxComponents != null) {
      // first decode the page
      UIPage page = ComponentUtil.findPage(facesContext);
      page.decode(facesContext);
      page.markSubmittedForm(facesContext);

      // decode the action if actioncomponent not inside one of the ajaxcomponets
      // otherwise it is decoded there
      decodeActionComponent(facesContext, page, ajaxComponents);
View Full Code Here

  public void apply(FaceletContext faceletContext, UIComponent parent)
      throws IOException, FacesException, ELException {

    if (parent instanceof UIPage) {
      UIPage page = (UIPage) parent;
      if (style != null) {
        page.getStyleFiles().add(style.getValue(faceletContext));
      }
      StringBuffer buffer = new StringBuffer();
      Iterator iter = findNextByType(TextHandler.class);
      while (iter.hasNext()) {
        TextHandler text = (TextHandler) iter.next();
        buffer.append(text.getText(faceletContext));
      }
      String content = buffer.toString().trim();

      if (content.length() > 0) {
        page.getStyleBlocks().add(content);
      }
    } else {
      throw new TagException(tag, "Parent is not of type UIPage, type is: " + parent);
    }
  }
View Full Code Here

  private String height;

  private String applicationIcon;

  public int doEndTag() throws JspException {
    UIPage page = (UIPage) getComponentInstance();
    // TODO is this required?
    // clear popups;
    int result = super.doEndTag();
    page.getPopups().clear();

    // reseting doctype and charset
    return result;
  }
View Full Code Here


  public void encodeEnd(FacesContext facesContext,
      UIComponent component) throws IOException {
    UIOutput output = (UIOutput) component;
    UIPage page = ComponentUtil.findPage(facesContext, output);
    for (String script : SCRIPTS) {
      page.getScriptFiles().add(script);     
    }

    String id = output.getClientId(facesContext);

    String dateTextBoxId = (String) component.getAttributes().get(ATTR_CALENDAR_DATE_INPUT_ID);
View Full Code Here

TOP

Related Classes of org.apache.myfaces.tobago.component.UIPage

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.