PropertyEventMethod찾아보기
TextBox - 2.0_1.5225B.20170830.114414

단순한 레이블을 표시하는 컴포넌트입니다. 단순 표현을 위한 컴포넌트로 이벤트나 내장함수가 존재하지 않습니다.

Type

uiplugin

Property Summary

class
textbox의 class 속성
dataType
textbox value의 data 타입을 결정
displayFormat
textbox에 값을 표시하는 format
displayFormatter
textbox에 값을 표시하는 formatter 함수
for
label 태그의 for 속성 값
id
textbox 컴포넌트의 id
label
textbox 출력 문자열
localeRef
다국어 옵션 사용시 refrence 키 값
ref
model instance의 바인딩 정보
tagname
렌더링될 태그명

Event Summary

onclick
마우스로 textbox를 클릭했을 때 발생
ondblclick
마우스로 textbox를 더블클릭했을 때 발생
onmouseout
마우스가 지정된 영역이나 링크 위에서 벗어났을 때 발생
onmouseover
마우스가 지정된 영역이나 링크 위에 놓일 때 발생

Method Summary

addClass( className )
컴포넌트에 className의 이름을 가진 class를 추가합니다
bind( type , function )
컴포넌트의 이벤트를 동적으로 할당합니다
changeClass( oldClassName , newClassName )
컴포넌트에서 oldClassName의 이름을 가진 class를 newClassName으로 치환합니다
focus( )
객체에 focus를 줍니다
getAttributeNode( nodeName )
attributes 노드에서 nodeName에 해당하는 하위 노드의 값을 반환합니다
getDataType( )
textbox의 dataType을 리턴합니다
getDisabled( )
현재 설정되어있는 disabled 속성을 반환합니다
getFormatValue( )
textbox 객체에 foramt된 값을 반환합니다
getGeneratedComponent( id )
동일한 index에 속한 다른 컴퍼넌트 객체를 가져옵니다
getGeneratedIndex( )
generator 반복부에서 해당 index를 반환합니다
getID( )
웹스퀘어 컴포넌트의 id를 반환합니다
getLabel( )
textbox의 label을 반환합니다
getOpacity( )
컴포넌트의 Opacity 값을 반환합니다
getPluginName( )
웹스퀘어 컴포넌트의 pluginName을 반환합니다
getPosition( positionName )
컴포넌트의 위치 값을 반환합니다
getReadOnly( )
현재 설정되어있는 readOnly 속성을 반환합니다
getSize( sizeName )
컴포넌트의 크기 값을 반환합니다
getStyle( propertyName )
컴포넌트의 propertyName에 해당하는 style의 값을 반환합니다
getStyleValue( style )
컴포넌트의 style중에서 입력받은 style의 값을 반환합니다
getTitle( )
component의 title 속성을 가져온다
getUserData( key )
설정된 사용자 임의의 데이터를 반환 합니다.
getValue( )
format 적용 되지 않은 원래 값을 반환합니다
hasClass( className )
컴포넌트가 className의 이름을 가진 class를 가지고 있는지 여부를 반환합니다
hide( )
컴포넌트를 화면에서 보이지 않도록 숨깁니다
removeAttributeNode( nodeName )
attributes 노드에서 nodeName에 해당하는 하위 노드를 삭제합니다.
removeClass( className )
컴포넌트에 className의 이름을 가진 class를 삭제합니다
setAttributeNode( nodeName , nodeValue )
attributes 노드에서 nodeName에 해당하는 하위 노드에 값을 설정합니다.
setDisabled( disabled )
객체의 disabled 속성을 제어합니다
setDisplayFormat( format )
displayFormat을 새로 설정합니다
setDisplayFormatter( displayFormatter )
textbox의 displayFormatter를 세팅합니다
setLabel( label )
label의 값을 입련된 label로 바꿔줍니다
setLocaleRef( localeRef )
localeRef값을 입련된 String으로 새로 설정합니다
setOpacity( value )
컴포넌트의 Opacity 값을 설정합니다
setPosition( left , top , mode )
컴포넌트의 위치를 설정합니다
setReadOnly( readOnly )
객체의 readOnly 속성을 제어합니다
setRef( 변경할 )
바인딩 된 ref 경로를 동적으로 변경합니다
setSize( width , heigth )
컴포넌트의 크기를 설정합니다
setStyle( propertyName , value )
컴포넌트의 propertyName에 해당하는 style의 값을 설정합니다
setUserData( key , value )
사용자 임의의 데이터를 객체에 설정합니다
setValue( label )
label의 값을 입련된 label로 바꿔줍니다
show( displayType )
컴포넌트를 화면에 보이도록 설정합니다
toggleClass( className )
컴포넌트가 className의 이름을 가진 class를 가지고 있다면 제거하고, 가지고 있지 않다면 추가한다
trigger( type , array )
컴포넌트에 등록된 특정 이벤트를 직접 발생시킵니다
unbind( type , function )
컴포넌트의 이벤트를 동적으로 제거합니다
visible( flag )
컴포넌트의 style 중 visibility 값을 설정합니다

