Is there any difference between f:ajax and a4j:ajax?

前端 未结 2 1169
时光说笑
时光说笑 2020-12-09 05:45

Is there any significant difference between f:ajax and a4j:ajax tags?

I know about a4j:ajax from Richfaces 4 is based on native f:ajax JSF

2条回答
  •  旧时难觅i
    2020-12-09 06:44

    The tag is just the more convenient form of the basic tag. You can find a nice overview of all differences in this page.

    The execute attribute supports an extra @region value pointing to the . Any EL in execute and render attributes is resolved in current request instead of in initial request.

    The JS function of the onevent attribute of both tags will be invoked 3 times (the passed-in data.status has then the values begin, complete, success). This forces you to use a switch or if when you're only interested in one of them or want to treat them differently. The makes this more convenient with onbegin, onbeforedomupdate and oncomplete attributes respectively. See also this related question: JSF 2: How show different ajax status in same input?

    If you're not interested in any of those enhancements, then using should be perfectly fine as well. The performance difference is (and must be) totally negligible and not be the reason to choose one over the other.

提交回复
热议问题