Package org.apache.myfaces.tobago.webapp

Examples of org.apache.myfaces.tobago.webapp.TobagoResponseWriter.writeJavascript()


    images.append(ResourceManagerUtil.getImageWithPath(facesContext, "image/tobago-overlay-background.png"));
    images.append("';\n");
    images.append("Tobago.OVERLAY_WAIT = '");
    images.append(ResourceManagerUtil.getImageWithPath(facesContext, "image/tobago-overlay-wait.gif"));
    images.append("';\n");
    writer.writeJavascript(images.toString());

    if (debugMode) {
      final String[] jsFiles = new String[]{
          "script/effects.js",
          "script/dragdrop.js",
View Full Code Here


      };
      final String[] jsCommand = new String[]{"new LOG.LogArea({hide: " + hideClientLogging + "});"};
      HtmlRendererUtil.writeScriptLoader(facesContext, jsFiles, jsCommand);
    }
    //if (debugMode)  {
    writer.writeJavascript("TbgTimer.startBody = new Date();");
    //}

    writer.startElement(HtmlConstants.FORM, page);
    writer.writeNameAttribute(
        clientId + SUBCOMPONENT_SEP + "form");
View Full Code Here

      UIComponent hidden = component.getFacet("backButtonDetector");
      RenderUtil.encode(facesContext, hidden);
    }
    String lastFocusId = (String) component.getAttributes().get(LAST_FOCUS_ID);
    if (lastFocusId != null) {
      writer.writeJavascript("Tobago.lastFocusId = '" + lastFocusId + "';");
      component.getAttributes().remove(LAST_FOCUS_ID);
    }
    //checkForCommandFacet(component, facesContext, writer);

// TODO: this is needed for the "BACK-BUTTON-PROBLEM"
View Full Code Here

      HtmlRendererUtil.writeScriptLoader(facesContext, null,
          logMessages.toArray(new String[logMessages.size()]));
    }

    //if (debugMode) {
    writer.writeJavascript("TbgTimer.endBody = new Date();");
    //}

    writer.writeJavascript("setTimeout(\"Tobago.init('" + clientId + "')\", 1000)");

    writer.endElement(HtmlConstants.BODY);
View Full Code Here

    //if (debugMode) {
    writer.writeJavascript("TbgTimer.endBody = new Date();");
    //}

    writer.writeJavascript("setTimeout(\"Tobago.init('" + clientId + "')\", 1000)");

    writer.endElement(HtmlConstants.BODY);
    writer.endElement(HtmlConstants.HTML);

    if (LOG.isDebugEnabled()) {
View Full Code Here

    String tip = (String) component.getAttributes().get(TobagoConstants.ATTR_TIP);
    if (tip != null) {
      writer.writeAttribute(HtmlConstants.TITLE, tip, true);
    }
    if (TobagoConfig.getInstance(facesContext).isAjaxEnabled()) {
      writer.writeJavascript("Tobago.addAjaxComponent(\"" + clientId + "\")");
      Integer frequency = null;
      UIComponent facetReload = component.getFacet(FACET_RELOAD);
      if (facetReload != null && facetReload instanceof UIReload && facetReload.isRendered()) {
        UIReload update = (UIReload) facetReload;
        frequency = update.getFrequency();
View Full Code Here

    if (ComponentUtil.isError(input)) {
      if (!FacesContext.getCurrentInstance().getExternalContext().getRequestMap().containsKey(ERROR_FOCUS_KEY)) {
        FacesContext.getCurrentInstance().getExternalContext().getRequestMap().put(ERROR_FOCUS_KEY, Boolean.TRUE);
        TobagoResponseWriter writer = HtmlRendererUtil.getTobagoResponseWriter(facesContext);
        String id = input.getClientId(facesContext);
        writer.writeJavascript("Tobago.errorFocusId = '" + id + "';");
        return true;
      } else {
        return true;
      }
    }
View Full Code Here

      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 + "';");
      }
    }
  }

  public static void prepareRender(FacesContext facesContext, UIComponent component) {
View Full Code Here

        }
      }
    }
    script.append(");");

    writer.writeJavascript(script.toString());
  }

  public static void writeStyleLoader(
      FacesContext facesContext, String[] styles) throws IOException {
    TobagoResponseWriter writer = HtmlRendererUtil.getTobagoResponseWriter(facesContext);
View Full Code Here

    StringBuilder builder = new StringBuilder();
    builder.append("Tobago.ensureStyleFiles(\n    ");
    builder.append(ResourceManagerUtil.getStylesAsJSArray(facesContext, styles));
    builder.append(");");
    writer.writeJavascript(builder.toString());
  }

  public static String getTitleFromTipAndMessages(FacesContext facesContext, UIComponent component) {
    String messages = ComponentUtil.getFacesMessageAsString(facesContext, component);
    return HtmlRendererUtil.addTip(messages, component.getAttributes().get(ATTR_TIP));
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.