PropertyEventMethodIndex
WebSquare.uiplugin.windowContainer - 5.0_4.4547B.20211124.201933

WindowContainer. Supports MDI. Lays out multiple windows horizontally, vertically, sequentially, or evenly. Often called as multiple document interface ( MDI).
At the highest level is the HTML <div> tag.

Type

uiplugin

Property Summary

autoArrange
Upon a window being closed, the remaining windows will be automatically arranged.
class
Same as the class property in HTML. The class defined in the CSS file or style block can be applied. Multiple classes can be defined with being divided by blank space.
closeType
[default:all, fixedWindow, noneFixedWindow] Set the window not to be closed upon the end user’s clicking the Close All button.
confirmFalseAction
[default:newWindow, selectWindow, existWindow] Action to be taken upon the end user's clicking Cancel to the confirmation message.
confirmMessage
Content of the confirmation message to display when the useConfirmMessage is true.
confirmTrueAction
[default:existWindow, selectWindow, newWindow] Action to be taken upon the end user's clicking Yes to the confirmation message.
controlIconPosition
Position of the control icon of the WindowContainer. [default: left]
customMsg
Customized message to be displayed on the lower part of the window.
defaultHeight
[default:210px] Default height of the window (in pixels or %). The width in CSS setting.
defaultWidth
[default:300px] Default width of the window (in pixels or %). The width in CSS setting.
fixArrangeFullScreen
[default:false, true] Uses the full screen even when there are less windows than the arrangeNum. Valid when the useFixButton is true.
frameModal
Opens a modal popup within the WFrame. [default: false,true]
frameMode
[default:iframe, wframe] Determines the frame type to use within the window - IFrame or WFrame.
hideTitleOnMaximize
[default:false, true] Hides the window title upon maximizing the window. (In case the window is hidden, the user can maximize or restore the window size using the controlIcon.)
horizontalArrangeNum
[default:2] Number of the windows to horizontally arrange. Valid when the useFixButton is true.
id
Component ID
keepSelectedWindow
[default:false, true] Decides whether to keep the current window selection after window arrangement.
lineBreakNum
[default:4] Breaks the line when there are more windows than the specified count upon vertical or horizontal arrangement.
minimumHeight
[default:150px] Minimum height of the window (in pixels or %).
minimumWidth
[default:150px] Minimum width of the window (in pixels or %).
nameLayerMove
[default: false, true] Moves the window tab through mouse drag-and-drop.
nameLayerMoveGap
[default: 110] When useNameContainer is true, specify the unit distance to move the nameLayer using the arrow keys. (Unit: px)
nameLayerRearrange
Moves the fixed (useFixButton=”true”) window to the first position on the name layer. [default: false, true]
processMsgFrame
Opens the processMsg within the WFrame during asynchronous session. [default: false,true]
restoreWinSize
[default:false, true] Restores the defaultHeight and the defaultWidth used in initial window creation.
sequentialArrangeColNum
[default:2] Number of the columns when arranging windows in tiles. Valid when the useFixButton is true.
sequentialArrangeRowNum
[default:2] Number of the rows when arranging windows in tiles. Valid when the useFixButton is true.
spaAuto
[default:false, true] Generates only one empty IFrame in the SPA mode after execution of createWindow.
spaAutoDelay
[default:false, true] Set the durationto wait before creating the IFrame after execution of createWindow when the spaAuto is enabled.
spaInitCount
Number of the IFrames to create in advance for SPA mode for faster creation of windows.
spaReplaceHistory
Prevents the history feature (moving forward and backward) in the window area (IFrame) in the SPA mode.
statusMsg
Default status message to be displayed on the lower part of the window.
stopMinimizeOnNameLayer
Keeps the window size instead of minimizing it upon the end user’s clicking the name layer of the window.
stopToggleOnLast
Maintains the window size upon user's clicking the name layer of the window when there is a single window.
tabIndex
The focusing order by the Tab key.
toolbarPosition
[default:bottom] Toolbar position
toolbarWidth
Toolbar width defined by the user.
tooltipDisplay
[default:true, false] Displays the tooltip on the name layer.
tooltipGroupClass
[default:true, false] Includes w2group style in the tooltip when the tooltipDisplay is true.
useCloseButton
[default:false, true] Uses Close button on the name layer.
useConfirmMessage
[default:true, false] Uses a confirmation message for overlapping windows when dynamically creating a window with createWindow API. Note the following.
useControlIconTitle
[default:false, true] Inserts a title in the control icon (vertical, horizontal, cascade, and tile arrangements, and close button).
useCustomMsg
[default:false, false] Uses the customized message on the lower part of the window.
useFixButton
[default:false, true] Uses a Fix button on the name layer.
useNameContainer
[default:false] Covers the name layer in the toolbar with div tag.
userData1
User-defined property
userData2
User-defined property
userData3
User-defined property
useStatusMsg
[default:true, false] Uses a status message on the lower part of the window.
useWindowScrollButton
Adds a button to open the list of the currently open windows.
verticalArrangeNum
[default:2] Number of the windows to vertically arrange. Valid when the useFixButton is true.
windowAutoResize
[default:false, true] Rearranges and resizes the child windows upon execution of setSize().
windowMaximizeAll
Maximizes all windows at the same time.
windowMaxNum
[default:5] Maximum number of the windows when creating windows using the createWindow API.
windowMoveType
Decides how to display a window part of which is dragged out of the WindowContainer.
windowScrollVisibleRowNum
Sets the row count of the window list in case of useWindowScrollButton="true".
windowTooltipDisplay
[default:true, false] Displays the tooltip on the window header.

Event Summary

onafternamelayermove
Triggered right after the window position is changed by mouse dragging-and-dropping.
onbeforecloseall
Triggered upon closing of all windows by the Close All button.
onbeforenamelayermove
Triggered right before the window position is changed by mouse dragging-and-dropping. If the event handler function returns false, the position change will be canceled.
onclosewindow
Triggered upon a single window closed by the Close button.
oncustomcontrolclick
Triggered upon the end user’s clicking the control icon created by the controlIconFormatter.
oncustomcontrolout
Triggered upon mouse moving out from the icon created by the controlIconFormatter.
oncustomcontrolover
Triggered upon the control created by the controlIconFormatter being moused over.
onmenuclick
Triggered upon the menu of the nameLayer being clicked while the nameLayerMenu is true.
onwindowchange
Triggered upon a window being opened/closed.
onwindowload
Triggered when the new window is completely loaded.
onwindowtabclick
Triggered when the tab of the child window in the WindowContainer is clicked.
onwindowunload
Triggered upon a change or removal of the src of a certain window.

Method Summary

