Package org.ajax4jsf.javascript

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


      function.addParameter(eventOptions);

      StringBuffer buffer = new StringBuffer();
      buffer.append(script);
      buffer.append(";");
      function.appendScript(buffer);
      buffer.append(";");
      return buffer.toString();
     
    } else if (UITree.SWITCH_SERVER.equals(tree.getSwitchType())) {
      String paramName = id + NODE_EXPANDED_INPUT_SUFFIX;
View Full Code Here


    if (sortable) {
      parameters.put(SORT_FILTER_PARAMETER, column.getClientId(context));
    }
    ajaxFunction.addParameter(eventOptions);
    StringBuffer buffer = new StringBuffer();
    ajaxFunction.appendScript(buffer);
   
    return buffer.toString();
  }
 
  protected class SimpleHeaderEncodeStrategy implements HeaderEncodeStrategy {
View Full Code Here

       
        parameters.put(component.getClientId(context), new JSLiteral("event.memo.page"));
       
        function.addParameter(eventOptions);
        StringBuffer buffer = new StringBuffer();
        function.appendScript(buffer);
        buffer.append("; return false;");

  String onPageChange = (String) component.getAttributes().get("onpagechange");
  if (onPageChange != null && onPageChange.length() != 0) {
      JSFunctionDefinition onPageChangeDef = new JSFunctionDefinition("event");
View Full Code Here

        } catch (JSONException e) {
        }
        dragOptions.addOption("dndParams", dndParams.toString());

        function.addParameter(dragOptions);
        function.appendScript(buffer);

        String scriptContribution = contributor.getScriptContribution(context,
                column);
        if (scriptContribution != null && scriptContribution.length() != 0) {
            buffer.append(scriptContribution);
View Full Code Here

        ScriptOptions dropOptions = contributor.buildOptions(context, column);
        JSONObject dndParams = new JSONObject();
        dropOptions.addOption("dndParams", dndParams.toString());

        function.addParameter(dropOptions);
        function.appendScript(buffer);

        String dropTargetScriptId = column.getClientId(context) + ":"
                + DROP_TARGET_SCRIPT_ID
                + (before ? DROP_TARGET_BEFORE : DROP_TARGET_AFTER);
        String scriptContribution = contributor.getScriptContribution(context,
View Full Code Here

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

      JSFunction function = AjaxRendererUtils.buildAjaxFunction(
          component, context, AJAX_POLL_FUNCTION);

      function.addParameter(new JSReference("$('" + clientId
          + "').component.options"));
      function.appendScript(script);

      pollScript.append(script);
    } else {
      pollScript.append(getStopPollScript(clientId));
    }
View Full Code Here

        JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(
            component, context,
            AJAX_FORM_FUNCTION_NAME);
        ajaxFunction.addParameter(AjaxRendererUtils.buildEventOptions(
            context, component));
        ajaxFunction.appendScript(onSubmit);
        writer.writeURIAttribute("action", onSubmit, "action");
      } else {
        encodeSubmitAction(writer, context);
      }
    } else {
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

        target.append("}").append(EOL);
    }

    protected void appendValidatorCall(Appendable target) throws IOException {
        JSFunction callValidator = new JSFunction(VALIDATE_FUNCTION_NAME, EVENT_REF, CLIENT_ID_REF, ELEMENT_REF, PARAMS_REF);
        callValidator.appendScript(target);
        target.append(EOL);
    }

    protected void appendAjaxParameter(Appendable target, String ajaxScript) throws IOException {
        target.append(AJAX).append(':');
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.