Property Detail

class
textbox의 class 속성
dataType
textbox value의 data 타입을 결정
displayFormat
textbox에 값을 표시하는 format
displayFormatter
textbox에 값을 표시하는 formatter 함수
for
label 태그의 for 속성 값. xml 속성으로 넘어온 tagname 값이 무시되고 무조건 label로 렌더링
id
textbox 컴포넌트의 id
label
textbox 출력 문자열
localeRef
다국어 옵션 사용시 refrence 키 값
ref
model instance의 바인딩 정보
tagname
렌더링될 태그명

Event Detail

onclick
마우스로 textbox를 클릭했을 때 발생
ondblclick
마우스로 textbox를 더블클릭했을 때 발생
onmouseout
마우스가 지정된 영역이나 링크 위에서 벗어났을 때 발생
onmouseover
마우스가 지정된 영역이나 링크 위에 놓일 때 발생

Method Detail

addClass( className )
컴포넌트에 className의 이름을 가진 class를 추가합니다.
Parameter
nametyperequireddescription
classNameStringY추가하고 싶은 class의 이름
Sample
componentId.addClass("selected"); 컴포넌트에 selected 라는 class를 추가.
bind( type , function )
컴포넌트의 이벤트를 동적으로 할당합니다.
Parameter
nametyperequireddescription
typeStringY동적으로 할당할 이벤트의 이름
functionFunctionY동적으로 할당할 이벤트의 핸들러 ㅎ마수
Sample
* | input1.bind("onclick", function(e){ alert(input1.getValue();})); // input1 클릭 시 이벤트 발생. 브라우저 이벤트로 등록
* | input1.bind("onchange", function(e){ alert(input1.getValue();})); // input1 값 변경 시 . 브라우저 이벤트가 아니고 웹스퀘어 엔진 내부의 이벤트로 등록된다.
changeClass( oldClassName , newClassName )
컴포넌트에서 oldClassName의 이름을 가진 class를 newClassName으로 치환합니다.
Parameter
nametyperequireddescription
oldClassNameStringYelement에서 삭제할 class의 이름
newClassNameStringYelement에서 추가할 class의 이름
Sample
componentId.changeClass("selected","default"); 컴포넌트에 selected 라는 class를 default라는 class로 변경.
focus( )
객체에 focus를 줍니다.
getAttributeNode( nodeName )
attributes 노드에서 nodeName에 해당하는 하위 노드의 값을 반환합니다.
Parameter
nametyperequireddescription
nodeNameStringY값을 얻어올 하위 노드의 이름
getDataType( )
textbox의 dataType을 리턴합니다.
getDisabled( )
현재 설정되어있는 disabled 속성을 반환합니다.
Return
typedescription
Boolean현재 설정되어있는 disabled 속성
Sample
var returnValue = componentId.getDisabled(); // returnValue는 true혹은 false이다.
getFormatValue( )
textbox 객체에 foramt된 값을 반환합니다.
Return
typedescription
Stringforamt된 값
Sample
예: dataType이 date이고 yyyy.MM.dd foramt인 경우, 2012.01.01 var returnValue = textbox1.getFormatValue(); returnValue는 2012.01.01이다.
getGeneratedComponent( id )
동일한 index에 속한 다른 컴퍼넌트 객체를 가져옵니다.
Parameter
nametyperequireddescription
idStringN찾아오려는 컴퍼넌트 id
Return
typedescription
Object동일한 id에 속한 다른 컴퍼넌트 객체
Sample
다음과 같이 사용할 수 있다. var content = this.getGeneratedComponent("content1"); content.setValue("");
getGeneratedIndex( )
generator 반복부에서 해당 index를 반환합니다.
Return
typedescription
Numbergenerator 반복부에서 해당 index.
getID( )
웹스퀘어 컴포넌트의 id를 반환합니다.
Return
typedescription
String웹스퀘어 컴포넌트의 id
Sample
다음과 같이 사용할 수 있다. <script ev:event="onclick" type="javascript"><![CDATA[ var returnValue = this.getID(); ]]></script> returnValue는 컴포넌트의 id(예: input1)이다.
getLabel( )
textbox의 label을 반환합니다.
Return
typedescription
Stirngtextbox의 label
Sample
textbox의 text가 Pinocchio인 경우, var returnValue = textbox1.getLabel(); returnValue는 Pinocchio이다.
getOpacity( )
컴포넌트의 Opacity 값을 반환합니다.
Return
typedescription
IntegerOpacity 값
Sample
var returnValue = componentId.getOpacity(); // returnValue는 0~1사이의 실수이다.
getPluginName( )
웹스퀘어 컴포넌트의 pluginName을 반환합니다.
Return
typedescription
String웹스퀘어 컴포넌트의 pluginName
Sample
다음과 같이 사용할 수 있다. <script ev:event="onclick" type="javascript"><![CDATA[ var returnValue = this.getPluginName(); ]]></script> returnValue는 컴포넌트의 종류(예: input, checkbox ...)이다.
getPosition( positionName )
컴포넌트의 위치 값을 반환합니다.
Parameter
nametyperequireddescription
positionNameStringY위치 값의 종류('left'이거나 'top')
Return
typedescription
Number컴포넌트의 위치 값
Sample
var returnValue = componentId.getPosition("left"); // returnValue는 픽셀 단위의 위치 값이다. %로 설정된 경우, 픽셀로 변환하여 반환한다.
getReadOnly( )
현재 설정되어있는 readOnly 속성을 반환합니다.
Return
typedescription
Boolean현재 설정되어있는 readOnly 속성
Sample
var returnValue = componentId.getReadOnly(); // returnValue는 true혹은 false이다.
getSize( sizeName )
컴포넌트의 크기 값을 반환합니다.
Parameter
nametyperequireddescription
sizeNameStringY크기 값의 종류. szieName의 종류는 다음을 참고.
height : element.clientHeight innerHeight : element.clientHeight + padding outerHeight : element.clientHeight + padding + border outerMarginHeight : element.clientHeight + padding + border + margin width : element.clientWidth innerWidth : element.clientWidth + padding outerWidth : element.clientWidth + padding + border outerMarginWidth : element.clientWidth + padding + border + margin
Return
typedescription
Number컴포넌트의 크기 값
Sample
var returnValue = componentId.getSize("width"); // returnValue는 픽셀 단위의 크기 값이다. %로 설정된 경우, 픽셀로 변환하여 반환한다.
getStyle( propertyName )
컴포넌트의 propertyName에 해당하는 style의 값을 반환합니다.
Parameter
nametyperequireddescription
propertyNameStringY반환할 style의 property 이름
Return
typedescription
String객체의 style 속성 값
Sample
var returnValue = componentId.getStyle("width"); // returnValue는 width에 대한 픽셀 단위, 또는 % 단위가 된다.
getStyleValue( style )
컴포넌트의 style중에서 입력받은 style의 값을 반환합니다.
Parameter
nametyperequireddescription
styleStringYstyle중에서 사용자가 구하고 싶은 값
Return
typedescription
Stringstyle중에서 사용자가 입력한 style의 값(색을 반환하는 경우에는 색HexCode로 반환)
getTitle( )
component의 title 속성을 가져온다.
Return
typedescription
Stringcomponent의 title 속성값.
Sample
var title = componentId.getTitle();
getUserData( key )
설정된 사용자 임의의 데이터를 반환 합니다.
xml상에 설정된 사용자 값도 가져올 수 있습니다.
Parameter
nametyperequireddescription
keyStringY임의 데이터의 키
Return
typedescription
Stringkey 값에 해당하는 데이터의 값
Sample
componentId.setUserData("data", "WebSquare"); var returnValue = componentId.getUserData("data"); returnValue는 WebSquare이다. <xf:input id="input1" style="position: absolute ;left:0px;top:0px;width: 100px;height: 20px;" data2="WEBSQUARE">... 와 같이 xml상에 설정된 사용자 정의 값도 가져올 수 있다. var returnValue = componentId.getUserData("data2"); returnValue는 WEBSQUARE이다.
getValue( )
format 적용 되지 않은 원래 값을 반환합니다.
Return
typedescription
Stirngtextbox의 label
Sample
textbox의 text가 Pinocchio인 경우, var returnValue = textbox1.getValue(); returnValue는 Pinocchio이다.
hasClass( className )
컴포넌트가 className의 이름을 가진 class를 가지고 있는지 여부를 반환합니다.
Parameter
nametyperequireddescription
classNameStringY조사할 className
Return
typedescription
Boolean컴포넌트가 className의 class를 가지고 있는지 여부
Sample
var returnValue = componentId.hasClass("selected"); // returnValue는 true 또는 false.
selected라는 class를 가지고 있으면 true, 아니면 false를 반환한다.
hide( )
컴포넌트를 화면에서 보이지 않도록 숨깁니다.
Sample
componentId.hide();
removeAttributeNode( nodeName )
attributes 노드에서 nodeName에 해당하는 하위 노드를 삭제합니다.
nodeName으로 사용할 수 있는 값은 config.xml의 attributes 설정을 따릅니다.
Parameter
nametyperequireddescription
nodeNameStringY삭제할 하위 노드의 이름
removeClass( className )
컴포넌트에 className의 이름을 가진 class를 삭제합니다.
Parameter
nametyperequireddescription
classNameStringY삭제하고 싶은 class의 이름
Sample
componentId.removeClass("selected"); 컴포넌트에 selected 라는 class를 삭제.
setAttributeNode( nodeName , nodeValue )
attributes 노드에서 nodeName에 해당하는 하위 노드에 값을 설정합니다.
nodeName으로 사용할 수 있는 값은 config.xml의 attributes 설정을 따릅니다.
Parameter
nametyperequireddescription
nodeNameStringY값을 설정할 하위 노드의 이름
nodeValueStringY노드에 설정할 값
setDisabled( disabled )
객체의 disabled 속성을 제어합니다. Disabled 속성을 활성화 시키려면 true 비활성화 시키려면 false를 입력합니다.
Parameter
nametyperequireddescription
disabledBooleanYDisabled 속성을 활성화 시키려면 true 비활성화 시키려면 false
Sample
componentId.setDisabled(true);
입력가능한 컴포넌트의 경우 입력이 불가능한 상태가 된다.
setDisplayFormat( format )
displayFormat을 새로 설정합니다
Parameter
nametyperequireddescription
formatStringY새로 설정할 displayFormat
setDisplayFormatter( displayFormatter )
textbox의 displayFormatter를 세팅합니다.
Parameter
nametyperequireddescription
displayFormatterStringY변경할 displayFormatter
setLabel( label )
label의 값을 입련된 label로 바꿔줍니다
Parameter
nametyperequireddescription
labelStirngYsetLabel호출시에 넣을 값.
Sample
textbox1.setLabel("Pinocchio");
setLocaleRef( localeRef )
localeRef값을 입련된 String으로 새로 설정합니다.
Parameter
nametyperequireddescription
localeRefStringY새로 설정할 localeRef 값
Sample
예: languagePack을 사용하도록 설정되어 있는 경우, ("MON"는 ko.js에서 "월요일" , en.js에서 "Monday" 로 "TUE"는 ko.js에서 "화요일" , en.js에서 "Tuesday" 로 설정되어 있다.) localeRef = "MON" 으로 지정하여 언어 환경에 따라 "월요일" 또는 "Monday"로 표현되는 상태. textbox1.setLocaleRef("TUE"); 언어 환경에 따라 "화요일" 또는 "Tuesday"로 표현된다.
setOpacity( value )
컴포넌트의 Opacity 값을 설정합니다.
Parameter
nametyperequireddescription
valueIntegerY설정할 Opacity 값 (0과 1사이의 실수)
Sample
componentId.setOpacity(0.45);
setPosition( left , top , mode )
컴포넌트의 위치를 설정합니다.
Parameter
nametyperequireddescription
leftIntegerYleft의 값
topIntegerYtop의 값
modeStringNabsolute이면 x,y로 현재 값을 설정하고 delta이면 현재 값에 x,y값만큼을 더해서 설정. (기본모드는 absolute)
Sample
componentId.setPosition(100, 100, "absolute");
setReadOnly( readOnly )
객체의 readOnly 속성을 제어합니다. readOnly 속성을 활성화 시키려면 true 비활성화 시키려면 false를 입력합니다.
Parameter
nametyperequireddescription
readOnlyBooleanYreadOnly 속성을 활성화 시키려면 true 비활성화 시키려면 false
Sample
componentId.setReadOnly(true);
입력가능한 컴포넌트의 경우 입력이 불가능한 상태가 된다.
setRef( 변경할 )
바인딩 된 ref 경로를 동적으로 변경합니다.
Parameter
nametyperequireddescription
변경할StringYref의 XPath
setSize( width , heigth )
컴포넌트의 크기를 설정합니다.
Parameter
nametyperequireddescription
widthIntegerY새로 설정할 컴포넌트의 width값
heigthIntegerY새로 설정할 컴포넌트의 height값
Sample
componentId.setSize(100,100);
setStyle( propertyName , value )
컴포넌트의 propertyName에 해당하는 style의 값을 설정합니다.
Parameter
nametyperequireddescription
propertyNameStringY바꾸고 싶은 style 값의 이름
valueStringY설정할 style의 값
Sample
예: 컴포넌트 스타일 width를 변경하고자 하는 경우. componentId.setStyle("width", 100); 픽셀 단위를 기본으로 하며, componentId.setStyle("width", "100px"); 과 동일하다. %단위의 표현을 하고자 하면 componentId.setStyle("width", "100%"); 로 명시하여 준다.
setUserData( key , value )
사용자 임의의 데이터를 객체에 설정합니다.
Parameter
nametyperequireddescription
keyStringY임의 데이터의 키
valueStringY임의 데이터의 값
Sample
공통 API로 모든 컴포넌트에서 사용 가능하다. componentId.setUserData("data", "WebSquare");
객체에 설정이 가능한 key가 아닌 경우, key 설정이 불가능하다. componentId.setUserData("title", "WebSquare");
!!!WARNING - [title] can't define as UserData 와 같이 로그에 경고문구가 쌓인다.
setValue( label )
label의 값을 입련된 label로 바꿔줍니다
Parameter
nametyperequireddescription
labelStirngYsetLabel호출시에 넣을 값.
Sample
textbox1.setValue("Pinocchio");
show( displayType )
컴포넌트를 화면에 보이도록 설정합니다.
Parameter
nametyperequireddescription
displayTypeStringNdisplay의 속성 값. (block, inline, none, “”)
Sample
componentId.show(); // display 속성이 "block"이 된다. componentId.show(""); // class에 적용된 display 속성 값을 다시 복구.
toggleClass( className )
컴포넌트가 className의 이름을 가진 class를 가지고 있다면 제거하고, 가지고 있지 않다면 추가한다.
Parameter
nametyperequireddescription
classNameStringY조사할 className
Sample
componentId.toggleClass("selected"); selected라는 class가 존재하면 해당 class를 제거한다. selected라는 class가 존재하지 않으면 추가한다.
trigger( type , array )
컴포넌트에 등록된 특정 이벤트를 직접 발생시킵니다.
Parameter
nametyperequireddescription
typeStringY발생시킬 이벤트 이름
arrayObjectN이벤트 핸들러에 전달할 파라미터 배열
Sample
* | input1.trigger("onclick"); // input1에 onclick이벤트를 발생시킨다.
* | input1.trigger("onchange", [1,2]); // input1에 onchange이벤트를 발생시키고 핸들러 함수에 (1,2) 인자를 전달하여 호출한다.
unbind( type , function )
컴포넌트의 이벤트를 동적으로 제거합니다.
Parameter
nametyperequireddescription
typeStringN제거할 이벤트의 이름. 생략할 경우 해당 컴포넌트의 모든 이벤트를 제거한다.
functionFunctionN제거할 이벤트의 핸들러 함수. 생략할 경우 해당 이벤트 type으로 등록된 모든 핸들러 함수를 제거한다.
Sample
* | input1.unbind("onclick", func1); // input1에 등록된 onclick이벤트 함수 중에 func1 이벤트 핸들러를 제거
* | input1.unbind("onchange"); // input1에 등록된 onchange이벤트 핸들러 함수를 모두 제거
* | input1.unbind(); // input1에 등록된 모든 이벤트를 제거
visible( flag )
컴포넌트의 style 중 visibility 값을 설정합니다. flag가 참이면 "visible", 거짓이면 "hidden"을 설정합니다.
Parameter
nametyperequireddescription
flagBooleanYvisibility 값을 설정할 값(참이면 "visible", 거짓이면 "hidden"을 설정)