PropertyEventMethod찾아보기
WebSquare.uiplugin.windowContainer - 5.0_1.3521B.20190311.114514

일반적으로 MDI(multiple document interface)라고 표현하는 컴포넌트로 다중 화면을 동시에 볼 수 있는 컴포넌트이다.
메인 컨텐츠를 담기위해 사용하며 화면을 수평, 수직, 순차, 균등배열로 배치할 수있다.
본 컴포넌트는 SPA모드 적용이 가능한 컴포넌트이며 제약사항등을 반드시 숙지해야한다.
컴포넌트의 최상위는 HTML div Tag로 이루어져있다.

Type

uiplugin

Property Summary

class
HTML의 class속성과 동일한 기능을 제공하며 css파일 또는 style블럭에 정의한 class를 1개 또는 공백(space)를 이용하여 다중 적용이 가능하다.
closeType
[default: all, noneFixedWindow, fixedWindow]전체 창 닫기 버튼을 클릭할 때 닫지 않고 고정할 창을 지정
confirmFalseAction
[default:newWindow, selectWindow, existWindow]중복 확인 confirm에서 취소(cancel)를 선택했을 때의 컨텐츠 로딩 방식.
confirmMessage
useConfirmMessage속성의 값이 true인 경우 적용되며 confirm창에 보여줄 메세지.
confirmTrueAction
[default:existWindow, selectWindow, newWindow]중복 확인 confirm에서 확인(ok)를 선택했을 때의 컨텐츠 로딩 방식.
customMsg
window의 하단바에 추가되는 사용자정의 메세지
defaultHeight
[default:210px]window의 기본 높이로 px 또는 % 등의 단위를 포함한 값(css height의 속성값)을 입력한다.
defaultWidth
[default:300px]window의 기본 넓이로 px 또는 % 등의 단위를 포함한 값(css width의 속성값)을 입력한다.
fixArrangeFullScreen
[default:false, true]useFixButton속성값이 true일 경우 동작하며 현재 윈도우수가 arrangeNum(아래 관련 속성 참조)보다 작을때 화면을 전부 사용할지의 여부.
hideTitleOnMaximize
[default:false, true]윈도우의 타이틀 부분을 최대화시 숨길지 여부(숨겨진 경우는 maximize 또는 restore는 controlIcon에서 할 수 있다
horizontalArrangeNum
[default:2]useFixButton속성값이 true일 경우 동작하며 수평 정렬시 정렬시킬 화면개수
id
컴포넌트의 ID로 전역객체로 할당되며 script에서 본 id로 컴포넌트에 접근이 가능하다
lineBreakNum
[default:4]수평,수직 정렬시 window를 개행 시킬 기준 값.
minimumHeight
[default:150px]사용자가 마우스를 이용하여 개별 window를 리사이즈할 경우의 최소 높이로 px 또는 % 등의 단위를 포함한 값
minimumWidth
[default:150px]사용자가 마우스를 이용하여 개별 window를 리사이즈할 경우의 최소 넓이로 px 또는 % 등의 단위를 포함한 값
nameLayerMove
[default: false, true] 마우스 드래그-앤-드롭을 통해 윈도우 탭의 위치를 이동.
sequentialArrangeColNum
[default:2]useFixButton속성값이 true일 경우 동작하며 바둑판 정렬시 정렬시킬 화면 열의 수
sequentialArrangeRowNum
[default:2]useFixButton속성값이 true일 경우 동작하며 바둑판 정렬시 정렬시킬 화면 행의 수
spaInitCount
컴포넌트 초기 로딩 시 미리 SPA모드용 window(iframe)을 생성할 개수.
spaReplaceHistory
SPA 사용 시 Window 영역(IFrame 내부)의 history(앞으로 가기 및 뒤로 가기) 동작을 금지.
statusMsg
window의 하단바에 추가되는 기본 상태 메세지
stopToggleOnLast
윈도우가 하나일때 선택된 윈도우의 네임레이어 클릭시 최소화하지 않고 윈도우의 크기 유지할지 여부
toolbarPosition
[default:bottom, top]툴바의 위치
tooltipDisplay
[default:true, false]툴바에 생성되는 네임레이어의 툴팁 사용여부
tooltipGroupClass
[default:true, false]tooltipDisplay속성값이 true일 경우 w2group 스타일을 포함시킬지(true)의 여부
useCloseButton
[default:false, true]툴바에 생성되는 네임레이어의 닫기버튼의 사용여부
useConfirmMessage
[default:true, false]createWindow API로 동적으로 window를 생성할 때 사용자에게 중복체크 confirm처리를 할지의 여부로 주의사항은 아래와같다.
useControlIconTitle
[default:false, true]controlIcon(수평,수직,계단,바둑판,닫기버튼)에 title속성을 넣을 것인지의 여부.
useCustomMsg
[default:false, false]window의 하단바의 추가되는 사용자정의 메세지를 사용할지의 여부
useFixButton
[default:false, true]툴바에 생성되는 네임레이어에 고정버튼을 사용할지의 여부
userData1
사용자 정의 데이터 속성
userData2
사용자 정의 데이터 속성
userData3
사용자 정의 데이터 속성
useStatusMsg
[default:true, false]window의 하단바의 추가되는 기본 상태 메세지를 사용할지의 여부
verticalArrangeNum
[default:2]useFixButton속성값이 true일 경우 동작하며 수직 정렬시 정렬시킬 화면개수
windowAutoResize
[default:false, true]setSize API 호출시 하위 윈도우들의 위치 및 크기를 재정렬할지의 여부
windowMaximizeAll
윈도우의 사이즈 최대화 동시 변경 사용여부
windowMaxNum
[default:5]createWindow API를 이용하여 생성할 window의 최대 개수
windowTooltipDisplay
[default:true, false]window 헤더에 추가되는 title에 툴팁을 사용할지의 여부

Event Summary

onafternamelayermove
마우스 드래그-앤-드롭 후 윈도우의 위치가 변경된 직후에 발생.
onbeforecloseall
윈도우 전체 닫기 버튼을 통해 모든 윈도우가 비활성화 될 때 발생
onbeforenamelayermove
마우스 드래그-앤-드롭 후 윈도우의 위치가 변경되기 직전에 발생. 이벤트 핸들러 함수에서 false를 반환하면 위치 변경이 취소됨.
onclosewindow
각 윈도우의 닫기 버튼을 통해 해당 윈도우가 비활성화 될 때 발생
onwindowchange
윈도우가 활성화/비활성화 될 때 발생
onwindowtabclick
WindowContainer 컴포넌트가 포함한 자식 창의 탭을 클릭할 때 발생

Method Summary

addClass( className )
컴포넌트에 class를 추가한다
bind( eventType , function )
컴포넌트의 이벤트를 동적으로 할당한다
changeClass( oldClassName , newClassName )
컴포넌트에서 oldClassName의 이름을 가진 class를 newClassName으로 변경한다.
closeWindow( )
현재 활성화되어 있는 window를 닫는다.
createWindow( title , iconUrl , src , windowTitle , windowId , openAction , closeAction , windowTooltip , options )
window를 생성(open)한다
fixWindow( winInfoId )
해당 ID의 윈도우를 고정.
focus( )
컴포넌트에 focus를 준다
getDisabled( )
현재 설정되어있는 disabled 속성값을 반환한다
getGenerator( )
generator 하위의 컴포넌트에서 이 함수를 호출하여 자신을 생성한 부모 generator 객체를 가져온다
getID( )
웹스퀘어 컴포넌트의 id를 반환한다
getOpacity( )
CSS로 정의 된 컴포넌트의 Opacity(불투명도) 값을 반환한다
getPluginName( )
웹스퀘어 컴포넌트의 pluginName(컴포넌트명)을 반환한다
getPosition( positionName )
컴포넌트의 left 또는 top의 위치 값을 반환한다
getReadOnly( )
현재 설정되어있는 readOnly 속성값을 반환한다
getSelectedIndex( )
선택된 window의 index를 반환한다
getSelectedWindowId( )
선택된 window의 windowId를 반환한다.
getSize( sizeName )
컴포넌트의 크기 값을 반환합니다
getStyle( propertyName )
컴포넌트에 적용 된 CSS의 propertyName에 해당하는 값을 반환한다
getStyleValue( style )
[deprecated]getStyle로 사용.
getTitle( )
title 속성값을 반환한다
getUserData( key )
setUserData API로 설정 된 사용자 데이터 또는 소스(화면 XML)에 사용자가 임의의 property로 정의 된 값을 반환한다
getWindow( title )
인자로 넘겨진 title를 가진 window의 window 객체를 반환한다.
getWindowByWindowId( windowId , focus )
인자로 넘겨진 windowID를 가진 window의 window 객체를 반환한다
getWindowLabel( windowId , type )
인자값으로 넘어오는 type에 따라 label(text)값을 반환한다.
hasClass( className )
컴포넌트가 parameter로 받은 className의 class를 가지고 있는지의 여부를 반환한다
hide( )
컴포넌트를 화면에서 보이지 않도록 숨긴다.
removeClass( className )
컴포넌트에 className의 class를 삭제한다.
setAllWindowStatusMsg( msg )
모든 window의 상태 메세지를 설정한다
setDisabled( disabled )
컴포넌트의 disabled 속성을 설정한다
setEventPause( evList , flag )
컴포넌트의 이벤트를 disable 또는 enable시킨다
setFocus( index )
index에 해당하는 window에 focus를 준다
setOpacity( value )
컴포넌트의 CSS Opacity(불투명도)값를 설정한다
setPosition( left , top , mode )
컴포넌트의 위치(left,top)를 설정한다
setReadOnly( readOnly )
readOnly 속성값을 설정한다
setSize( width , height )
컴포넌트의 크기를 조정한다
setStyle( propertyName , value )
컴포넌트의 property별 style을 설정한다
setUserData( key , value )
컴포넌트에 사용자 데이터를 설정한다
setWindowCustomMsg( msg )
현재 선택되어 있는 window의 사용자정의 메세지를 설정한다
setWindowLabel( windowId , type , value )
windowId에 해당하는 window의 type에 따른 label값을 설정한다.
setWindowMaxNum( windowMaxNum )
windowContainer에서 열 수 있는 최대 window 개수를 설정
setWindowPosition( left , top )
현재 선택되어 있는 window의 x,y 위치를 조정한다
setWindowSize( width , height )
현재 선택되어 있는 window의 크기를 조정한다
setWindowStatusMsg( msg )
현재 선택되어 있는 window의 상태 메세지를 설정한다
setZIndex( windowIndex )
인자로 넘겨진 윈도우의 z-Index를 증가시킨다
show( displayType )
컴포넌트를 화면에 보이도록 설정한다.
toggleClass( className )
컴포넌트가 className의 이름을 가진 class를 가지고 있다면 제거하고, 가지고 있지 않다면 추가한다.
trigger( type , array )
컴포넌트에 등록 된 특정 이벤트를 발생시킨다
unbind( type , function )
컴포넌트에 등록 된 이벤트를 제거한다
unfixWindow( winInfoId )
해당 ID의 윈도우를 고정 해제.
visible( flag )
[deprecated]show/hide 로 사용하거나 setStyle을 통해 visible 속성을 설정한다.

Property Detail

class
HTML의 class속성과 동일한 기능을 제공하며 css파일 또는 style블럭에 정의한 class를 1개 또는 공백(space)를 이용하여 다중 적용이 가능하다.
기본적으로 엔진 내부에서 컴포넌트별로 class를 적용하고 있으며 해당 class를 이용하여 컴포넌트의 css를 공통으로 적용할 수 있다.
closeType
[default: all, noneFixedWindow, fixedWindow]전체 창 닫기 버튼을 클릭할 때 닫지 않고 고정할 창을 지정
all: 고정핀에 상관 없이 모든 창을 닫음. (기본 값)
noneFixedWindow: 고정핀이 있는 창은 닫지 않음.
fixedWindow : 고정핀이 있는 창만 닫음.
관련 속성: useFixButton="true"인 경우에만 유효
confirmFalseAction
[default:newWindow, selectWindow, existWindow]중복 확인 confirm에서 취소(cancel)를 선택했을 때의 컨텐츠 로딩 방식.
(newWindow:새로운 창, selectWindow:기존 창을 선택, existWindow:windowID에 해당하는 창에 src를 바꿔 로딩하고 해당 창을 선택)
confirmMessage
useConfirmMessage속성의 값이 true인 경우 적용되며 confirm창에 보여줄 메세지.
기본적으로 엔진에서 window의 title값을 이용하여 중복 확인 메세지를 보여준다.
confirmTrueAction
[default:existWindow, selectWindow, newWindow]중복 확인 confirm에서 확인(ok)를 선택했을 때의 컨텐츠 로딩 방식.
(newWindow: 새로운 탭, selectWindow:기존 탭을 선택, existWindow: tabID에 해당하는 탭에 src를 바꿔 로딩하고 해당 탭을 선택)
customMsg
window의 하단바에 추가되는 사용자정의 메세지.
defaultHeight
[default:210px]window의 기본 높이로 px 또는 % 등의 단위를 포함한 값(css height의 속성값)을 입력한다.
window가 초기에 열릴 때는 최대창으로 열리며 "창사이즈복원"에 해당하는 우측상단의 아이콘을 클릭하면 기본창크기로 축소된다.
defaultWidth
[default:300px]window의 기본 넓이로 px 또는 % 등의 단위를 포함한 값(css width의 속성값)을 입력한다.
window가 초기에 열릴 때는 최대창으로 열리며 "창사이즈복원"에 해당하는 우측상단의 아이콘을 클릭하면 기본창크기로 축소된다.
fixArrangeFullScreen
[default:false, true]useFixButton속성값이 true일 경우 동작하며 현재 윈도우수가 arrangeNum(아래 관련 속성 참조)보다 작을때 화면을 전부 사용할지의 여부.
arrangeNum과 관련된 속성 : verticalArrangeNum, horizontalArrangeNum, sequentialArrangeRowNum, sequentialArrangeColNum
hideTitleOnMaximize
[default:false, true]윈도우의 타이틀 부분을 최대화시 숨길지 여부(숨겨진 경우는 maximize 또는 restore는 controlIcon에서 할 수 있다.)
horizontalArrangeNum
[default:2]useFixButton속성값이 true일 경우 동작하며 수평 정렬시 정렬시킬 화면개수
id
컴포넌트의 ID로 전역객체로 할당되며 script에서 본 id로 컴포넌트에 접근이 가능하다.
lineBreakNum
[default:4]수평,수직 정렬시 window를 개행 시킬 기준 값.
useFixButton속성값이 true일 경우 arrangeNum(아래 참조)과 관련 속성값이 우선된다.
arrangeNum과 관련된 속성 : verticalArrangeNum, horizontalArrangeNum, sequentialArrangeRowNum, sequentialArrangeColNum
minimumHeight
[default:150px]사용자가 마우스를 이용하여 개별 window를 리사이즈할 경우의 최소 높이로 px 또는 % 등의 단위를 포함한 값.
minimumWidth
[default:150px]사용자가 마우스를 이용하여 개별 window를 리사이즈할 경우의 최소 넓이로 px 또는 % 등의 단위를 포함한 값.
nameLayerMove
[default: false, true] 마우스 드래그-앤-드롭을 통해 윈도우 탭의 위치를 이동.
true: 윈도우 탭 위치 이동이 가능.
false (기본 값): 윈도우 탭 위치 이동이 불가능.
비슷한 속성: TabControl의 moveTab
sequentialArrangeColNum
[default:2]useFixButton속성값이 true일 경우 동작하며 바둑판 정렬시 정렬시킬 화면 열의 수
sequentialArrangeRowNum
[default:2]useFixButton속성값이 true일 경우 동작하며 바둑판 정렬시 정렬시킬 화면 행의 수
spaInitCount
컴포넌트 초기 로딩 시 미리 SPA모드용 window(iframe)을 생성할 개수.
SPA는 iframe을 미리 생성하여 웹스퀘어 엔진 자원을 로딩해 놓는 기능으로 createWindow시에 화면 로딩 속도를 향상 시킬수 있다.
0보다 큰 값일 경우 SPA모드로 동작하며 일반적으로 windowMaxNum속성과 같은 값을 설정한다.
spaReplaceHistory
SPA 사용 시 Window 영역(IFrame 내부)의 history(앞으로 가기 및 뒤로 가기) 동작을 금지.
IFrame 내부 페이지의 뒤로 가기 동작을 막아서 blank 페이지로 이동하지 않는 효과. 이 경우, 뒤로 가기를 수행 할 경우 브라우저 전체가 뒤로 이동.
true: 뒤로 가기 및 앞으로 가기 동작을 금지.
false (기본 값): 동작을 허용.
statusMsg
window의 하단바에 추가되는 기본 상태 메세지.
stopToggleOnLast
윈도우가 하나일때 선택된 윈도우의 네임레이어 클릭시 최소화하지 않고 윈도우의 크기 유지할지 여부
toolbarPosition
[default:bottom, top]툴바의 위치
tooltipDisplay
[default:true, false]툴바에 생성되는 네임레이어의 툴팁 사용여부.
tooltipGroupClass
[default:true, false]tooltipDisplay속성값이 true일 경우 w2group 스타일을 포함시킬지(true)의 여부.
useCloseButton
[default:false, true]툴바에 생성되는 네임레이어의 닫기버튼의 사용여부.
useConfirmMessage
[default:true, false]createWindow API로 동적으로 window를 생성할 때 사용자에게 중복체크 confirm처리를 할지의 여부로 주의사항은 아래와같다.
createWindow API의 파라메터 속성 중 openAction의 값이 정의되지 않고 window의 id가 중복되었을 경우 아래의 속성과 연동하여 사용자에게 중복체크 confirm 처리한다.
관련 속성 : confirmMessage, confirmTrueAction, confirmFalseAction
useControlIconTitle
[default:false, true]controlIcon(수평,수직,계단,바둑판,닫기버튼)에 title속성을 넣을 것인지의 여부.
사용자가 아이콘에 마우스를 over할 경우 각 아이콘의 설명이 나온다.
useCustomMsg
[default:false, false]window의 하단바의 추가되는 사용자정의 메세지를 사용할지의 여부.
useFixButton
[default:false, true]툴바에 생성되는 네임레이어에 고정버튼을 사용할지의 여부.
userData1
사용자 정의 데이터 속성. getUserData("userData1") API를 통해 설정한 값을 얻어올 수 있다.
userData2
사용자 정의 데이터 속성. getUserData("userData2") API를 통해 설정한 값을 얻어올 수 있다.
userData3
사용자 정의 데이터 속성. getUserData("userData3") API를 통해 설정한 값을 얻어올 수 있다.
useStatusMsg
[default:true, false]window의 하단바의 추가되는 기본 상태 메세지를 사용할지의 여부.
verticalArrangeNum
[default:2]useFixButton속성값이 true일 경우 동작하며 수직 정렬시 정렬시킬 화면개수
windowAutoResize
[default:false, true]setSize API 호출시 하위 윈도우들의 위치 및 크기를 재정렬할지의 여부
windowMaximizeAll
윈도우의 사이즈 최대화 동시 변경 사용여부
windowMaxNum
[default:5]createWindow API를 이용하여 생성할 window의 최대 개수.
windowTooltipDisplay
[default:true, false]window 헤더에 추가되는 title에 툴팁을 사용할지의 여부.

Event Detail

onafternamelayermove
마우스 드래그-앤-드롭 후 윈도우의 위치가 변경된 직후에 발생.
관련 속성: nameLayerMove="true"일 때 유효.
Parameter
nametypedescription
infoObjectstartWindowID, startIndex, endWindowID, endIndex를 포함한 오브젝트를 반환한다. <Number> info.startIndex : nameLayer이동을 시작한 nameLayer의 index (화면기준) <String> info.startWindowID: nameLayer이동을 시작한 nameLayer의 id <Number> info.endWindowID: nameLayer이동이 끝나는 지점에 있는 nameLayer(nameLayer이동 처리 후, nameLayer이동을 시작한 nameLayer의 왼쪽에 위치할 nameLayer)의 id <Number> info.endIndex : nameLayer이동이 끝나는 지점에 있는 nameLayer(nameLayer이동 처리 후, nameLayer이동을 시작한 nameLayer의 왼쪽에 위치할 nameLayer)의 index
onbeforecloseall
윈도우 전체 닫기 버튼을 통해 모든 윈도우가 비활성화 될 때 발생.
onbeforenamelayermove
마우스 드래그-앤-드롭 후 윈도우의 위치가 변경되기 직전에 발생. 이벤트 핸들러 함수에서 false를 반환하면 위치 변경이 취소됨.
관련 속성: nameLayerMove="true"일 때 유효.
Parameter
nametypedescription
infoObjectstartWindowID, startIndex, endWindowID, endIndex를 포함한 오브젝트를 반환. <Number> info.startIndex : nameLayer이동을 시작한 nameLayer의 index (화면기준) <String> info.startWindowID: nameLayer이동을 시작한 nameLayer의 id <Number> info.endWindowID: nameLayer이동이 끝나는 지점에 있는 nameLayer(nameLayer이동 처리 후, nameLayer이동을 시작한 nameLayer의 왼쪽에 위치할 nameLayer)의 id <Number> info.endIndex : nameLayer이동이 끝나는 지점에 있는 nameLayer(nameLayer이동 처리 후, nameLayer이동을 시작한 nameLayer의 왼쪽에 위치할 nameLayer)의 index
onclosewindow
각 윈도우의 닫기 버튼을 통해 해당 윈도우가 비활성화 될 때 발생.
Parameter
nametypedescription
eventObject닫기 버튼을 클릭할 때 발생하는 event 객체를 반환. <String> event.src : 닫기 버튼을 통해 비활성화된 윈도우의 src 속성 값 <String> event.title : 닫기 버튼을 통해 비활성화된 윈도우의 title 속성 값
onwindowchange
윈도우가 활성화/비활성화 될 때 발생.
Parameter
nametypedescription
oldWindowIdString비활성화된 윈도우 ID
newWindowIdString활성화된 윈도우 ID
onwindowtabclick
WindowContainer 컴포넌트가 포함한 자식 창의 탭을 클릭할 때 발생.
Parameter
nametypedescription
oldWindowIdString이전에 선택한 윈도우 ID
newWindowIdString현재 선택된 윈도우 ID

Method Detail

addClass( className )
컴포넌트에 class를 추가한다.
Parameter
nametyperequireddescription
classNameStringY추가하고 싶은 class의 이름
Sample
//input1 컴포넌트에 oddClass 라는 class를 추가 할 때 input1.addClass("oddClass");
bind( eventType , function )
컴포넌트의 이벤트를 동적으로 할당한다.
Parameter
nametyperequireddescription
eventTypeStringY할당 할 이벤트명.
functionFunctionY동적으로 할당 할 이벤트의 핸들러 function.
Sample
//input1에 onclick 이벤트에 핸들러 function을 직접 정의하여 bind. input1.bind("onclick", function(e){ alert(input1.getValue();})); //input1에 onclick 이벤트에 미리 정의 한 commObj.ev_click function을 bind. var commObj = {}; commObj.ev_click = function(e){ alert("click :: "+this.id); }; input1.bind("onclick", commObj.ev_click );
changeClass( oldClassName , newClassName )
컴포넌트에서 oldClassName의 이름을 가진 class를 newClassName으로 변경한다.
기본 설정은 addClass API를 통해 추가 된 class만 적용되며 컴포넌트의 class 속성에 직접 정의 된 class를 삭제해야하는 경우는 config.xml파일의 설정을 아래와 같이 적용해야한다.
<style><removeDefaultClass value="true" /></style>
Parameter
nametyperequireddescription
oldClassNameStringY삭제 할 class의 이름
newClassNameStringY추가 할 class의 이름
Sample
//아래와 같이 input 컴포넌트에 class를 정의 한 경우 <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" class="tmpInputClass"></xf:input> //config.xml 파일에 아래와 같이 정의. <style> <removeDefaultClass value="true" /> </style> //tmpInputClass class를 tmpInputWarninClass로 변경 input1.changeClass("tmpInputClass","tmpInputWarninClass");
closeWindow( )
현재 활성화되어 있는 window를 닫는다.
window의 닫기 버튼을 누른 것과 동일하다.
Sample
//활성화된 window를 닫는다. windowContainer1.closeWindow();
createWindow( title , iconUrl , src , windowTitle , windowId , openAction , closeAction , windowTooltip , options )
window를 생성(open)한다.
Parameter
nametyperequireddescription
titleStringY툴바의 네임레이어에 표시되는 타이틀.
iconUrlStringY현재는 사용되지 않으며 null로 입력한다.(각 윈도우의 아이콘 url 문자열)
srcStringYwindow에 link할 페이지의 URL.
windowTitleStringNwindow의 헤더에 표시될 타이틀로 null 이나 ""입력시 title값이 출력.
windowIdStringNwindow ID로 null 이나 ""입력시 title이 id로 생성.
openActionStringN[existWindow, newWindow, selectWindow]existWindow : id가 동일한 윈도우가 떠있으면 그 윈도우를 사용하여 다시 표시 / newWindow : 항상 새로운 창을 생성 / selectWindow : id가 동일한 창이 있으면 그 윈도우를 선택
closeActionStringNwindow가 닫힐 때 동작을 지정하는 함수명(return은 boolean으로 하여야 함 false일 경우 닫기 중지, true일 경우 닫기)
windowTooltipStringN툴바의 네임레이어에 표현될 tooltip.(미입력시 windowTitle이 tooltip으로 셋팅됨)
optionsObjectNwindow를 생성할 때 부가적으로 설정할 옵션.
<Boolean> options.fixed : 생성할 창의 고정여부
Sample
//CASE1 별도의 옵션이 없이 window를 생성할 경우 windowContainer1.createWindow( "edu001" , null , "/uiTestW5/searchBox.xml" ); //id가 edu001인 window가 생성되며 헤더의 title 및 하단 툴바의 네임레이어에 "edu001" 값이 적용된다. //위의 API는 다음과 같이 사용할 수 있다. windowContainer1.createWindow({ 'title':'edu001', 'src':'/uiTestW5/searchBox.xml' }); //CASE2 closeAction및 세부 옵션을 적용하여 window를 생성할 경우 //script 블럭에 아래와 같이 window의 close 제어 function을 정의한다. - createWindow API를 호출할 때 closeAction에 사용. function fn_closeMsg(){ return confirm("do you close this window?"); // 확인, 취소 버튼이 있는 메세지 창 사용. //return false; // 무조건 닫기 취소. } windowContainer1.createWindow( "music" , "" , "/test/music.xml", "page001", "P0001", "existWindow", "fn_closeMsg"); //id가 P0001인 window가 생성되며 하단 툴바의 네임레이어에는 "music", 헤더의 title에는 "page001" 값이 적용된다. //해당 window가 닫힐 때는 fn_closeMsg Function이 호출된다. //또한 위의 API는 다음과 같이 사용할 수 있다. windowContainer1.createWindow({ title:'music', src:'/test/music.xml', windowTitle:'page001', windowId:'P0001', openAction:'existWindow', closeAction:'fn_closeMsg' });
fixWindow( winInfoId )
해당 ID의 윈도우를 고정.
버전 정보: 5.0_1.2705B.20170721.164120 버전부터 지원.
Parameter
nametyperequireddescription
winInfoIdStringY고정할 윈도우 ID
focus( )
컴포넌트에 focus를 준다.
getDisabled( )
현재 설정되어있는 disabled 속성값을 반환한다.
Return
typedescription
Booleandisabled 속성값
Sample
var returnValue = componentId.getDisabled(); return 예시 ) false
getGenerator( )
generator 하위의 컴포넌트에서 이 함수를 호출하여 자신을 생성한 부모 generator 객체를 가져온다.
Return
typedescription
Object부모 generator 객체
Sample
<w2:generator id="generator1"> <w2:trigger id="trigger1" ev:onclick="scwin.trigger1_onclick"></w2:trigger></w2:generator> scwin.trigger1.onclick = function(){ console.log(this.getGenerator());} // trigger1 클릭 시 generator1 객체가 console에 찍힌다. // https://inswave.com/jira/browse/WPF-1425 참조
getID( )
웹스퀘어 컴포넌트의 id를 반환한다.
Return
typedescription
String웹스퀘어 컴포넌트의 id
Sample
//동적으로 웹스퀘어 컴포넌트를 파라메터로 받았을 경우 아래와 같이 사용 할 수 있다. function fn_validCheck(tmpObj){ //tmpObj가 input1 이라는 ID를 가지고 있는 경우 var compID = tmpObj.getID(); //return 예시 ) "input1" }
getOpacity( )
CSS로 정의 된 컴포넌트의 Opacity(불투명도) 값을 반환한다.
Return
typedescription
IntegerOpacity 값
Sample
//아래와 같이 input 컴포넌트에 opcacity css를 적용 한 경우 <xf:input id="input1" style="position: relative;width: 144px;height: 21px;opacity:0.2;"></xf:input> var returnValue = input1.getOpacity(); // returnValue는 0~1사이의 실수이다. //return 예시 ) "0.2"
getPluginName( )
웹스퀘어 컴포넌트의 pluginName(컴포넌트명)을 반환한다.
Return
typedescription
String웹스퀘어 컴포넌트의 pluginName
Sample
//아래와 같이 공통 function에서 동적으로 웹스퀘어 객체를 받았을 때 컴포넌트의 종류에 따른 분기처리를 할수 있다. var commObj = {}; commObj.fn_makeReqData = function(tmpObj){ var tmpID = tmpObj.getID(); //컴포넌트 ID var tmpCompType = tmpObj.getPluginName(); //컴포넌트 종류 if(tmpCompType == "input"){ //..로직.. }else if(tmpCompType == "gridView"){ //..로직 .. }else{ //..로직.. } };
getPosition( positionName )
컴포넌트의 left 또는 top의 위치 값을 반환한다. %로 설정된 경우, 픽셀로 변환하여 반환한다.
Parameter
nametyperequireddescription
positionNameStringY[left,top]위치 종류
Return
typedescription
Number컴포넌트의 위치 값
Sample
//아래와 같이 input 컴포넌트에 margin css를 적용했을 경우 <xf:input id="input1" style="position: relative;width: 144px;height: 21px;margin:10px;"></xf:input> var returnValue = input1.getPosition("top"); // returnValue는 픽셀 단위의 위치 값이다. //return 예시 ) 10
getReadOnly( )
현재 설정되어있는 readOnly 속성값을 반환한다.
Return
typedescription
Boolean현재 설정되어있는 readOnly 속성
Sample
var returnValue = componentId.getReadOnly(); //return 예시 ) false
getSelectedIndex( )
선택된 window의 index를 반환한다.
Return
typedescription
Number선택된 window의 index
Sample
//3개의 window 중 1번째 window가 선택된 경우 var tmpRs = windowContainer1.getSelectedIndex(); //return 예시 ) 0
getSelectedWindowId( )
선택된 window의 windowId를 반환한다.
createWindow API를 호출 시 windowId를 설정하지 않은 경우 title의 값이 ID로 설정된다.
Sample
//CASE 1. 아래와 같이 widnowID를 설정하지 않고 window를 생성한 경우 windowContainer1.createWindow( "page001" , null , "/uiTestW5/test0001.xml"); var tmpRs1 = windowContainer1.getSelectedWindowId(); //return 예시 ) "page001" //CASE 2. 아래와 같이 widnowID를 설정하여 window를 생성한 경우 windowContainer1.createWindow( "page001" , null , "/uiTestW5/test0001.xml", "page001" , "p001"); var tmpRs2 = windowContainer1.getSelectedWindowId(); //return 예시 ) "p001"
getSize( sizeName )
컴포넌트의 크기 값을 반환합니다.%로 설정된 경우, 픽셀로 변환하여 반환한다.
Parameter
nametyperequireddescription
sizeNameStringY[height,innerHeight,outerHeight,outerMarginHeight,width,innerWidth,outerWidth,outerMarginWidth]크기 값의 종류. 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는 픽셀 단위의 크기 값이다. %로 설정된 경우, 픽셀로 변환하여 반환한다. //return 예시 ) 100
getStyle( propertyName )
컴포넌트에 적용 된 CSS의 propertyName에 해당하는 값을 반환한다.
Parameter
nametyperequireddescription
propertyNameStringY반환 할 style의 property 이름
Return
typedescription
Stringstyle의 속성값
Sample
//아래와 같이 input 컴포넌트가 정의 된 경우 <xf:input id="input1" style="position: relative;width: 144px;height: 21px;"></xf:input> var returnValue = input1.getStyle("width"); //return 예시 ) "144px"
getStyleValue( style )
[deprecated]getStyle로 사용.
컴포넌트에 적용 된 CSS의 propertyName에 해당하는 값을 반환한다.
Parameter
nametyperequireddescription
styleStringY정의 된 style에서 사용자가 반환 받고자하는 속성명.
Return
typedescription
Stringstyle 속성에 정의 된 값(색을 반환하는 경우에는 색HexCode로 반환)
getTitle( )
title 속성값을 반환한다.
Return
typedescription
Stringtitle 속성값.
Sample
//아래와 같이 input 컴포넌트에 title이 정의 된 경우 <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" title="이름 입력"></xf:input> var tmpTitle = input1.getTitle(); //return 예시 ) "이름 입력"
getUserData( key )
setUserData API로 설정 된 사용자 데이터 또는 소스(화면 XML)에 사용자가 임의의 property로 정의 된 값을 반환한다.
Parameter
nametyperequireddescription
keyStringY임의 데이터의 키
Return
typedescription
Stringkey에 해당하는 데이터
Sample
//아래와 같이 input 컴포넌트의 사용자 속성(eduTest)이 적용 된 경우. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" eduTest="Hello"></xf:input> input1.getUserData("eduTest"); //return 예시 ) "Hello" //setUserData를 통해 set한 경우 input1.setUserData("eduTest","WebSquare"); input1.getUserData("WebSquare"); //return 예시 ) "Hello"
getWindow( title )
인자로 넘겨진 title를 가진 window의 window 객체를 반환한다.
window에 link된 WedSquare페이지의 Function 또는 컴포넌트 등에 접근할 때 사용된다.
Parameter
nametyperequireddescription
titleStringY윈도우 title
Return
typedescription
Objectwindow 객체
Sample
//"edu001"의 title을 가진 window에 있는 input1 컴포넌트에 접근하여 값을 꺼내올 경우 //"eud001"의 title을 가진 window 꺼내오기 var tmpObj = windowContainer1.getWindow("edu001"); //window page내의 input1 컴포넌트의 value 꺼내오기 var tmpRs = tmpObj.input1.getValue();
getWindowByWindowId( windowId , focus )
인자로 넘겨진 windowID를 가진 window의 window 객체를 반환한다.
Parameter
nametyperequireddescription
windowIdStringYwindow ID
focusBooleanNwindow에 focus를 줄지의 여부
Return
typedescription
Objectwindow 객체
Sample
//createWindow 호출 시 windowID를 설정하지 않은 경우에 window의 input1 컴포넌트의 value를 꺼내오는 경우 (title이 ID가 된다.) //아래와 같이 windowID를 설정하지 않고 window를 생성한다. windowContainer1.createWindow( "tmp001" , null , "/uiTestW5/test001.xml"); //"tmp001"의 ID을 가진 window 꺼내오기 (title의 ID로 설정되어있다.) var tmpObj = windowContainer1.getWindowByWindowId("tmp001"); //window page내의 input1 컴포넌트의 value 꺼내오기 var tmpRs = tmpObj.input1.getValue();
getWindowLabel( windowId , type )
인자값으로 넘어오는 type에 따라 label(text)값을 반환한다.
type의 종류 : toolbar(툴바에 있는 네임레이어의 값), window(헤더의 title의 값), tooltip(툴바에 있는 네임레이어에 mouse over시 나오는 tooltip)
Parameter
nametyperequireddescription
windowIdStringY반환할 window의 id
typeStringY[toolbar, window, tooltip]label의 type
Sample
//아래와 같이 window를 생성한다. windowContainer1.createWindow( "edu001" , null , "/uiTestW5/searchBox.xml" , "교육자료001" , "P001" ); //네임레이어의 값 꺼내오기 var tmpRs1 = windowContainer1.getWindowLabel("P001", "toolbar"); //return 예시 ) "edu001" //헤더의 title 값 꺼내오기 var tmpRs2 = windowContainer1.getWindowLabel("P001", "window"); //return 예시 ) "교육자료001"
hasClass( className )
컴포넌트가 parameter로 받은 className의 class를 가지고 있는지의 여부를 반환한다.
Parameter
nametyperequireddescription
classNameStringY검색 할 className
Return
typedescription
Booleanclass를 가지고 있는지의 여부
Sample
//아래와 같이 input 컴포넌트에 class가 정의 된 경우 <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" class="tmpInputClass"></xf:input> var returnValue = input1.hasClass("tmpInputClass"); //return 예시 ) true
hide( )
컴포넌트를 화면에서 보이지 않도록 숨긴다.
엔진 내부적으로는 CSS를 display:none;과 visibility:hidden;으로 처리한다.
Sample
componentId.hide();
removeClass( className )
컴포넌트에 className의 class를 삭제한다.
기본 설정은 addClass API를 통해 추가 된 class만 적용되며 컴포넌트의 class 속성에 직접 정의 된 class를 삭제해야하는 경우는 config.xml파일의 설정을 아래와 같이 적용해야한다.
<style><removeDefaultClass value="true" /></style>
Parameter
nametyperequireddescription
classNameStringY삭제 할 class명
Sample
//아래와 같이 input 컴포넌트에 class를 정의 한 경우 <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" class="tmpInputClass"></xf:input> //config.xml 파일에 아래와 같이 정의. <style> <removeDefaultClass value="true" /> </style> //tmpInputClass class 삭제 input1.removeClass("tmpInputClass");
setAllWindowStatusMsg( msg )
모든 window의 상태 메세지를 설정한다.
Parameter
nametyperequireddescription
msgStringY상태 메세지
Sample
//모든 window의 하단 상태 메세지를 변경. windowContainer1.setAllWindowStatusMsg('Have a good day!');
setDisabled( disabled )
컴포넌트의 disabled 속성을 설정한다. disabled 속성을 활성화 시키려면 true 비활성화 시키려면 false를 입력한다.
Parameter
nametyperequireddescription
disabledBooleanYdisabled 속성을 활성화 시키려면 true 비활성화 시키려면 false
Sample
//컴포넌트의 disabled 적용 componentId.setDisabled(true);
setEventPause( evList , flag )
컴포넌트의 이벤트를 disable 또는 enable시킨다.
Parameter
nametyperequireddescription
evListStringN대상 이벤트 목록. 해당 인자가 주어지지 않을 경우 해당 컴포넌트의 모든 사용자 이벤트가 대상이 된다. (null을 지정하면 된다.)
flagBooleanYtrue인 경우 pause시키며, false인 경우 pause를 해제한다.
Sample
input1.setEventPause("onclick", true); //onclick이벤트를 동적으로 pause 한다. input1.setEventPause("onfocus,onblur", false); //onfocus이벤트와 onblur이벤트의 pause를 해제한다. input1.setEventPause(null, true); //input에 등록된 모든 사용자 이벤트를 pause 한다.
setFocus( index )
index에 해당하는 window에 focus를 준다.
Parameter
nametyperequireddescription
indexNumberYWindow index
Sample
windowContainer1.setFocus(0);
setOpacity( value )
컴포넌트의 CSS Opacity(불투명도)값를 설정한다.
Parameter
nametyperequireddescription
valueNumberYOpacity 값 (0과 1사이의 실수)
Sample
componentId.setOpacity(0.45);
setPosition( left , top , mode )
컴포넌트의 위치(left,top)를 설정한다.
Parameter
nametyperequireddescription
leftNumberYleft의 값 또는 null.
topNumberYtop의 값 또는 null.
modeStringN[defulat:absolute, delta]absolute이면 x,y로 현재 값을 설정하고 delta이면 현재 값에 x,y값만큼을 더해서 설정.
Sample
//컴포넌트의 top만 100px로 설정. componentId.setPosition(null, 100);
setReadOnly( readOnly )
readOnly 속성값을 설정한다. readOnly 속성을 활성화 시키려면 true 비활성화 시키려면 false를 입력합니다.
Parameter
nametyperequireddescription
readOnlyBooleanYreadOnly 속성을 활성화 시키려면 true 비활성화 시키려면 false
Sample
//컴포넌트의 readonly 적용. componentId.setReadOnly(true);
setSize( width , height )
컴포넌트의 크기를 조정한다.
Parameter
nametyperequireddescription
widthNumberY컴포넌트의 폭
heightNumberY컴포넌트의 높이
Sample
windowContainer1.setSize(300,300); width는 450px, height는 300px인 windowContainer 생성. width는 450px, height는 150px 이하로 줄일 수 없다.
setStyle( propertyName , value )
컴포넌트의 property별 style을 설정한다.
Parameter
nametyperequireddescription
propertyNameStringYstyle 속성 이름
valueStringY적용 할 style의 값
Sample
//컴포넌트의 width를 200px로 설정 할 경우 componentId.setStyle("width", "200px"); //배경색을 olive로 변경 할 경우 componentId.setStyle("background-color","olive");
setUserData( key , value )
컴포넌트에 사용자 데이터를 설정한다. 컴포넌트에 설정이 가능한 key가 아닌 경우, key 설정이 불가능하며 log에 관련 내용이 출력 된다.
Parameter
nametyperequireddescription
keyStringY임의 데이터의 키
valueStringY임의 데이터의 값
Sample
//컴포넌트에 'data'라는 key로 'WebSquare'라는 값을 설정 할 경우 componentId.setUserData("data", "WebSquare"); //아래와 같이 컴포넌트에 설정이 가능한 key가 아닌 경우, key 설정이 불가능하다. componentId.setUserData("title", "WebSquare"); //log 표현 예시 ) !!!WARNING - [title] can't define as UserData
setWindowCustomMsg( msg )
현재 선택되어 있는 window의 사용자정의 메세지를 설정한다. (useCustomMsg="true"인경우)
Parameter
nametyperequireddescription
msgStringY상태 메세지
Sample
//선택된 window의 사용자정의 메시 설정. windowContainer1.setWindowCustomMsg('Have a good day!');
setWindowLabel( windowId , type , value )
windowId에 해당하는 window의 type에 따른 label값을 설정한다.
type의 종류 : toolbar(툴바에 있는 네임레이어의 값), window(헤더의 title의 값), tooltip(툴바에 있는 네임레이어에 mouse over시 나오는 tooltip), all(앞의 3가지 모두).
Parameter
nametyperequireddescription
windowIdStringYwindow의 id
typeStringY[toolbar, window, tooltip, all]설정할 label의 type
valueStringY설정할 label의 값
Sample
//id가 window3인 window의 네임레이어, 헤더의 title, tooltip을 TestWindow로 변경 windowContainer1.setWindowLabel("window3", "all", "TestWindow"); //id가 window2인 window의 헤더 title을 "테스트 페이지" 로 변경 windowContainer1.setWindowLabel("window2", "window", "테스트 페이지");
setWindowMaxNum( windowMaxNum )
windowContainer에서 열 수 있는 최대 window 개수를 설정. (5.0_1.2701A.20170714.211228 버전에서 추가.)
Parameter
nametyperequireddescription
windowMaxNumNumberY새로 설정할 window의 최대 개수
setWindowPosition( left , top )
현재 선택되어 있는 window의 x,y 위치를 조정한다.(px단위로 적용된다.)
Parameter
nametyperequireddescription
leftNumberY
topNumberY
Sample
//window를 왼쪽에서 10px, 위에서 100px 아래에 위치 시킨다. windowContainer1.setWindowPosition('10','100');
setWindowSize( width , height )
현재 선택되어 있는 window의 크기를 조정한다.(px단위로 적용된다.)
Parameter
nametyperequireddescription
widthNumberYwindow의 넓이
heightNumberYwindow의 높이
Sample
//선택되어진 window의 width를 200px, height를 300px로 설정한다. windowContainer1.setWindowSize('200','300');
setWindowStatusMsg( msg )
현재 선택되어 있는 window의 상태 메세지를 설정한다.
Parameter
nametyperequireddescription
msgStringY상태 메세지
Sample
//선택된 window의 상태값 설정. windowContainer1.setWindowStatusMsg('Have a good day!');
setZIndex( windowIndex )
인자로 넘겨진 윈도우의 z-Index를 증가시킨다.
Parameter
nametyperequireddescription
windowIndexStringY해당 윈도우 컴포넌트의 window index
show( displayType )
컴포넌트를 화면에 보이도록 설정한다.
엔진 내부적으로는 CSS를 display속성과 visibility:show;으로 처리한다.
Parameter
nametyperequireddescription
displayTypeStringN[default:block ,inline ,none ,""]display의 속성 값.
Sample
//display 속성이 "block"이 된다. componentId.show(); //class에 적용된 display 속성 값을 다시 복구. componentId.show("");
toggleClass( className )
컴포넌트가 className의 이름을 가진 class를 가지고 있다면 제거하고, 가지고 있지 않다면 추가한다.
기본 설정은 addClass API를 통해 추가 된 class만 삭제되며 컴포넌트의 class 속성에 직접 정의 된 class를 삭제해야하는 경우는 config.xml파일의 설정을 아래와 같이 적용해야한다.
<style><removeDefaultClass value="true" /></style>
Parameter
nametyperequireddescription
classNameStringY설정 할 className
Sample
//아래와 같이 input 컴포넌트에 class를 정의 한 경우 <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" class="tmpInputClass"></xf:input> //config.xml 파일에 아래와 같이 정의. <style> <removeDefaultClass value="true" /> </style> //적용 된 tmpInputClass class 삭제 input1.toggleClass("tmpInputClass"); //tmpInputClass class를 다시 추가 input1.toggleClass("tmpInputClass");
trigger( type , array )
컴포넌트에 등록 된 특정 이벤트를 발생시킨다.
Parameter
nametyperequireddescription
typeStringY발생시킬 이벤트 이름
arrayArrayN이벤트 핸들러에 전달할 파라미터 배열
Sample
//input1 컴포넌트에 onclick이벤트를 발생시킨다. input1.trigger("onclick"); //input1에 onviewchange이벤트를 발생시키고 핸들러 함수에 (1,2) 인자를 전달하여 호출한다. input1.trigger("onviewchange", [1,2]);
unbind( type , function )
컴포넌트에 등록 된 이벤트를 제거한다.
Parameter
nametyperequireddescription
typeStringN제거할 이벤트 이름. 생략할 경우 해당 컴포넌트의 모든 이벤트를 제거한다.
functionFunctionN제거할 이벤트의 핸들러 함수. 생략할 경우 해당 이벤트 type으로 등록된 모든 핸들러 함수를 제거한다.
Sample
//input1에 등록된 모든 이벤트를 제거 input1.unbind(); //input1에 등록된 onviewchange이벤트 핸들러 함수를 모두 제거 input1.unbind("onviewchange"); //input1에 등록된 onviewchange이벤트에서 func1 이벤트 핸들러를 제거 input1.unbind("onviewchange", func1);
unfixWindow( winInfoId )
해당 ID의 윈도우를 고정 해제.
버전 정보: 5.0_1.2705B.20170721.164120 버전부터 지원.
Parameter
nametyperequireddescription
winInfoIdStringY고정 해제할 윈도우 ID
visible( flag )
[deprecated]show/hide 로 사용하거나 setStyle을 통해 visible 속성을 설정한다.
컴포넌트의 style 중 visibility 값을 설정한다. true이면 "visible", false이면 "hidden"을 설정.
Parameter
nametyperequireddescription
flagBooleanYvisibility 값을 설정할 값(true이면 "visible", false이면 "hidden"을 설정)