Package org.apache.myfaces.tobago.webapp

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


      HtmlRendererUtils.writeScriptLoader(facesContext, jsFiles, jsCommand);
      writer.writeJavascript("TbgTimer.startBody = new Date();");
    }
*/
    if (debugMode) {
      writer.writeJavascript("TbgTimer.startBody = new Date();");
    }

    writer.startElement(HtmlElements.FORM, page);
    writer.writeAttribute(HtmlAttributes.ACTION, formAction, true);
    writer.writeIdAttribute(page.getFormId(facesContext));
View Full Code Here


      RenderUtils.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);
View Full Code Here

      String title = (String) page.getAttributes().get(Attributes.LABEL);

      writer.startElement(HtmlElements.HEAD, null);

      if (debugMode) {
        writer.writeJavascript("var TbgHeadStart = new Date();");
      }

      // meta
      // this is needed, because websphere 6.0? ignores the setting of the content type on the response
      writer.startElement(HtmlElements.META, null);
View Full Code Here

    writer.startElement(HtmlElements.DIV, box);
    HtmlRendererUtils.renderDojoDndItem(box, writer, true);
    writer.writeClassAttribute(Classes.create(box));
    writer.writeIdAttribute(clientId);
    writer.writeStyleAttribute(new Style(facesContext, box));
    writer.writeJavascript("Tobago.addAjaxComponent(\"" + clientId + "\");");
    encodeBox(facesContext, writer, box);
  }

  private void encodeBox(FacesContext facesContext, TobagoResponseWriter writer, UIBox box) throws IOException {
View Full Code Here

    for (String script : scripts) {
      scriptFiles.add(script);
    }

    if (!TobagoConfig.getInstance(facesContext).isAjaxEnabled()) {
      writer.writeJavascript(scriptText);
    } else {
      HtmlRendererUtil.writeScriptLoader(facesContext, scripts,
          new String[] {scriptText.replace('\n', ' ')});
    }
View Full Code Here

    writer.endElement(HtmlConstants.SPAN);
    UIComponent facet = component.getFacet("complete");
    if (model.getValue() == model.getMaximum() && facet != null
        && facet instanceof UICommand) {
      UICommand command = (UICommand) facet;
      writer.writeJavascript("Tobago.submitAction2(this, '" + command.getClientId(facesContext) + "', null, null);");
    }
  }
}
View Full Code Here

    writer.startElement(HtmlConstants.HEAD, null);
    final boolean debugMode =
            ClientProperties.getInstance(facesContext.getViewRoot()).isDebugMode();

    //if (debugMode) {
    writer.writeJavascript("var TbgHeadStart = new Date();");
    //}

    // meta
    // this is needed, because websphere 6.0? ignores the setting of the content type on the response
    writer.startElement(HtmlConstants.META, null);
View Full Code Here

    }

    // focus id
    String focusId = page.getFocusId();
    if (focusId != null) {
      writer.writeJavascript("Tobago.focusId = '" + focusId + "';");
    }

    if (component.getFacets().containsKey(FACET_ACTION)) {
      UIComponent command = component.getFacet(FACET_ACTION);
      if (command != null && command.isRendered()) {
View Full Code Here

        command = facet;
      } else if (facet instanceof UIForm && facet.getChildCount() == 1) {
        command = (UIComponent) facet.getChildren().get(0);
      }
      if (command != null && command.isRendered()) {
        writer.writeJavascript("Tobago.resizeActionId = '" + command.getClientId(facesContext) + "';");
      }
    }

    StringBuilder script = new StringBuilder(128);
View Full Code Here

        LOG.debug("write scriptblock " + ++debugCounter + " :\n" + scriptBlock);
      }
      script.append(scriptBlock);
      script.append('\n');
    }
    writer.writeJavascript(script.toString());

    String clientId = page.getClientId(facesContext);

    String defaultActionId = page.getDefaultActionId() != null ? page.getDefaultActionId() : "";
    writer.endElement(HtmlConstants.HEAD);
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.