addClass( className )
Adds a CSS class to the component.
bind( eventType , function )
Dynamically allocate an event and the handler function to the component.
changeClass( oldClassName , newClassName )
Changes the class currently applied to the corresponding WebSquare component. (Supported in all WebSquare components.)
closeOthers( windowId )
Closes all popups except the currently activated popup.
closeWindow( windowId )
Closes the currently selected window.
createFrame( )
Dynamically creates an empty IFrame. However, if the total number of IFrames is same as the windowMaxNum, calling this function will not generate an empty IFrame.
createWindow( title , iconUrl , src , windowTitle , windowId , openAction , closeAction , windowTooltip , windowHeaderHTML , options , frameMode )
Creates a window.
fixWindow( winInfoId )
Fixes the window of the specified ID.
focus( )
Focuses the WebSquare component.
getDisabled( )
Returns the current value of the disabled property.
getFrame( windowId )
Returns the frame object (iframe or wframe) of the specified windowId.
getGenerator( )
In case generated by the Generator component, returns the parent Generator object that created the component itself.
getID( )
Returns the ID of the WebSquare component.
getInitStyle( CSS )
Returns the initial style of the WebSquare component.
getOpacity( )
Returns the opacity of the WebSquare component. (Supported in all WebSquare components.)
getOriginalID( )
Returns the originalID of the WebSquare component. (Supported in all WebSquare components.)
getPluginName( )
Returns the name of the WebSquare component.
getPosition( positionName )
Returns the position (left and top) of the WebSquare component. (Supported in all WebSquare components.)
getReadOnly( )
Returns the current value of the readOnly property.
getScope( )
For the child component of a scope="true" WFrame, returns the parent WFrame object. (Supported in all WebSquare components.)
getScopeWindow( )
For the child component of a scope="true" WFrame, returns the parent WFrame object. (Supported in all WebSquare components.)
getSelectedIndex( )
Gets the index of the selected window.
getSelectedWindowId( )
Returns the ID of the selected window.
getSize( sizeName )
Sets the size (width and height) of the WebSquare component. (Supported in all WebSquare components.)
getStyle( propertyName )
Returns the CSS setting of the WebSquare component.
getStyleValue( style )
[deprecated]
getTitle( )
Returns the title of the WebSquare component.
getUdcHome( )
Returns the path of the UDC file including the file name in which the UDC object is defined. (Supported in all WebSquare components.)
getUdcRoot( )
Returns the path of the UDC file in which the UDC object is defined. (Supported in all WebSquare components.)
getUniqueIdByTitle( title )
Returns the unique ID of the window with the specified title.
getUniqueIdByWindowId( windowId )
Returns the unique ID of the window with the specified windowID.
getUserData( key )
Returns the value set by setUserData or directly defined by the user in the XML file.
getWindow( title )
Returns the window object of the corresponding title.
getWindowByUniqueId( uuid , focus )
Returns the window object with the given uniqueID.
getWindowByWindowId( windowId , focus )
Returns the window object of corresponding windowId.
getWindowLabel( windowId , type )
Returns the label (text) depending on the type received.
hasClass( className )
Checks whether the WebSquare component has a certain class.
hide( )
Hides the WebSquare component. (Supported in all WebSquare components.)
isMultiView( )
Returns the current status of the multiView mode (to view two windows in parallel.)
removeClass( className )
Removes a class from the WebSquare component. (Supported in all WebSquare components.)
restoreWindowSize( windowId )
Restores the window of the specified windowId to the previous size (as set by defaultWidth and defaultHeight).
setAllWindowStatusMsg( msg )
Sets the status message of all windows.
setArrangeWindows( type , windowIdArray )
Aligns windows.
setDisabled( disabled )
Sets the disabled property of the WebSquare component.
setEventPause( evList , flag )
Pauses the event.
setFocus( index )
Focuses the window of the corresponding index.
setInitStyle( property )
Restores the initial style of the WebSquare component.
setMenu( arrData , height )
Dynamically sets the menu list when using the nameLayerMenu property.
setMultiView( windowId , direction )
Runs the multiView mode (to view the two windows in parallel.)
setOpacity( value )
Sets the opacity in the WebSquare component. (Supported in all WebSquare components.)
setPosition( left , top , mode )
Sets the position (left, top) of the WebSquare component.
setReadOnly( readOnly )
Sets the readOnly proprety of the WebSquare component.
setSingleView( )
Cancels the multiView mode (to view the two windows in parallel.)
setSize( width , height )
Adjusts the component size.
setStyle( propertyName , value )
Sets the CSS of the WebSquare component.
setUserData( key , value )
Sets random data in the WebSquare component. (Supported in all WebSquare components.)
setWindowCustomMsg( msg )
Sets the customized message for the current window.
setWindowLabel( windowId , type , value )
Sets the label according to the window type.
setWindowMaxNum( windowMaxNum )
Sets the maximum number of the windows that can be opened in the WindowContainer.
setWindowPosition( left , top )
Sets the position of the currently selected window (in pixels).
setWindowSize( width , height )
Sets the size of the currently selected window (in pixels).
setWindowStatusMsg( msg )
Sets the status message of the current window.
setZIndex( windowIndex )
Sets the Z index as much as the given parameter.
show( displayType )
Shows the WebSquare component on the page. (Supported in all WebSquare components.)
toggleClass( className )
Adds or removes a CSS class to or from a WebSquare component. (Supported in all WebSquare components.)
trigger( type , array )
Triggers the specified event in the WebSquare component.
unbind( type , function )
Removes the specified event from the WebSquare component.
visible( flag )
[deprecated]

Property Detail

