Class: AbstractComponent

(Version : 2.0.4)

WUX.AbstractComponent

모든 사용자 인터페이스 컴포넌트의 기본 클래스입니다.

new AbstractComponent

Extends

Property
String
id

컴포넌트의 고유 식별자입니다. 하나의 Window 컴포넌트 내에서는 동일한 ID를 사용할 수 없습니다. 영문, 숫자를 조합하여 사용합니다.

Properties:
Name Type Description
id String id 설정
Example
 <button id="testID" />
String
userData

서버로 전송되지않는 데이터 입니다. 컴포넌트에 임의의 데이터를 저장합니다.,

Properties:
Name Type Description
id String userData 설정
Example
 <button userData="T" />
Method
String
getCx
컴포넌트 객체가 어떤 컴포넌트인지 판별할 수 있는 문자열을 반환합니다.
Returns:
컴포넌트 식별 문자
Type
String
Example
 //Button Component var compCx =
         WUX.getComponent('comp').getCx(); // Button
String
getId
컴포넌트의 id(식별자)를 반환합니다.
Returns:
컴포넌트 Id
Type
String
Example
 var idComp = WUX.getComponent('comp').getId();
Component
getParent
부모 컴포넌트를 반환합니다.
Returns:
부모 컴포넌트
Type
Component
Example
 var parentComp = WUX.getComponent('comp').getParent();
String or Object
getUserData
    컴포넌트에 저장되어 있는 사용자 정의 데이터를 반환합니다.
    map 객체로 저장되 어있을경우 key를 넘기면 해당 key의 value만 반환합니다.
Parameters:
Name Type Description
key String 맵으로 입력되었을 경우의 key 값
Returns:
userData 사용자 정의 데이터
Type
String or Object
Example
 WUX.getComponent('comp').getUserData('key'); // return 맵의 키에
         해당하는 값 WUX.getComponent('comp').getUserData(); // return Object
Component
getWindow
대상 컴포넌트가 포함된 Window 컴포넌트를 반환합니다.
Returns:
컴포넌트
Type
Component
Example
 var windowComp = WUX.getComponent('comp').getWindow();
String or Object
setUserData
    컴포넌트에 사용자 정의데이터를 세팅합니다.
    서버로 전송되지 않습니다.
Returns:
userData 사용자 정의 데이터
Type
String or Object
Example
 WUX.getComponent('comp').setUserData('aa');
         WUX.getComponent('comp').setUserData('key', 'value');
         WUX.getComponent('comp').setUserData({key:'value',key2:'value'});
void
addEvent
     옵저버에 구독할 이벤트를 등록합니다.
Parameters:
Name Type Description
type String 이벤트 타입
fn Function 콜백함수
context Object 컨텍스트
inherited from
Observer
void
removeEvent
     옵저버에 등록된 이벤트를 삭제합니다
Parameters:
Name Type Description
type String 타입
args String 파라미터
context String 컨텍스트
inherited from
Observer
boolean
triggerEvent
     옵저버에 등록된 이벤트를 발생시킵니다.
     등록된 다른 모든 리스너에 이벤트가 전달됩니다.
Parameters:
Name Type Description
type String 타입
args String 파라미터
Returns:
Type
boolean
inherited from
Observer
Events