32.11. <ajax:status>

使用AjaxStatus可以在发送和完成AJAX请求时获得回调。

32.11.1. 构件信息

表 32.25. 构件信息

Component Typeorg.operamasks.faces.component.ajax.AjaxStatus
Component Familyorg.operamasks.faces.AjaxStatus
Component Classorg.operamasks.faces.component.ajax.AjaxStatus
Tag Classorg.operamasks.faces.webapp.ajax.AjaxStatusTag
Renderer Typeorg.operamasks.faces.component.ajax.AjaxStatus
Renderer Class(AJAX)org.operamasks.faces.render.ajax.AjaxStatusRenderer

继承体系

+java.lang.Object

++javax.faces.component.UIComponent

+++javax.faces.component.UIComponentBase

++++org.operamasks.faces.component.ajax.base.AjaxStatusBase

+++++org.operamasks.faces.component.ajax.AjaxStatus

32.11.2. 属性

表 32.26. 属性

binding 定义类 javax.faces.component.UIComponentBase
类型 javax.el.ValueExpression(javax.faces.component.UIComponent)
是否必须 延时求值
一个值表达式,用于把该组件链接到一个ManagedBean的某个属性。
id 定义类 javax.faces.component.UIComponentBase
类型 java.lang.String
是否必须 延时求值
这个组件的组件标识符。这个值在最近的命名容器类型的父组件范围内,必须是唯一的。
layout 定义类 org.operamasks.faces.component.ajax.AjaxStatus
类型 javax.el.ValueExpression(java.lang.String)
是否必须 延时求值
渲染这个组时使用的布局类型。如果这个值是"block",则渲染成HTML的"div"元素,否则渲染成"span"元素
onstart 定义类 org.operamasks.faces.component.ajax.AjaxStatus
类型 javax.el.ValueExpression(java.lang.String)
是否必须 延时求值
用户提供的一段Javascript脚本,在发送AJAX请求前会被执行
onstop 定义类 org.operamasks.faces.component.ajax.AjaxStatus
类型 javax.el.ValueExpression(java.lang.String)
是否必须 延时求值
用户提供的一段Javascript脚本,在接收到AJAX响应后会被执行
rendered 定义类 javax.faces.component.UIComponentBase
类型 boolean(boolean)
是否必须 延时求值
一个标志,指出该组件是否要在任何随后的form提交过程中被渲染或处理。 这个属性的缺省值是true。
startStyle 定义类 org.operamasks.faces.component.ajax.AjaxStatus
类型 javax.el.ValueExpression(java.lang.String)
是否必须 延时求值
停止时的CSS样式, 对应于元素的style属性
startStyleClass 定义类 org.operamasks.faces.component.ajax.AjaxStatus
类型 javax.el.ValueExpression(java.lang.String)
是否必须 延时求值
开始时的CSS样式, 对应于元素的class属性
stopStyle 定义类 org.operamasks.faces.component.ajax.AjaxStatus
类型 javax.el.ValueExpression(java.lang.String)
是否必须 延时求值
停止时的CSS样式, 对应于元素的style属性
stopStyleClass 定义类 org.operamasks.faces.component.ajax.AjaxStatus
类型 javax.el.ValueExpression(java.lang.String)
是否必须 延时求值
停止时的CSS样式, 对应于元素的class属性
style 定义类 org.operamasks.faces.component.ajax.AjaxStatus
类型 javax.el.ValueExpression(java.lang.String)
是否必须 延时求值
构件渲染时应用到构件的CSS风格,对应于元素的style属性。这个属性的值是默认值,当startStyle或stopStyle没指定时采用
styleClass 定义类 org.operamasks.faces.component.ajax.AjaxStatus
类型 javax.el.ValueExpression(java.lang.String)
是否必须 延时求值
构件渲染时应用到构件的CSS风格,对应于元素的class属性。这个属性的值是默认值,当startStyle或stopStyle没指定时采用

32.11.3. 构件API

32.11.4. 例子

<h:form>
 <h:commandButton id="submit" value="submit" action="#{DemoBean.delay}"/><p> 
   <ajax:status startStyle="color: red" 
        onstart="document.getElementsByTagName('body').item(0).style.cursor='progress'"
        onstop="document.getElementsByTagName('body').item(0).style.cursor='auto'">
       <f:facet name="start">
         <f:verbatim><img src="images/indicator.gif"> Loading...</f:verbatim>
       </f:facet>
    </ajax:status> 
</h:form>