autoArrange
Upon a window being closed, the remaining windows will be automatically arranged.
class
Same as the class property in HTML. The class defined in the CSS file or style block can be applied. Multiple classes can be defined with being divided by blank space.
WebSquare5 Engine applies different classes to different components. By defining a common class, the common class can be applied to multiple components.
closeType
[default:all, fixedWindow, noneFixedWindow] Set the window not to be closed upon the end user’s clicking the Close All button.
all: Closes all windows regardless of the fix pin. (Default)
noneFixedWindow: Does not close windows with the fix pin.
fixedWindow : Closes only the windows with the fix pin.
Related Property: useFixButton="true"
confirmFalseAction
[default:newWindow, selectWindow, existWindow] Action to be taken upon the end user's clicking Cancel to the confirmation message.
(newWindow: On a new window, selectWindow: On the existing window, existWindow: Load the source on the windowID window)
confirmMessage
Content of the confirmation message to display when the useConfirmMessage is true.
The Engine displays the confirmation message by checking the window title values.
confirmTrueAction
[default:existWindow, selectWindow, newWindow] Action to be taken upon the end user's clicking Yes to the confirmation message.
(newWindow: Load on a new window. / selectWindow: Select of the current tabs. / existWindow: Load the new src on the tab of the corresponding tabID and select the tab.)
controlIconPosition
Position of the control icon of the WindowContainer. [default: left]
Valid only for useNameContainer="true". (Options) "left" (Default) : Displays the icons on the left except the arrow buttons. "right" : Displays only the control icons on the left, not the arrow buttons. "allRight" : Displays both the arrow buttons and the control icons on the right.
customMsg
Customized message to be displayed on the lower part of the window.
defaultHeight
[default:210px] Default height of the window (in pixels or %). The width in CSS setting.
When the window opens for the fist time, it is in maximum size. By clicking the resizing button on the upper-right corner, the user can change the window size to the default size.
defaultWidth
[default:300px] Default width of the window (in pixels or %). The width in CSS setting.
When the window opens for the fist time, it is in maximum size. By clicking the resizing button on the upper-right corner, the user can change the window size to the default size.
fixArrangeFullScreen
[default:false, true] Uses the full screen even when there are less windows than the arrangeNum. Valid when the useFixButton is true.
Related Properties: verticalArrangeNum, horizontalArrangeNum, sequentialArrangeRowNum, sequentialArrangeColNum
frameModal
Opens a modal popup within the WFrame. [default: false,true]
Applicable only to the “wframe” windows created by createWindow. (frameMode="wframe")
However, when the popup has frameModal="top", the popup will be displayed on the top. (Options) "true" (Default) : Displays within the WFrame. "false" : Follows the frameModal setting of the popup.
frameMode
[default:iframe, wframe] Determines the frame type to use within the window - IFrame or WFrame.
hideTitleOnMaximize
[default:false, true] Hides the window title upon maximizing the window. (In case the window is hidden, the user can maximize or restore the window size using the controlIcon.)
horizontalArrangeNum
[default:2] Number of the windows to horizontally arrange. Valid when the useFixButton is true.
id
Component ID
The component ID is allocated as a global object. The script can access each object through the component ID.
keepSelectedWindow
[default:false, true] Keeps the current window selection after window arrangement. (Valid when the useFixButton is set as “false”.)
lineBreakNum
[default:4] Breaks the line when there are more windows than the specified count upon vertical or horizontal arrangement.
When useFixButton is true, the arrangeNum (and the related properties) will be used.
Related Properties: verticalArrangeNum, horizontalArrangeNum, sequentialArrangeRowNum, sequentialArrangeColNum
minimumHeight
[default:150px] Minimum height of the window (in pixels or %).
minimumWidth
[default:150px] Minimum width of the window (in pixels or %).
nameLayerMove
[default: false, true] Moves the window tab through mouse drag-and-drop.
true: Moves the window tab.
false (Default): The window tab cannot be moved.
Similar Properties: moveTab of the TabControl
nameLayerMoveGap
[default: 110] When useNameContainer is true, specify the unit distance to move the nameLayer using the arrow keys. (Unit: px)
nameLayerRearrange
Moves the fixed (useFixButton=”true”) window to the first position on the name layer. [default: false, true]
Valid when the useFixButton is "true".
processMsgFrame
Opens the processMsg within the WFrame during asynchronous session. [default: false,true]
Applicable only to the “wframe” windows created by createWindow. (frameMode="wframe") (Options) "false" (Default) : Displays within the WFrame. "true": Displays on the entire screen.
(Related Function) windowContainer1.createWindow({ "title" : "Source", "src" : "souce.xml", "windowId" : "window1", "frameMode" : "wframe" });
restoreWinSize
[default:false, true] Restores the defaultHeight and the defaultWidth used in initial window creation.
Related API: restoreWindowSize
sequentialArrangeColNum
[default:2] Number of the columns when arranging windows in tiles. Valid when the useFixButton is true.
sequentialArrangeRowNum
[default:2] Number of the rows when arranging windows in tiles. Valid when the useFixButton is true.
spaAuto
[default:false, true] Generates only one empty IFrame in the SPA mode after execution of createWindow.
Prior to the spaInitCount. If this property is true, the spaInitCount setting will be ignored.
In case maximum number of windows have been already created, no more empty IFrames will be created.
(Version: Added in 5.0_2.2777B.20170904.121217.)
spaAutoDelay
[default:false, true] Set the durationto wait before creating the IFrame after execution of createWindow when the spaAuto is enabled.
If createWindow is called more frequently, an empty IFrame will be crated after the last calling of createWindow.
The default is 3000ms. In other words, an empty IFrame will be generated 3 seconds later the createWindow is called.
(Version: Added in 5.0_2.2777B.20170904.121217.)
spaInitCount
Number of the IFrames to create in advance for SPA mode for faster creation of windows.
The SPA mode is to create IFrames and load the resources in advance. Using the SPA mode will improve loading performances of the windows created by the createWindow.
If the value is larger than 0, the SPA mode will be enabled. Otherwise, the value should be same as the windowMaxNum.
spaReplaceHistory
Prevents the history feature (moving forward and backward) in the window area (IFrame) in the SPA mode.
Prevents moving to the previous page in the IFrame in order to prevent display of a blank page. Clicking the previous button will display the previous page of the browser, not the IFrame.
true: Prevents moving to the next or previous pages.
false (Default): Allows moving to the next or previous pages.
statusMsg
Default status message to be displayed on the lower part of the window.
stopMinimizeOnNameLayer
Keeps the window size instead of minimizing it upon the end user’s clicking the name layer of the window.
stopToggleOnLast
Maintains the window size upon user's clicking the name layer of the window when there is a single window.
tabIndex
The focusing order by the Tab key.
Same as the tabindex property in HTML.
toolbarPosition
[default:bottom] Toolbar position
toolbarWidth
Toolbar width defined by the user.
tooltipDisplay
[default:true, false] Displays the tooltip on the name layer.
tooltipGroupClass
[default:true, false] Includes w2group style in the tooltip when the tooltipDisplay is true.
useCloseButton
[default:false, true] Uses Close button on the name layer.
useConfirmMessage
[default:true, false] Uses a confirmation message for overlapping windows when dynamically creating a window with createWindow API. Note the following.
If openAction is not defined among the parameters of the createWindow API and the window IDs overlap, use the following properties to confirm the overlapping windows.
Related Properties: confirmMessage, confirmTrueAction, confirmFalseAction
useControlIconTitle
[default:false, true] Inserts a title in the control icon (vertical, horizontal, cascade, and tile arrangements, and close button).
Upon the user's hovering the mouse over the icon, the description will be displayed.
useCustomMsg
[default:false, false] Uses the customized message on the lower part of the window.
useFixButton
[default:false, true] Uses a Fix button on the name layer.
useNameContainer
[default:false] Covers the name layer in the toolbar with div tag.
userData1
User-defined property. Use getUserData("userData3") to get the data. // Example getUserData("userData1");
userData2
User-defined property. Use getUserData("userData2") to get the data. // Example getUserData("userData2");
userData3
User-defined property. Use getUserData("userData3") to get the data. // Example getUserData("userData3");
useStatusMsg
[default:true, false] Uses a status message on the lower part of the window.
useWindowScrollButton
Adds a button to open the list of the currently open windows.
verticalArrangeNum
[default:2] Number of the windows to vertically arrange. Valid when the useFixButton is true.
windowAutoResize
[default:false, true] Rearranges and resizes the child windows upon execution of setSize().
windowMaximizeAll
Maximizes all windows at the same time.
windowMaxNum
[default:5] Maximum number of the windows when creating windows using the createWindow API.
windowMoveType
Decides how to display a window part of which is dragged out of the WindowContainer. (Options) "restrict" (Default) : Restricts the window inside the Window Container. "overflow" : Allows moving of the window outside the WindowContainer.
windowScrollVisibleRowNum
Sets the row count of the window list in case of useWindowScrollButton="true". (Default: "5")
windowTooltipDisplay
[default:true, false] Displays the tooltip on the window header.

