警报行为显示警报或确认消息框。如果显示的是警报消息框,则该消息框关闭后,处理将停止。如果显示的是确认消息框,并且用户选择了“取消”或“否”,则处理将停止。
<input type="submit" >
<input type="reset" >
<input type="button" >
<input type="image" >
hX_5.addBehavior("id", "onclick", new hX_5.JSFBehaviorAlert(attributes)); 其中
id |
组件所连接至的 HTML 标记的 ID。 |
属性 |
逗号分隔的属性列表,其中每个属性都是一个加引号的字符串,此字符串包含使用冒号分隔的属性名称和值,例如,"label:MyLabel"。 |
事件 |
描述 |
---|---|
onclick |
仅在 <hx:panelActionbar> 的实现中使用。 |
属性名称 |
描述 |
---|---|
message |
要显示的消息。 |
prompt-type |
0 显示警报消息框。1 显示确认消息框。 |
在为该事件提供的任何其他处理程序运行完成后运行。
如果操作是警报,则停止进行事件继续/冒泡。否则,如果用户对确认消息回答“否”,则停止该事件。
API 调用 |
描述 |
---|---|
object = setAttribute(attribute) |
设置属性,或如果以前已设置属性,则更改其值。 |
string = getAttribute(attribute-name) |
检索属性的当前值。 |
当按钮被单击时,确认用户是否要执行提交。
hX.addBehavior("form1:button1c", "onclick", new hX.JSFBehaviorAlert("message:Submit this page?","prompt-type:1" ));