a4j:status
在客户端呈现一个表现ajax请求状态的标识.
在编码过程中:
创建两个带有id的该组件的子(clientId )span元素,或者添加了":status.start" 和
":status:stop" 字符串的 ajax区域的目标(使用for属性来指定). "start" span 具有
"display:none" style (隐藏).在span里面,呈现startText/stopText属性值或者如果"start" 和
"stop" facets存在的话,呈现facets的内容. 在执行一个ajax请求时, 客户端的js代码改变 "start" span
的可见属性并且隐藏"stop". 当该指示器所指示的请求都完成时,恢复"stop" 并且隐藏"start"
.start[style,styleClass] 和 stop[style,styleClass] 被呈现为 spans 的 style 和
class 属性 .
During Encoding: Creates two "span" elements with id created as
clientId of this component or of target AJAX region (pointed to by the
"for" property) with appended ":status.start" and ":status:stop"
strings. "start" span has "display:none" style (hidden). Inside this
span, renders the value of the startText/stopText properties or, if
they exist, the content of "start" and "stop" facets. On performing an
AJAX request, the client-side script changes the visibility of the
"start" span and hides "stop". After all requests for this indicator
are completed, restores "stop" and hide "start" start[style,styleClass]
and stop[style,styleClass] are rendered for spans as style and class
atributes, respectivetly.
在解码的过程中:
....
Creates two "span" or "div"(depending on 'layout' attribute)
elements with id created as clientId of this component or of target
AJAX region (pointed to by the "for" property) with appended
":status.start" and ":status:stop" strings. "start" element has
"display:none" style (hidden). Inside this element, renders the value
of the startText/stopText properties or, if they exist, the content of
"start" and "stop" facets. On performing an AJAX request, the
client-side script changes the visibility of the "start" element and
hides "stop". After all requests for this indicator are completed,
restores "stop" and hide "start" start[style,styleClass] and
stop[style,styleClass] are rendered for spans as style and class
atributes, respectivetly.
Table 4.9. a4j:status attributes
startStyleClass
在开始一个请求时应用到组件上的CSS类
stopStyle
在 一个请求响应完成时应用到组件上的CSS
stopStyleClass
在 一个请求响应完成时应用到组件上的CSS类
layout
定义面板的布局,可以为block或者inline
title
该组件产生的标记元素的提示文字(当鼠标移动到该组件上面出现的提示文字)
rendered
如果为false,该组件将不会被显示.
id
每个组件都应该有个唯一的id. 如果没有指定的话,将会自动产生.
dir
文本方向.
styleClass
和HTML的class属性一样.
startStyle
在开始一个请求时应用到组件上的CSS类
onkeypress
键盘事件,键被按下和松开
ondblclick
HTML: 双击事件
style
HTML: 应用在该组件上的CSS.
onmouseover
当滑鼠移动到组件上方时
for
指定应用于 AjaxContainer组件的ID ( 在javax.faces.UIComopnent.findComponent() 中使用).
onkeyup
当使用者按下并放开按键
lang
产生该组件标记所使用的语言
onclick
当鼠标点击时发生的事件
onmouseout
鼠标光标移开元素时发生的事件
startText
在请求开始时显示的文本
onkeydown
键按下时发生的事件
onmousedown
按下鼠标按键时发生的事件
forceId
如果为true,呈现组件id为HTML代码而不是JSF产生的代码.(译者注:参考Myfaces中的ForceId.)
stopText
当请求完成时显示的文本
onmouseup
当释放鼠标按键时发生的事件
binding
组件绑定.
onmousemove
鼠标光标在元素上移动时发生的事件
指示请求状态的两种表示方式:
定义 "startText" 和 "stopText" 属性
stopText="Request Done"
for="stat1"/>
定义 "start" 和 "stop" facets
在任何一种状态下,当请求开始时 - ":status.start" span 将被呈现 并且在请求结束后":status.stop" span 将出现.
将状态应用到组件上也有两种方法:
指定目标 AJAX Containers 的id为“for” 属性的值
在组件上定义 “status” 属性 指定到状态.
如果for省略了 - 状态组件将指向它所在的区域(status component will be pointed to region where it's placed )