Event Detail

onafternamelayermove
Triggered right after the window position is changed by mouse dragging-and-dropping.
Related Property: nameLayerMove="true"
Parameter
nametypedescription
infoObjectReturns an object containing startWindowID, startIndex, endWindowID, and endIndex. <Number> info.startIndex : Index of the nameLayer that started moving (on the page) <String> info.startWindowID: ID of the nameLayer that started moving <Number> info.endWindowID: ID of the nameLayer at the moving-ending point (The nameLayer will be located on the left of the nameLayer from which the moving originally started moving .) <Number> info.endIndex : Index of the nameLayer at the moving-ending point (The nameLayer will be located on the left of the nameLayer from which the moving originally started moving .)
onbeforecloseall
Triggered upon closing of all windows by the Close All button.
onbeforenamelayermove
Triggered right before the window position is changed by mouse dragging-and-dropping. If the event handler function returns false, the position change will be canceled.
Related Property: nameLayerMove="true"
Parameter
nametypedescription
infoObjectReturns an object containing startWindowID, startIndex, endWindowID, and endIndex. <Number> info.startIndex : Index of the nameLayer that started moving (on the page) <String> info.startWindowID: ID of the nameLayer that started moving <Number> info.endWindowID: ID of the nameLayer at the moving-ending point (The nameLayer will be located on the left of the nameLayer from which the moving originally started moving .) <Number> info.endIndex : Index of the nameLayer at the moving-ending point (The nameLayer will be located on the left of the nameLayer from which the moving originally started moving .)
onclosewindow
Triggered upon a single window closed by the Close button.
Parameter
nametypedescription
eventObjectReturns an event object triggered upon clicking of the Close button. <String> event.src : Value of the src property of the window closed by the Close button <String> event.title : Value of the title property of the window closed by the Close button
oncustomcontrolclick
Triggered upon the end user’s clicking the control icon created by the controlIconFormatter.
Parameter
nametypedescription
controlIdStringID of the control icon added
oncustomcontrolout
Triggered upon mouse moving out from the icon created by the controlIconFormatter.
Parameter
nametypedescription
controlIdStringID of the control icon added
oncustomcontrolover
Triggered upon the control created by the controlIconFormatter being moused over.
Parameter
nametypedescription
controlIdStringID of the control icon added
onmenuclick
Triggered upon the menu of the nameLayer being clicked while the nameLayerMenu is true.
Parameter
nametypedescription
windowIdStringID of the menu-selected window
valueStringSelected menu value (label)
onwindowchange
Triggered upon a window being opened/closed.
Parameter
nametypedescription
oldWindowIdStringID of the closed window
newWindowIdStringID of the activated window
onwindowload
Triggered when the new window is completely loaded.
Parameter
nametypedescription
windowIdStringWindow ID
Sample
Define lazy="false" first in the script before using the event. <script type="javascript" lazy="false"><![CDATA[ scwin.windowContainer1_onwindowload = function(windowId) { console.log("window [" + windowId + "] load complete"); }; ]]></script>
onwindowtabclick
Triggered when the tab of the child window in the WindowContainer is clicked.
Parameter
nametypedescription
oldWindowIdStringID of the previous window
newWindowIdStringID of the currently selected window
onwindowunload
Triggered upon a change or removal of the src of a certain window.
Parameter
nametypedescription
windowIdStringWindow ID
Sample
<script type="javascript" lazy="false"><![CDATA[ scwin.windowContainer1_onwindowunload = function(windowId) { console.log("window [" + windowId + "] unload complete"); }; ]]></script>

Method Detail

