Package org.ajax4jsf.javascript

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


    // 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


        function.addParameter(component.getAttributes().get("hideDelay"));
        } else {
          function.addParameter(new Integer(300));
        }
       
    function.appendScript(buffer);
   
    if (component instanceof UIMenuGroup) {
        buffer.append(".");
        function = new JSFunction("asSubMenu");
        function.addParameter(component.getParent().getClientId(context)+"_menu");
View Full Code Here

        subMenuOptions.addEventHandler("onopen");
        subMenuOptions.addEventHandler("onclose");
        subMenuOptions.addOption("direction");
        subMenuOptions.addOption("highlightParent", Boolean.TRUE);
        function.addParameter(subMenuOptions);
        function.appendScript(buffer);

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

        menuOptions.addEventHandler("onexpand");
        menuOptions.addEventHandler("onitemselect");
        menuOptions.addEventHandler("ongroupactivate");
        menuOptions.addOption("disabled");
        function.addParameter(menuOptions);
        function.appendScript(buffer);

    }
   
    return buffer.toString();
  }
View Full Code Here

         
      StringBuffer script = new StringBuffer();
      JSFunction function = new JSFunction("new Richfaces.PanelBar");
      function.addParameter(panelBar.getClientId(context));
      function.addParameter(options);
      function.appendScript(script);
     
      ResponseWriter writer = context.getResponseWriter();
      writer.startElement(HTML.SCRIPT_ELEM, panelBar);
      writer.writeAttribute(HTML.TYPE_ATTR, "text/javascript", null);
      String outerScript = script.append(";").toString();
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

        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

         
      StringBuffer script = new StringBuffer();
      JSFunction function = new JSFunction("new Richfaces.PanelBar");
      function.addParameter(panelBar.getClientId(context));
      function.addParameter(options);
      function.appendScript(script);
     
      ResponseWriter writer = context.getResponseWriter();
      writer.startElement(HTML.SCRIPT_ELEM, panelBar);
      writer.writeAttribute(HTML.TYPE_ATTR, "text/javascript", null);
      String outerScript = script.append(";").toString();
View Full Code Here

   
    DnDParametersEncoder parametersEncoder = DnDParametersEncoder.getInstance();
    dragOptions.addOption("dndParams", parametersEncoder.doEncodeAsString(context, component));
   
    function.addParameter(dragOptions);
    function.appendScript(buffer);

    String scriptContribution = contributor.getScriptContribution(context, component);
    if (scriptContribution != null && scriptContribution.length() != 0) {
      buffer.append(scriptContribution);
    }
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

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.