Package org.ajax4jsf.javascript

Examples of org.ajax4jsf.javascript.JSReference


        definition
                .addToBody("options.parameters['columnWidths'] = columnWidths;\n");

        JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(table,
                context);
        ajaxFunction.addParameter(new JSReference("options"));
        definition.addToBody(ajaxFunction.toScript()).addToBody(";\n");
        return definition;
    }
View Full Code Here


    public String getOnClick(FacesContext context, UIComponent component) {
        UISimpleTogglePanel tgComp = (UISimpleTogglePanel) component;

        String switchType = tgComp.getSwitchType();
        StringBuffer onClick = new StringBuffer();
      JSReference eventRef = new JSReference("event");
      String panelId = tgComp.getClientId(context);

  if (UISimpleTogglePanel.CLIENT_SWITCH_TYPE.equals(switchType)) {
            // Client
            JSFunction function = new JSFunction("SimpleTogglePanelManager.toggleOnClient");
View Full Code Here

      if (slider.isSubmitOnSlide()) {
      options.append(",onSlideSubmit: function(event, v) { updateSlider1(event, v);}");
  }
        options.append("}");

        JSReference reference = new JSReference(options.toString());
       
      JSFunction function = new JSFunction("Richfaces.DFSControl.Slider");
      function.addParameter(clientId + "slider-handle");
      function.addParameter(clientId + "slider-track");
      function.addParameter(reference);
View Full Code Here

    .buildAjaxFunction(tree, context);
    Map eventOptions = AjaxRendererUtils.buildEventOptions(context, tree);
    Map parameters = (Map) eventOptions.get("parameters");
    parameters.remove(id);
    parameters.put(id + UITree.SELECTED_NODE_PARAMETER_NAME,
        new JSReference("event.selectedNode"));
    function.addParameter(eventOptions);
    StringBuffer buffer = new StringBuffer();
    function.appendScript(buffer);
    buffer.append("; return false;");
    return buffer.toString();
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

  public String getActionScript(FacesContext context, UIComponent component) throws IOException {
    String clientId = component.getClientId(context);
    JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(component, context);

    Map<String, Object> parameters = new HashMap<String, Object>();
    parameters.put(FileUploadConstants.FILE_UPLOAD_ACTION, new JSReference("action"));
    parameters.put(FileUploadConstants.UPLOAD_FILES_ID, new JSReference("uid"));
    parameters.put(AjaxRendererUtils.AJAX_SINGLE_ATTR, clientId);
   
    Map options = AjaxRendererUtils.buildEventOptions(context, component, parameters, true);
    options.put("onbeforedomupdate", new JSReference("callback"));
   
    ajaxFunction.addParameter(options);

    JSFunctionDefinition function = new JSFunctionDefinition("uid", "action", "callback");
    function.addParameter("event");
View Full Code Here

  public JSReference getIsDayEnabled(FacesContext context, UIComponent component) {
    UICalendar calendar = (UICalendar) component;
    String isDayEnabled = (String) calendar.getAttributes().get(
        "isDayEnabled");
    if (isDayEnabled != null && isDayEnabled.length() != 0) {
      return new JSReference(isDayEnabled); //new JSFunction(isDayEnabled);
    }
   
    return null;
  }
View Full Code Here

  public JSReference getDayStyleClass(FacesContext context, UIComponent component) {
    UICalendar calendar = (UICalendar) component;
    String dayStyleClass = (String) calendar.getAttributes().get(
        "dayStyleClass");
    if (dayStyleClass != null && dayStyleClass.length() != 0) {
      return new JSReference(dayStyleClass);
    }
   
    return null;
  }
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);
    return definition;
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

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.