addClass( className )
Adds a CSS class to the component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
classNameStringYName of the class to add
Sample
// (Example) // Add oddClass to input1 component. input1.addClass("oddClass");
bind( eventType , function )
Dynamically allocate an event and the handler function to the component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
eventTypeStringYEvent to allocate
functionFunctionYHandler function of the event
Sample
// (Example 1) // Define a function for the onclick event of input1. input1.bind("onclick", function(e){ alert(input1.getValue();})); // (Example 2) // Define commObj.ev_click function in advance. var commObj = {}; commObj.ev_click = function(e){ alert("click :: "+this.id); }; // Dynamically allocate onclick event and the handler function to input1 component. input1.bind("onclick", commObj.ev_click );
changeClass( oldClassName , newClassName )
Changes the class currently applied to the corresponding WebSquare component. (Supported in all WebSquare components.)
Only the classes added by addClass can be changed.
In order to remove classes directly defined in the class propert of the WebSquare component, add the following in config.xml. // Add the following in config.xml.
Parameter
nametyperequireddescription
oldClassNameStringYClass to change
newClassNameStringYClass to newly use
Sample
// The class is directly defined in the inputBox component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" class="tmpInputClass"></xf:input> // Add the following in config.xml. <style> <removeDefaultClass value="true" /> </style> // Change the class. // Change tmpInputClass class to tmpInputWarninClass. input1.changeClass("tmpInputClass","tmpInputWarninClass");
closeOthers( windowId )
Closes all popups except the currently activated popup.
Parameter
nametyperequireddescription
windowIdStringNWindow ID. If not specified, the currently active window will be used.
Sample
// Close all windows except the currently activated window. windowContainer1.closeOthers(); // Close the window of the specified windowId. // In case the windowID is not specified for createWindow(), the title will be used as the ID. windowContainer1.createWindow( "tmp001" , null , "/uiTestW5/test001.xml"); windowContainer1.closeOthers("tmp001"); // The windowId and the title are different. windowContainer1.createWindow( "tmp001" , "wc1" , "/uiTestW5/test001.xml"); windowContainer1.closeOthers("wc1");
closeWindow( windowId )
Closes the currently selected window.
Same as clicking the Close button on the window.
Parameter
nametyperequireddescription
windowIdStringNID of the window to close If not specified, the currently active window will be closed.
Sample
// Close the current window. windowContainer1.closeWindow();
createFrame( )
Dynamically creates an empty IFrame. However, if the total number of IFrames is same as the windowMaxNum, calling this function will not generate an empty IFrame.
(Version: Added in 5.0_2.2777B.20170904.121217.)
createWindow( title , iconUrl , src , windowTitle , windowId , openAction , closeAction , windowTooltip , windowHeaderHTML , options , frameMode )
Creates a window.
Parameter
nametyperequireddescription
titleStringYTitle to be displayed on the name layer
iconUrlStringYURL of each window icon. Currently not in use.
srcStringYAddress to be displayed on the window
windowTitleStringNWindow title to be displayed on the window header. In case of null or "", the title value will be displayed.
windowIdStringNWindow ID. If null or "" is entered, the title will be used as the ID.
openActionStringN[existWindow, newWindow, selectWindow] xistWindow: If there is a window of the same ID, uses the existing window. / newWindow: Always creates a new window. / selectWindow: If there is a window of the same ID, selects the window.
closeActionStringNFunction to be called upon window closing. (The return value must be Boolean. false is not to close, and true is to close.)
windowTooltipStringNWindow tooltip. (If not specified, the windowTile will be set as the tooltip.)
windowHeaderHTMLStringNContent to display at the center of the header of the window. Input can be made in the DOM element.
optionsObjectNOptions of the window to create.
<Boolean> options.fixed Uses the fixing pin. <Boolean> options.useNameLayer Uses the name layer. <String> options.defaultWidth Default width of the window. <String> options.defaultHeight Default height of the window.
frameModeStringNWindow type. frameMode = "iframe" is to create a window on the IFrame, while frameMode = "wframe" is to create on the WFrame.
Sample
// (Case 1) Create a window without specifying options. windowContainer1.createWindow( "edu001" , null , "/uiTestW5/searchBox.xml" ); // The window ID is edu001, and the header title and the name layer is "edu001". // (Case 2) Create an window using closeAction with specifying options. // Define a function to control closing of the windows in the script block. - Use closeAction when executing the createWindow API. function fn_closeMsg(){ return confirm("do you close this window?"); // Use a window with OK and Cancel buttons. //return false; // Cancels window closing. } windowContainer1.createWindow( "music" , "" , "/test/music.xml", "page001", "P0001", "existWindow", "fn_closeMsg"); // A window of which ID is P0001 will be created, and is name layer will be "music" and the header title "page001". // Upon closing of the window, fn_closeMsg Function will be called. // Pass data to the window to be newly created (through the dataObject.) // // Define the actual data to pass. var rowJSON = { "Personal Info" : { "Name": "Lee", "Age": 50, "Married" : false}, "Region": "Seoul", "Carrier": true }; // Define window options and the data to pass (through the dataObject.) var obj = { "title" : "Test", "windowID": "001", "frameMode" : "wframe", "src" : "popup_sub.xml", "dataObject": { "type" : "json", "name" : "windowParam", "data" : rowJSON } }; // Create a window. windowCon1.createWindow(obj); // The newly created window checks the passed data. // var paramData = $p.getParameter("windowParam"); // var data = JSON.stringify(paramData); // alert(data);
fixWindow( winInfoId )
Fixes the window of the specified ID.
Parameter
nametyperequireddescription
winInfoIdStringYWindow ID
focus( )
Focuses the WebSquare component. (Supported in all WebSquare components.)
getDisabled( )
Returns the current value of the disabled property. (Supported in all WebSquare components.)
Return
typedescription
BooleanValue of the disabled property
Sample
// (Example) Check the current value of the disabled property. var returnValue = componentId.getDisabled(); // (Return Example) false
getFrame( windowId )
Returns the frame object (iframe or wframe) of the specified windowId.
Parameter
nametyperequireddescription
windowIdStringYwindowId
Return
typedescription
Objectframe object
Sample
windowContainer1.createWindow({"title" : "TEST", "src" : "sub.xml", "windowId" : "window1"}); windowContainer1.getFrame("window1").setSrc("sub2.xml");
getGenerator( )
In case generated by the Generator component, returns the parent Generator object that created the component itself. (Supported in all WebSquare components.)
Return
typedescription
ObjectParent Generator object
Sample
// (Example) The Generator (parent) create a Trigger (child). <w2:generator id="generator1"> <w2:trigger id="trigger1" ev:onclick="scwin.trigger1_onclick"></w2:trigger></w2:generator> // In the example below, upon the end user’s clicking the Trigger 1, the generator1 object will be displayed on the console. scwin.trigger1.onclick = function(){ console.log(this.getGenerator());}
getID( )
Returns the ID of the WebSquare component. (Supported in all WebSquare components.)
Return
typedescription
StringWebSquare component ID
Sample
// Upon dynamically receiving a WebSquare component, the ID can be checked as shown below. function fn_validCheck(tmpObj){ var compID = tmpObj.getID(); } // If the tmpObj in the above example has "input1" ID. // (Return) "input1"
getInitStyle( CSS )
Returns the initial style of the WebSquare component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
CSSStringNProperty (If not specified, all properties will be displayed.)
getOpacity( )
Returns the opacity of the WebSquare component. (Supported in all WebSquare components.)
The Engine returns the opacity value of the CSS.
Return
typedescription
IntegerOpacity
Sample
// Apply the opacity CSS to the InputBox component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;opacity:0.2;"></xf:input> // Return the opacity of the InputBox. var returnValue = input1.getOpacity(); // A real number between 0 and 1 will be returned. // (Return) "0.2"
getOriginalID( )
Returns the originalID of the WebSquare component. (Supported in all WebSquare components.)
The originalID is valid when the scope function is in use.
For scope="true" WFrame, component IDs inside the WFrame is changed with the prefix(wframeID + "_") being added before the ID given by the user (originalID).
The originalID means the ID before the prefix being added.
Return
typedescription
StringoriginalID of the component
Sample
// An example of multi-WFrame page // Main page with a WFrame (main.xml) <w2:wframe id="wframe1" src="text.xml" scope="true"/> // Source page to be contained in the WFrame (text.xml) <w2:textbox id="textbox1"/> // (Example) Check the Id and the original ID in the script of text.xml // Run getID. textbox1.getID(); // "wframe1_textbox1" is returned. // Run getOriginalID. textbox1.getOriginalID(); // "textbox1" is returned.
getPluginName( )
Returns the name of the WebSquare component. (Supported in all WebSquare components.)
Return
typedescription
StringName of the WebSquare component (pluginName)
Sample
// When a common function dynamically receives a WebSQuare object as shown below, different actions can be made for each component type. var commObj = {}; commObj.fn_makeReqData = function(tmpObj){ var tmpID = tmpObj.getID(); // Component ID var tmpCompType = tmpObj.getPluginName(); // Component name if(tmpCompType == "input"){ //..Logic.. }else if(tmpCompType == "gridView"){ //..Logic .. }else{ //..Logic.. } };
getPosition( positionName )
Returns the position (left and top) of the WebSquare component. (Supported in all WebSquare components.)
When the position is set in 0%, the value will be converted into %.
Parameter
nametyperequireddescription
positionNameStringY[left, top] Position type
Return
typedescription
NumberPosition of the component
Sample
// CSS margin is applied to the Input component as shown below. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;margin:10px;"></xf:input> // (Example) Check the top value of the InputBox. var returnValue = input1.getPosition("top"); // Position value in pixels will be returned. // (Return) 10
getReadOnly( )
Returns the current value of the readOnly property. (Supported in all WebSquare components.)
Return
typedescription
BooleanThe current setting of the readOnly property
Sample
// Example to check the readOnly setting of the component. var returnValue = componentId.getReadOnly(); // (Return Example) false
getScope( )
For the child component of a scope="true" WFrame, returns the parent WFrame object. (Supported in all WebSquare components.)
For scope="true" WFrame, null will be returned.
Return
typedescription
ObjectWFrame object or null
Sample
// (Example) // The main page has wframe1 which contains wframe1 which also contains wframe11. // The source page of wframe11 has textbox1. textbox1.getScope(); // (Return Example) wframe11 object
getScopeWindow( )
For the child component of a scope="true" WFrame, returns the parent WFrame object. (Supported in all WebSquare components.)
If not a child of a scope="true" WFrame, a global window object will be returned.
Return
typedescription
ObjectScope object of the WFrame or a global window object
Sample
// (Example) // The main page has wframe1 which contains wframe1 which also contains wframe11. // The source page of wframe11 has textbox1. var scope = textbox1.getScopeWindow(); scope.wframe11 === textbox1.getScope(); // true
getSelectedIndex( )
Gets the index of the selected window.
Return
typedescription
NumberIndex of the selected window
Sample
// The first window among three windows is selected. var tmpRs = windowContainer1.getSelectedIndex(); // (Return Example) 0
getSelectedWindowId( )
Returns the ID of the selected window.
If the window ID is not specified for createWindow, the title will be used as the ID.
Sample
// Case 1. Create a window without specifying window ID. windowContainer1.createWindow( "page001" , null , "/uiTestW5/test0001.xml"); var tmpRs1 = windowContainer1.getSelectedWindowId(); // (Return) "page001" // Case 2. Set a window ID and create a window. windowContainer1.createWindow( "page001" , null , "/uiTestW5/test0001.xml", "page001" , "p001"); var tmpRs2 = windowContainer1.getSelectedWindowId(); // (Return) "p001"
getSize( sizeName )
Sets the size (width and height) of the WebSquare component. (Supported in all WebSquare components.)
If set in %, values will be converted into pixels.
Parameter
nametyperequireddescription
sizeNameStringYSize types. For calculation of each size type, see the below:
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
NumberSize of the component
Sample
var returnValue = componentId.getSize("width"); // (Return Example) 100 // Values are in pixels. // If set in %, values will be converted into pixels.
getStyle( propertyName )
Returns the CSS setting of the WebSquare component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
propertyNameStringYCSS property to return
Return
typedescription
StringCSS value
Sample
// Define an Input component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;"></xf:input> // (Example) Check the width of the InputBox above. var returnValue = input1.getStyle("width"); // (Return) "144px"
getStyleValue( style )
[deprecated]
Use getStyle instead.
Returns the current CSS applied to the WebSquare component.
Parameter
nametyperequireddescription
styleStringYCSS property to return
Return
typedescription
StringCSS value (Colors are returned in HexCode.)
getTitle( )
Returns the title of the WebSquare component. (Supported in all WebSquare components.)
Return
typedescription
StringTitle
Sample
// In the following example, the Title is “Input Name”. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" title="이름 입력"></xf:input> var tmpTitle = input1.getTitle(); // (Return Example) “Enter your name.”
getUdcHome( )
Returns the path of the UDC file including the file name in which the UDC object is defined. (Supported in all WebSquare components.)
The file name includes .xml. In order to get the file path without .xml, use getUdcRoot.
When called by a WebSquare component, not a UDC object, “undefined” will be returned.
Return
typedescription
StringUDC file path (For others than the UDC, undefined will be returned.)
Sample
// Example // UDC file path is /a/b/udc.xml. // Page XML is /a/c/main.xml. // UDC ID is udc1. udc1.getUdcHome(); // (Result) /a/b/udc.xml
getUdcRoot( )
Returns the path of the UDC file in which the UDC object is defined. (Supported in all WebSquare components.)
Not contains the file name. In order to get a path including the file name, use getUdcHome.
When called by a WebSquare component, not a UDC object, “undefined” will be returned.
Return
typedescription
StringUDC file path (For others than the UDC, undefined will be returned.)
Sample
// Example // UDC file path is /a/b/udc.xml. // Page XML is /a/c/main.xml. // UDC ID is udc1. udc1.getUdcHome(); // (Execution Result) /a/b/
getUniqueIdByTitle( title )
Returns the unique ID of the window with the specified title.
Parameter
nametyperequireddescription
titleStringYwindow title
Return
typedescription
Arrayunique id
Sample
// Return the unique ID of the window of which title is 'sub1'. windowContainer1.getUniqueIdByTitle('sub1');
getUniqueIdByWindowId( windowId )
Returns the unique ID of the window with the specified windowID.
Parameter
nametyperequireddescription
windowIdStringYWindow ID
Return
typedescription
Arrayunique id
Sample
// Return the unique ID of the window of which windowId is 'sub1'. windowContainer1.getUniqueIdByTitle('sub1');
getUserData( key )
Returns the value set by setUserData or directly defined by the user in the XML file. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
keyStringYData key
Return
typedescription
StringValue for the given key
Sample
// (Example) Setting the user property (setTest) in the InputBox <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" setTest="Hello"></xf:input> // Returns the value of the setTest property. input1.getUserData("setTest"); // (Return) "Hello" // Set 'valueTest' (key) and 'WebSquare' (data) through setUserData. input1.setUserData("valueTest","WebSquare"); // Returns the value of the setTest property. input1.getUserData("WebSquare"); // (Return) "WebSquare"
getWindow( title )
Returns the window object of the corresponding title.
Used to access a linked function or component on the window.
Parameter
nametyperequireddescription
titleStringYWindow title
Return
typedescription
ObjectWindow object
Sample
// Access the input1 component in the window of which title is "edu001". // Get the window of which title is "eud001". var tmpObj = windowContainer1.getWindow("edu001"); // Get the value of the input1 component in the window. var tmpRs = tmpObj.input1.getValue();
getWindowByUniqueId( uuid , focus )
Returns the window object with the given uniqueID.
Parameter
nametyperequireddescription
uuidStringYunique ID
focusBooleanNFocusing on the window
Return
typedescription
ObjectWindow object
Sample
// Get the value of input1 component by calling createWindow without specifying a window ID. (The title will be used as the ID.) // Create a window without specifying a window ID. windowContainer1.createWindow( "tmp001" , null , "/uiTestW5/test001.xml"); // Get the window of which title is "tmp001". var uniqueId = windowContainer1.getUniqueIdByTitle('tmp001'); var tmpObj = windowContainer1.getWindowByWindowId(uniqueId[0]);
getWindowByWindowId( windowId , focus )
Returns the window object of corresponding windowId.
Parameter
nametyperequireddescription
windowIdStringYWindow ID
focusBooleanNFocusing on the window
Return
typedescription
ObjectWindow object
Sample
// Get the value of input1 component by calling createWindow without specifying a window ID. (The title will be used as the ID.) // Create a window without specifying a window ID. windowContainer1.createWindow( "tmp001" , null , "/uiTestW5/test001.xml"); // Get a window of which ID is "tmp001". (The title is used as the ID.) var tmpObj = windowContainer1.getWindowByWindowId("tmp001"); // Get the value of the input1 component in the window. var tmpRs = tmpObj.input1.getValue();
getWindowLabel( windowId , type )
Returns the label (text) depending on the type received.
types: toolbar (name layer on the toolbar), window (header title), tooltip (to be displayed upon mouse hovering over the name layer of the toolbar)
Parameter
nametyperequireddescription
windowIdStringYID of the window to return
typeStringY[toolbar, window, tooltip] Type of the label
Sample
// Create a window as shown below. windowContainer1.createWindow( "edu001" , null , "/uiTestW5/searchBox.xml" , "test001" , "P001" ); // Get the name layer value var tmpRs1 = windowContainer1.getWindowLabel("P001", "toolbar"); // (Return) "edu001" // Get the header title. var tmpRs2 = windowContainer1.getWindowLabel("P001", "window"); // (Return) "test001"
hasClass( className )
Checks whether the WebSquare component has a certain class. (Supported in all WebSQuare components.)
Parameter
nametyperequireddescription
classNameStringYName of the class to check
Return
typedescription
BooleanWhether the class exists or not
Sample
// The class is directly defined in the inputBox component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" class="tmpInputClass"></xf:input> var returnValue = input1.hasClass("tmpInputClass"); // (Return) true
hide( )
Hides the WebSquare component. (Supported in all WebSquare components.)
display:none; or visibility:hidden; CSS is applied.
Sample
// (Example) Hide the component. componentId.hide();
isMultiView( )
Returns the current status of the multiView mode (to view two windows in parallel.)
Return
typedescription
BooleanTrue in case of the multiView, or false.
removeClass( className )
Removes a class from the WebSquare component. (Supported in all WebSquare components.)
Only the classes added by addClass can be removed.
In order to remove classes directly defined as a property of the component, add the following in config.xml. // Add the following in config.xml. <style><removeDefaultClass value="true" /></style>
Parameter
nametyperequireddescription
classNameStringYName of the class to remove
Sample
// If the class is directly defined as an InputBox property. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" class="tmpInputClass"></xf:input> // In the config.xml file, add the following. <style> <removeDefaultClass value="true" /> </style> // Classes can be removed by removeClass. input1.removeClass("tmpInputClass");
restoreWindowSize( windowId )
Restores the window of the specified windowId to the previous size (as set by defaultWidth and defaultHeight).
Parameter
nametyperequireddescription
windowIdStringYID of the window to restore the size
Sample
Set defaultWidth and defaultHeight as 210px and 300px each. Create a window, resize, and execute restoreWindowSize. Then, the size will be restored to defaultWidth and defaultHeight. windowContainer1.restoreWindowSize("win0");
setAllWindowStatusMsg( msg )
Sets the status message of all windows.
Parameter
nametyperequireddescription
msgStringYStatus message
Sample
// Change the status message of all windows. windowContainer1.setAllWindowStatusMsg('Have a good day!');
setArrangeWindows( type , windowIdArray )
Aligns windows.
Provides the same function as the window sorting icons on the toolbar.
Parameter
nametyperequireddescription
typeStringYSorting type.
"vertical" "horizontal" "cascade" "sequential"
windowIdArrayObjectNArray containing windowId data to sort (The useFixButton setting is ignored.)
Sample
// (Example 1) - Window are vertically open in the order of window1, window3, and window2. windowContainer1.setArrangeWindows("vertical", ["window1", "window3", "window2"]); // (Example 2) - Windows are horizontally open in the order of window2, window1, and window3. windowContainer1.setArrangeWindows("horizontal", ["window2", "window1", "window3"]);
setDisabled( disabled )
Sets the disabled property of the WebSquare component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
disabledBooleanYDisabled status
true: Disabled. false: Not disabled.
Sample
// Sets the disabled property in the component. componentId.setDisabled(true);
setEventPause( evList , flag )
Pauses the event. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
evListStringNList of the events to pause. (in case of null, all events of the corresponding WebSquare component is paused or restarted.)
flagBooleanYWhether to pause the event or not.
true: Pause. false: Not pause.
Sample
// (Example 1) // Pause the onclick event. input1.setEventPause("onclick", true); // (Example 2) // Restart the onfocus and the onblur events. input1.setEventPause("onfocus,onblur", false); // (Example 3) // Pause all events registered in input1. input1.setEventPause(null, true);
setFocus( index )
Focuses the window of the corresponding index.
Parameter
nametyperequireddescription
indexNumberYWindow index
Sample
windowContainer1.setFocus(0);
setInitStyle( property )
Restores the initial style of the WebSquare component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
propertyStringNCSS property (If not spcified, all properties will be restored.)
Sample
// (Example) group1.setInitStyle();
setMenu( arrData , height )
Dynamically sets the menu list when using the nameLayerMenu property.
Parameter
nametyperequireddescription
arrDataArrayYArray data to set the menu list
heightNumberNMenu height
setMultiView( windowId , direction )
Runs the multiView mode (to view the two windows in parallel.)
Parameter
nametyperequireddescription
windowIdStringYID of the new window to place next to the currently active window
directionNumberNPlacing direction 0 or Default : horizontal, 1 : vertical
setOpacity( value )
Sets the opacity in the WebSquare component. (Supported in all WebSquare components.)
The engine sets the opacity property (of CSS).
Parameter
nametyperequireddescription
valueNumberYOpacity (Real number between 0 and 1)
Sample
// (Example) Set the opacity as 0.45. componentId.setOpacity(0.45);
setPosition( left , top , mode )
Sets the position (left, top) of the WebSquare component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
leftNumberYLeft position value or null
topNumberYTop position value or null
modeStringNPosition setting method. [default: absolute, delta]
absolute: The inputted value becomes the position. delta: The inputted value is added to the current position.
Sample
// (Example) Set the top position as 100px. componentId.setPosition(null, 100);
setReadOnly( readOnly )
Sets the readOnly proprety of the WebSquare component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
readOnlyBooleanYSetting of the readOnly property. (“true”: Used. “false”: Not used.)
Sample
// Set the readOnly property as true. componentId.setReadOnly(true);
setSingleView( )
Cancels the multiView mode (to view the two windows in parallel.)
setSize( width , height )
Adjusts the component size.
Parameter
nametyperequireddescription
widthNumberYWidth of the component
heightNumberYHeight of the component
Sample
windowContainer1.setSize(300,300); Create a WindowContainer component of which width is 450px and height is 300px. The width must be minimum 450px and height minimum 150px.
setStyle( propertyName , value )
Sets the CSS of the WebSquare component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
propertyNameStringYCSS property to set.
valueStringYValue to set as the specified CSS property
Sample
// (Example 1) Set the width as 200px. componentId.setStyle("width", "200px"); // (Example 2) Set the background as olive. componentId.setStyle("background-color","olive");
setUserData( key , value )
Sets random data in the WebSquare component. (Supported in all WebSquare components.)
Enter key values supported by the component. In case a key value not supported by the component is entered, corresponding logs will be displayed.
Parameter
nametyperequireddescription
keyStringYData key to set
valueStringYDefined data value
Sample
// Set 'data' key and 'WebSquare' value in the component. componentId.setUserData("data", "WebSquare"); // The key must be supported in the component. componentId.setUserData("title", "WebSquare"); // Following logs will be displayed. // !!!WARNING - [title] can't be defined as UserData.
setWindowCustomMsg( msg )
Sets the customized message for the current window. (Valid when useCustomMsg is "true".)
Parameter
nametyperequireddescription
msgStringYStatus message
Sample
// Define a customized message. windowContainer1.setWindowCustomMsg('Have a good day!');
setWindowLabel( windowId , type , value )
Sets the label according to the window type.
Window types : toolbar (name layer on the toolbar), window (header title), tooltip (tooltip displayed upon mouse hovering), all (all three options).
Parameter
nametyperequireddescription
windowIdStringYWindow ID
typeStringY[toolbar, window, tooltip, all] Type of the label
valueStringYValue of the label
Sample
// Change the name layer, the header title, and the tooltipe of the window of which ID is window3 into TestWindow. windowContainer1.setWindowLabel("window3", "all", "TestWindow"); // Change the header title of the window of which id is window2 into "Test Page". windowContainer1.setWindowLabel("window2", "window", "Test Page");
setWindowMaxNum( windowMaxNum )
Sets the maximum number of the windows that can be opened in the WindowContainer.
Parameter
nametyperequireddescription
windowMaxNumNumberYMaximum number of the windows
setWindowPosition( left , top )
Sets the position of the currently selected window (in pixels).
Parameter
nametyperequireddescription
leftNumberY
topNumberY
Sample
// Locate the window at 10px on X axis and 100px on Y axis. windowContainer1.setWindowPosition('10','100');
setWindowSize( width , height )
Sets the size of the currently selected window (in pixels).
Parameter
nametyperequireddescription
widthNumberYWidth of the window
heightNumberYHeight of the window
Sample
// Set the width and the height of the current window as 200px and 300px respectively. windowContainer1.setWindowSize('200','300');
setWindowStatusMsg( msg )
Sets the status message of the current window.
Parameter
nametyperequireddescription
msgStringYStatus message
Sample
// Set the status of the current window. windowContainer1.setWindowStatusMsg('Have a good day!');
setZIndex( windowIndex )
Sets the Z index as much as the given parameter.
Parameter
nametyperequireddescription
windowIndexStringYWindow Index of the corresponding component
show( displayType )
Shows the WebSquare component on the page. (Supported in all WebSquare components.)
Sets the display property as specified and applies "visibility: show;" CSS.
Parameter
nametyperequireddescription
displayTypeStringNCSS display setting to apply.
block : Uses “display: block;”. (Default) inline : display: inline; none : display: none; "" : Restores to the previous display setting.
Sample
// (Example) display: block; componentId.show(); // (Example) Restore the previous display setting. componentId.show("");
toggleClass( className )
Adds or removes a CSS class to or from a WebSquare component. (Supported in all WebSquare components.)
Removes the class from the WebSquare component.
If the WebSquare component does not have the specified class, adds the class.
Only the classes added by addClass can be removed.
In order to remove classes directly defined as a property of the component, add the following in config.xml. // Add the following in config.xml. <style><removeDefaultClass value="true" /></style>
Parameter
nametyperequireddescription
classNameStringYClass to add or remove
Sample
// The class is directly defined in the inputBox component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" class="tmpInputClass"></xf:input> // Add the following in config.xml. <style> <removeDefaultClass value="true" /> </style> // Remove tmpInputClass class. input1.toggleClass("tmpInputClass"); // Add the (previously removed) tmpInputClass. input1.toggleClass("tmpInputClass");
trigger( type , array )
Triggers a certain event in the component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
typeStringYEvent to trigger
arrayArrayNArray of parameters to send to the event handler
Sample
// (Example 1) // Trigger the onclick event in input1 component. input1.trigger("onclick"); // (Example 2) // Trigger the onviewchange event in input1, and send (1, 2) parameter to the handler function. input1.trigger("onviewchange", [1,2]);
unbind( type , function )
Removes the event from the component. (Supported in all WebSquare component.)
Parameter
nametyperequireddescription
typeStringNEvent to remove. (If not specified, all events of the component will be removed.)
functionFunctionNHandler function of the event to remove. (If not specified, all handler functions of the event will be removed.)
Sample
// (Example 1) // Remove all events registered in the input1 component. input1.unbind(); // (Example 2) // Remove all handler functions for the onviewchange event of the input1 component. input1.unbind("onviewchange"); // (Example 3) // Remove func1 for the onviewchange event of the input1 component. input1.unbind("onviewchange", func1);
visible( flag )
[deprecated]
Use show/hide or setStyle instead.
The Engine sets the CSS visibility property.
Parameter
nametyperequireddescription
flagBooleanYCSS visibility setting
true : visibility: visible; false : visibility: hidden;