API
Class

BindComponent ($UI/system/lib/base/bindComponent)

使用范围:UI2

Contents

class BindComponent ($UI/system/lib/base/bindComponent) extends ViewComponent

可视感知数据组件基类

Constructor Top

  BindComponent ()
  BindComponent ( options)

Methods Top

void disabledRender ()
doInit ( value, bindingContext)
void doUpdate ( value, bindingContext)
boolean isDisabled ()
void render ()
void updateReadonly ()
void updateValidation ()
void updateValue ()
void val2ref ()

Constructor details Top

public BindComponent ()

可视感知数据组件基类

public BindComponent ( options)

构造函数

Inherited from ViewComponent

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

Parameters

options

参数选项

Methods Detail Top

public void disabledRender ()

组件禁用方法接口,由派生类实现,默认实现:节点上增加disabled属性

Return Value

void

public doInit ( value, bindingContext)

初始化组件接口函数,由派生类实现

	
	 如果返回{ dependence:true}时,表示组件还没有初始化完成,它依赖其它组件,在要获取其其它组件
的promise的回调中调用当前组件的inited方法,通知界面引擎组件初始化完成。
	

Parameters

value

组件关联的数据项的值

bindingContext

数据上下文

Return Value

obj 返回值类似\{dependence: true/false\},其中dependence表示组件是否异步依赖别的组件

public void doUpdate ( value, bindingContext)

更新组件接口函数,可以派生类中重载实现,目前默认调用updateValue(数据更新)、updateReadonly(只读状态更新)、updateValidation(规则校验状态更新)

	当组件关联的数据项的值发生改变时,会调用组件实例的update方法。 

Parameters

value

组件关联的数据项的值

bindingContext

数据上下文

Return Value

void

public boolean isDisabled ()

判断组件禁用方法接口,由派生类实现,默认实现:组件disabled属性 或 ref的readonly

Return Value

boolean

public void render ()

组件渲染方法接口,由派生类实现

	组件init时,和set属性后设置了this.needRender==true时会调用

Return Value

void

public void updateReadonly ()

组件只读状态更新

Return Value

void

public void updateValidation ()

组件规则校验状态更新

Return Value

void

public void updateValue ()

更新组件的数据部分

	通过组件实现的val函数或者set({value:...})更新 

Return Value

void

public void val2ref ()

将组件的value更新到bind-ref

Return Value

void