Package org.ajax4jsf.javascript

Examples of org.ajax4jsf.javascript.JSFunction.appendScript()


        ScriptOptions Optionssub = new ScriptOptions(component);
        Optionssub.addOption("onopen", component.getAttributes().get("onopen"));
        Optionssub.addOption("onclose", component.getAttributes().get("onclose"));
        Optionssub.addOption("direction", component.getAttributes().get("direction"));
        function.addParameter(Optionssub);
        function.appendScript(buffer);

    } else {
        buffer.append(".");
        function = new JSFunction("asDropDown");
        function.addParameter(component.getClientId(context));
View Full Code Here


        Options.addOption("oncollapse", component.getAttributes().get("oncollapse"));
        Options.addOption("onexpand", component.getAttributes().get("onexpand"));
        Options.addOption("onitemselect", component.getAttributes().get("onitemselect"));
        Options.addOption("ongroupactivate", component.getAttributes().get("ongroupactivate"));
        function.addParameter(Options);
        function.appendScript(buffer);

    }

    List children = component.getChildren();
    for(Iterator it = children.iterator();it.hasNext();) {
View Full Code Here

                  options.addOption("flagGroup", new Integer(flagGroup));
                  String tmp = (String)kid.getAttributes().get("selectClass");
                  if (tmp != null && tmp.length() > 0) options.addOption("selectClass", tmp);
          function.addParameter(options);
          buffer.append('.');
          function.appendScript(buffer);
      }
    }

    ResponseWriter out = context.getResponseWriter();
    String script =buffer.append(";").toString();
View Full Code Here

        Map eventOptions = AjaxRendererUtils.buildEventOptions(context,
            child);
        function.addParameter(eventOptions);
       
        buffer.append(",\"");
        function.appendScript(buffer);
        buffer.append("\"");
  }
 
  protected void addOnItemHover(String menuOnItemHover, UIComponent child, StringBuffer buffer) {
        buffer.append(",\"");
View Full Code Here

        parameters.put(param.getName(),param.getValue());
      }
    }
    submit.addParameter(parameters);
    onclick.append("return ");
    submit.appendScript(onclick);
    writer.writeAttribute(HTML.onclick_ATTRIBUTE,onclick,"onclick");
    //
    encodeValue(writer,context,component);
  }
View Full Code Here

    // sync true/false - run script in sync mode.
    // ..........
    ajaxFunction.addParameter(buildEventOptions(facesContext, uiComponent));

    // appendAjaxSubmitParameters(facesContext, uiComponent, onEvent);
    ajaxFunction.appendScript(onEvent);
    if (uiComponent instanceof AjaxSupport) {
      AjaxSupport support = (AjaxSupport) uiComponent;
      if (support.isDisableDefault()) {
        onEvent.append("; return false;");
      }
View Full Code Here

      JSFunction f = new JSFunction("DialogContext.submitDialogAction");
      f.addParameter(formId);
      f.addParameter(component.getClientId(context));
      f.addParameter(AjaxRendererUtils.buildEventOptions(context, component));
      superOnClick = new StringBuffer();
      f.appendScript(superOnClick);
      superOnClick.append(';');
      if (!"reset".equals(component.getAttributes().get("type"))) {
        superOnClick.append("return false;");
      }
    } else {
View Full Code Here

      JSFunction f = new JSFunction("DialogContext.submitDialogAction");
      f.addParameter(formId);
      f.addParameter(component.getClientId(context));
      f.addParameter(AjaxRendererUtils.buildEventOptions(context, component));
      f.appendScript(sb);
      sb.append(';');

      if (!"reset".equals(component.getAttributes().get("type"))) {
        sb.append("return false;");
      }
View Full Code Here

    JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(uiComponent, facesContext);
    ajaxFunction.addParameter(new JSReference("options"));

    // appendAjaxSubmitParameters(facesContext, uiComponent, onEvent);
    onEvent.append("try {");
    ajaxFunction.appendScript(onEvent);
    onEvent.append("} catch (e) {alert('Error in onclick: ' + e.message);}");
   
    if (uiComponent instanceof AjaxSupport) {
      AjaxSupport support = (AjaxSupport) uiComponent;
      if (support.isDisableDefault()) {
View Full Code Here

    // parameters - map of parameters name/value for append on request.
    // ..........
    ajaxFunction.addParameter(buildEventOptions(facesContext, uiComponent, omitDefaultActionUrl));

    // appendAjaxSubmitParameters(facesContext, uiComponent, onEvent);
    ajaxFunction.appendScript(onEvent);
    if (uiComponent instanceof AjaxSupport) {
      AjaxSupport support = (AjaxSupport) uiComponent;
      if (support.isDisableDefault()) {
        onEvent.append("; return false;");
      }
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.