Package org.ajax4jsf.javascript

Examples of org.ajax4jsf.javascript.JSReference


  public static JSFunction buildAjaxFunction(UIComponent uiComponent,
      FacesContext facesContext) {
    JSFunction ajaxFunction = buildAjaxFunction(uiComponent, facesContext,
        AJAX_FUNCTION_NAME);
    // client-side script must have reference to event-enabled object.
    ajaxFunction.addParameter(new JSReference("event"));
    return ajaxFunction;
  }
View Full Code Here


    }*/
  }
 
  protected List getScriptPanelBarItems(FacesContext context,UIPanelBar panelBar){
    List items = new ArrayList();
    JSReference id_ref = new JSReference("id");
   
    List children = panelBar.getChildren();
    for (Iterator iterator = children.iterator(); iterator.hasNext();) {
      UIComponent child = (UIComponent) iterator.next();

View Full Code Here

  {
    String targetId = HtmlUtil.idsToIdSelector(getFor());

    targetId = HtmlUtil.expandIdSelector(targetId, this, FacesContext.getCurrentInstance());
    JSFunction invocation = new JSFunction("Richfaces.componentControl.performOperation");
    invocation.addParameter(new JSReference("event"));
    //FIXME: Maksim
    //Replacement looks ugly - move that functionality to HtmlUtil
    invocation.addParameter(replaceBackSlashes(targetId));
    invocation.addParameter(getOperation());
    invocation.addParameter(new JSReference("{" + getEncodedParametersMap() + "}"));
    invocation.addParameter(Boolean.valueOf(isDisableDefault()));
   
    return invocation.toScript();

View Full Code Here

          result.append(", ");
        }

        ScriptUtils.addEncodedString(result, name);
        result.append(": ");
        result.append(ScriptUtils.toScript(escape ? value : new JSReference(value.toString())));
       
        shouldClose = true;
      }
    }
   
View Full Code Here

    if (oncomplete != null) {
      oncompleteDefinition.addToBody(oncomplete);
    }

    options.put("oncomplete", oncompleteDefinition);
    JSReference requestValue = new JSReference("requestValue");
    ajaxFunction.addParameter(options);
    JSFunctionDefinition definition = new JSFunctionDefinition();
    definition.addParameter(requestValue);
    definition.addToBody(ajaxFunction);
    writer.write(definition.toScript());
View Full Code Here

    }*/
  }
 
  protected List getScriptPanelBarItems(FacesContext context,UIPanelBar panelBar){
    List items = new ArrayList();
    JSReference id_ref = new JSReference("id");
   
    List children = panelBar.getChildren();
    for (Iterator iterator = children.iterator(); iterator.hasNext();) {
      UIComponent child = (UIComponent) iterator.next();

View Full Code Here

        definition.addParameter("event");
        definition.addParameter("columnId");
        definition.addParameter("menuId");
        JSFunction invocation = new JSFunction(
                "Richfaces.componentControl.performOperation");
        invocation.addParameter(new JSReference("event"));
        invocation.addParameter(new JSReference("event.type"));
        invocation.addParameter(new JSReference("menuId"));
        invocation.addParameter("show");
        // invocation.addParameter(new JSReference("{'columnId':columnId}"));
        invocation.addParameter(new JSReference("{}"));
        invocation.addParameter(Boolean.FALSE);
        definition.addToBody(invocation.toScript()).addToBody(";\n");
        return definition;
    }
View Full Code Here

        UIParameter parameter = (UIParameter) kid;
        String name = parameter.getName();
        Object value = parameter.getValue();

        if ((parameter instanceof JavaScriptParameter) && ((JavaScriptParameter) parameter).isNoEscape()) {
      value = new JSReference(String.valueOf(value));
        }

        params.put(name, value);
    }
      }
View Full Code Here

       
        targetId = HtmlUtil.expandIdSelector(targetId, this, FacesContext
                .getCurrentInstance());
       
        JSFunction invocation = new JSFunction("Richfaces.componentControl.performOperation");
        invocation.addParameter(new JSReference("event"));
        addOptions(invocation, getEvent(), targetId, getOperation());
       
        return invocation.toScript();
    }
View Full Code Here

            }
           
            ScriptUtils.addEncodedString(result, name);
            result.append(": ");
            result.append(ScriptUtils.toScript(escape ? value
                    : new JSReference(value.toString())));
           
            shouldClose = true;
        }
       
        return result.toString();
View Full Code Here

TOP

Related Classes of org.ajax4jsf.javascript.JSReference

Copyright © 2018 www.massapicom. 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.