PrimeFaces.ab功能 [英] PrimeFaces.ab function

查看:105
本文介绍了PrimeFaces.ab功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

似乎找不到PrimeFaces.ab函数的文档

Cant seem to find documentation for PrimeFaces.ab function

PrimeFaces.ab({source:'signupForm:signupButton'});
return false;

任何人都可以帮我解决上面代码的意图吗?它是针对提交按钮的 onclick 编写的。

Can anybody help me with what the code above is meant to do? It has been written against the onclick of a submit button.

推荐答案

PrimeFaces.ab 功能是 PrimeFaces.ajax.AjaxRequest

    //ajax shortcut
    ab: function(cfg, ext) {
        return PrimeFaces.ajax.AjaxRequest(cfg, ext);
    }

PrimeFaces.ajax.AjaxRequest 可以是异步的或同步的。
AjaxRequest 使用 AjaxUtils ,它处理所有发送,处理,响应和更新。

The PrimeFaces.ajax.AjaxRequest can be asynchronous or synchronous. The AjaxRequest uses the AjaxUtils, which handles all send, process, response, and update.

PrimeFaces.ajax.AjaxRequest = function(cfg, ext) {
    cfg.ext = ext;

    if(cfg.async) {
        return PrimeFaces.ajax.AjaxUtils.send(cfg);
    }
    else {
        return PrimeFaces.ajax.Queue.offer(cfg);
    }
}

将cfg(配置)对象传递给 PrimeFaces.ajax.AjaxUtils.send(cfg),此cfg对象具有:

Passing a cfg (configuration) object to the PrimeFaces.ajax.AjaxUtils.send(cfg), this cfg object has:


  • cfg.global :一个布尔值,用于触发 p:ajaxStatus 如果是真的。

  • cfg.onstart :在发送请求时调用。

  • cfg.async :一个布尔值,如果此调用是异步的话。

  • cfg.source :可以是客户ID或由此关键字定义的元素

  • cfg.formId :如果定义了明确的表单,或者它会查看父源

  • cfg.resetValues

  • cfg.ignoreAutoUpdate

  • cfg.fragmentId :用于组件流程

  • cfg.fragmentUpdate

  • cfg.event :行为事件,例如点击或更改

  • cfg.params :请求参数

  • cfg.partialSubmit :如果启用了部分提交,则有部分处理的组件

  • cfg.onerror :在请求出现错误状态时调用。

  • cfg.onsuccess :在请求成功状态时被调用。

  • cfg.oncomplete :在请求完成时调用。

  • cfg.global: a boolean value used to trigger p:ajaxStatus if it's a true.
  • cfg.onstart: to be called when the request is to be send.
  • cfg.async: a boolean value, where if this call is asynchronous or not.
  • cfg.source: can be a client id or an element defined by this keyword
  • cfg.formId: if an explicit form is defined, or it would look into a parent source
  • cfg.resetValues
  • cfg.ignoreAutoUpdate
  • cfg.fragmentId: used for the process of the components
  • cfg.fragmentUpdate
  • cfg.event: behaviour event, like click or change
  • cfg.params: request params
  • cfg.partialSubmit: if partial submit is enabled, there are components to process partially
  • cfg.onerror: to be called when the request had an error status.
  • cfg.onsuccess: to be called when the request had a success status.
  • cfg.oncomplete: to be called when the request is completed.

注意:根据我对源代码的理解,我想出了这个解释。

Note: I came up with this explanation based on my understanding of the source code.

您也可以参考这个回答,可能会有所帮助。

Also you can refer to this answer, might be helpful.

这篇关于PrimeFaces.ab功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