API
Component

MessageDialog ($UI/system/components/justep/messageDialog/messageDialog)

使用范围:UI2

Contents

component MessageDialog ($UI/system/components/justep/messageDialog/messageDialog) extends BindComponent

<b>使用场景</b>:信息提示窗口,用户可以做选择或取消的操作,以及有输入框的询问; <b>使用方法</b>:添加组件后,可以设置提示的内容,定义用户选择确定或取消后的操作提示窗口; ## <b>文档链接</b>:#http://docs.newdao.net/zhuo-mian-nei-rong-zu-jian/xiao-xi-dui-hua-kuang.html#

Constructor Top

  MessageDialog ()
  MessageDialog ( options)

Properties Top

string inputValue

type==Prompt时input的值

string message

提示信息,支持html格式

string title

标题

string type

类型,取值范围:OK,OKCancel,YesNo,YesNoCancel,Prompt

string width

对话框宽度,高根据内容自动,默认值:270px

Attributes Top

string inputValue

type==Prompt时input的值

string message

提示信息,支持html格式

string title

标题

string type

类型,取值范围:OK,OKCancel,YesNo,YesNoCancel,Prompt

string width

对话框宽度,高根据内容自动,默认值:270px

string xid

组件标示

Methods Top

Object get (String name)
void set (JSON arg)
void show (JSON arg)

Operations Top

show (JSON arg)

Events Top

void onCancel (ButtonClickEvent event)
void onClose (CloseEvent event)
void onNo (ButtonClickEvent event)
void onOK (OKClickEvent event)
void onYes (ButtonClickEvent event)

Constructor details Top

public MessageDialog ()

<b>使用场景</b>:信息提示窗口,用户可以做选择或取消的操作,以及有输入框的询问; <b>使用方法</b>:添加组件后,可以设置提示的内容,定义用户选择确定或取消后的操作提示窗口; ## <b>文档链接</b>:#http://docs.newdao.net/zhuo-mian-nei-rong-zu-jian/xiao-xi-dui-hua-kuang.html#

public MessageDialog ( options)

构造函数

Inherited from ViewComponent

	
		参数options格式类似{parent:xx, config:{}},parent是组件的父节点,允许为空或不指定,config是组件的参数选项
	 

Parameters

options

参数选项

Properties Detail Top

public string inputValue

type==Prompt时input的值

public string message

提示信息,支持html格式

public string title

标题

public string type

类型,取值范围:OK,OKCancel,YesNo,YesNoCancel,Prompt

public string width

对话框宽度,高根据内容自动,默认值:270px

Attributes Detail Top

public string inputValue

type==Prompt时input的值

public string message

提示信息,支持html格式

public string title

标题

public string type

类型,取值范围:OK,OKCancel,YesNo,YesNoCancel,Prompt

public string width

对话框宽度,高根据内容自动,默认值:270px

public string xid

组件标示

Methods Detail Top

public Object get (String name)

获取属性值

Parameters

String name

属性名称,取值范围:"type"、"title"、"message"、"inputValue"

Return Value

Object

public void set (JSON arg)

设置属性值

Parameters

JSON arg

属性值对
结构如下:

{ type: {string} 类型,取值范围:OK,OKCancel,YesNo,YesNoCancel,Prompt title: {string} 标题 message: {string} 提示信息 inputValue: {string} type==Prompt时input的值 width: {string} 对话框宽度,高根据内容自动,默认值:270px }

Return Value

void

public void show (JSON arg)

显示messageDialog

Parameters

JSON arg

参数
结构如下:

{ type: {string} 类型,取值范围:OK,OKCancel,YesNo,YesNoCancel,Prompt title: {string} 标题 message: {string} 提示信息 width: {string} 对话框宽度,高根据内容自动,默认值:270px callback: {function} 关闭后的回调,可参考onClose事件,回调执行this为组件,参数param包含button: 触发关闭的按钮type,取值范围:'ok'、'cancel'、'yes'、'no' ;input: 当type=='Prompt'时返回输入的值 }

Return Value

void

Operations Detail Top

public show (JSON arg)

显示messageDialog

Parameters

JSON arg

参数
结构如下:

{ type: {string} 类型,取值范围:OK,OKCancel,YesNo,YesNoCancel,Prompt title: {string} 标题 message: {string} 提示信息 width: {string} 对话框宽度,高根据内容自动,默认值:270px callback: {function} 关闭后的回调,可参考onClose事件,回调执行this为组件,参数param包含button: 触发关闭的按钮type,取值范围:'ok'、'cancel'、'yes'、'no' ;input: 当type=='Prompt'时返回输入的值 }

Events Detail Top

public void onCancel (ButtonClickEvent event)

[回调型事件]点击Cancel按钮,关闭对话框时触发事件

Parameters

ButtonClickEvent event


结构如下:

{ "source" : 组件的js对象, "bindingContext" : 组件绑定的上下文,包含$model、$object等具体请参考bindingContext说明, "button" : 触发关闭的按钮type=='cancel' }

Return Value

void

public void onClose (CloseEvent event)

[回调型事件]关闭对话框时触发事件

Parameters

CloseEvent event


结构如下:

{ "source" : 组件的js对象, "bindingContext" : 组件绑定的上下文,包含$model、$object等具体请参考bindingContext说明, "button" : 触发关闭的按钮type,取值范围:'ok'、'cancel'、'yes'、'no' "input" : 当type=='Prompt'时返回输入的值 }

Return Value

void

public void onNo (ButtonClickEvent event)

[回调型事件]点击No按钮,关闭对话框时触发事件

Parameters

ButtonClickEvent event


结构如下:

{ "source" : 组件的js对象, "bindingContext" : 组件绑定的上下文,包含$model、$object等具体请参考bindingContext说明, "button" : 触发关闭的按钮type=='no' }

Return Value

void

public void onOK (OKClickEvent event)

[回调型事件]点击OK按钮,关闭对话框时触发事件

Parameters

OKClickEvent event


结构如下:

{ "source" : 组件的js对象, "bindingContext" : 组件绑定的上下文,包含$model、$object等具体请参考bindingContext说明, "button" : 触发关闭的按钮type=='ok' "input" : 当type=='Prompt'时返回输入的值 }

Return Value

void

public void onYes (ButtonClickEvent event)

[回调型事件]点击Yes按钮,关闭对话框时触发事件

Parameters

ButtonClickEvent event


结构如下:

{ "source" : 组件的js对象, "bindingContext" : 组件绑定的上下文,包含$model、$object等具体请参考bindingContext说明, "button" : 触发关闭的按钮type=='yes' }

Return Value

void