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

CheckComboBox. An extended version of <select> tag of HTML. As a combined type of SelectBox and CheckBox, supports multiple selections. Various tags are used under the <div> tag at the highest level.

Type

uiplugin

Property Summary

allOption
Displays “-All-” on the selection list.
animation
Animation effects to apply to the selection item list.
appearance
Selection item display method
checkboxClickSync
Synchronizes with the selection on the CheckBox.
checkDisabledOnAllCheck
Select disabled items also when selecting all items.
chooseOption
Shows the selection guide message. [default: false, true]
chooseOptionLabel
Set the label of the selection guide message.
chooseOptionLabelLocaleRef
Key of the chooseOptionLabel text.
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.
closeonmouseleave
Closes the list upon mouse moving out when the list is open on the subLayer. [default:false, true]
customLabelFormatter
Specify the user-defined function that can customize the label value.
delimiter
Delimiter to separate the value from the label when both the value and the label are displayed on the list.
direction
Opening direction of the selection items.
disabled
Opening direction.
displayAllOptionLabel
Displays All instead of the labels of all items.
displaymessage
Displays the result message upon a validation failure by validate(); API. [default: false, true]
displayMode
Displaying method. [default:label, value delim label, label delim value, value]
escape
Converts <>&" characters into HTML Escape characters.
id
Component ID
invalidMessage
Message to display upon a failure by the validate API. Valid only in case of displaymessage="true".
invalidMessageFunc
Name of the user-defined function that will generate a message upon a validation failure by the validation API.
labelWidthAuto
Ignores the defined width of the component, and automatically adjusts the width to the longest text. [default: false, true]
mandatory
Allows reading only. [default:false, true]
navBtn
Displays [Cancel] and [Confirm] buttons below the selection item list.
nextTabID
The ID of the component to be selected upon the end user’s pressing the Tab key.
rangeSeparator
Specifies the ranged items. (Example: "x-y")
ref
Value path of the DataCollection. Used with a purpose to bind a DataCollection with a WebSquare component.
search
Search method. [default: start, contain, none]
searchTarget
Data to search based on the user's input.
separator
Separator to divide multiple selections
sortMethod
Sets how to sort the selection item list.
sortOption
Standard by which sorting will be made. [label, value]
submenuSize
Sets how to define the size the selection item list.
tabIndex
The focusing order by the Tab key.
title
Same as the class property in HTML.
useDrag
Selects multiple items through mouse dragging.
useEdit
Allows end users to directly enter the items to select. (Options) "true": Allows end users to directly enter selection items in the input field.
useItemLocale
Supports multi-language in the selection item list.
useKeywordHighlight
Highlights the keyword in the search result by applying a separate class.
useLocale
Multilanguage support
userData1
User-defined property
userData2
User-defined property
userData3
User-defined property
validateOnInput
[default:false] Validates the user’s input (useEdit=“true”). Supported in IE9 or higher versions supporting oninput event. (Options) "false" (Default) : Does not apply.
validator
Name of the validation function
visibleColMax
Number of maximum columns to use to display selection items. To be used when the number of columns are decided based on the number of the selection items.
visibleColNum
Number of the columns to display selection items
visibleColumn
Hides certain items from the selection item list.
visibleColumnFalseValue
Value that specifies hiding of the items from the selection item list when the visibleColumn property is used.
visibleRowNum
Number of the rows to be displayed
wmode
Displays the selection item list above the object tag using the wmode. [default:false, true]

Event Summary

onblur
Triggered when the focus is lost.
onchange
Triggered upon a value change by the end user’s selecting/changing or through the use of the API.
oncheckboxclick
Triggered upon selection (checking/unchecking) of an item on the list.
onclick
Triggered upon the end user's clicking the component.
onclose
Triggered upon clicking other areas after selection.
ondblclick
Triggered upon the end user's double-clicking the CheckComboBox component.
onfocus
Triggered upon the component being focused.
onviewchange
Triggered when the value on the list is changed through keyboard input or mouse clicking.

Method Summary

addClass( className )
Adds a CSS class to the component.
addItem( value , label , index )
Adds an item. If the index is not specified, the item will be added as a sub-item.
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.)
checkAll( checked )
Checks or unchecks all items.
deleteItem( index )
Deletes the item of the corresponding index.
focus( )
Focuses the WebSquare component.
getDisabled( )
Returns the current value of the disabled property.
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.
getInfo( index )
Returns JSON data containing of all item information as an array.
getInfoArray( )
Returns JSON data containing of all item information as an array.
getInitStyle( CSS )
Returns the initial style of the WebSquare component.
getItemCount( )
Returns the number of the items on the list.
getItemDisabled( index )
Returns the disabled status of the item of the corresponding index.
getNextTabID( )
Returns the nextTabID value.
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.)
getSelectedInfo( )
Returns the JSON data containing information of the selected item as an array.
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]
getText( separator )
Gets the label of the currently selected item. Multiple items are separated by the specified separator when being returned.
getTextArray( )
Returns the labels of the selected items in an array.
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.)
getUserData( key )
Returns the value set by setUserData or directly defined by the user in the XML file.
getValue( separator )
Returns the value of the selected item. Multiple items are separated by the specified separator when being returned.
getValueArray( )
Returns the values of the selected items in an array.
hasClass( className )
Checks whether the WebSquare component has a certain class.
hide( )
Hides the component.
initCheckCombobox( )
Initializes the CheckComboBox.
openTable( )
Opens the selection item list.
removeClass( className )
Removes a class from the WebSquare component. (Supported in all WebSquare components.)
setDisabled( disabled )
Sets the disabled property of the WebSquare component.
setEventPause( evList , flag )
Pauses the event.
setInitStyle( property )
Restores the initial style of the WebSquare component.
setItemDisabled( index , flag )
Sets the disabled status of the item of the corresponding index.
setItemSet( nodeset , label , value )
Sets the selection item list.
setNextTabID( componentID , componentScope )
Sets the nextTabID property.
setNodeSet( nodeset , label , value )
Sets the selection item list.
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.
setRef( path )
Sets the ref property. Add “data:” prefix to bind with a DataCollection.
setSelectedInfo( infoArray )
Selects or unselects items based on the selection information (in JSON format).
setSize( width , height )
Sets the size (width, height) of the WebSquare component.
setStyle( propertyName , value )
Sets the CSS of the WebSquare component.
setText( label )
Selects the item of the specified label. Use the specified separator to enter multiple labels.
setUserData( key , value )
Sets random data in the WebSquare component. (Supported in all WebSquare components.)
setValue( value )
Selects the selection item of the given value.
setVisibleColumn( columnId , visibleColumnFalseValue )
Dynamically sets the visibleColumn property.
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.
unbindRef( )
Releases the ref binding.
validateObject( )
Validates the component according to the specified properties.
visible( flag )
[deprecated]

Property Detail

allOption
Whether to allow all options or not. The label is "-All-" and the value is "all". [default: false, true] (Options) "false" (Default) : Displays “-All-” on the selection list. "true": Not to display the first selection item.
animation
Animation effects to apply to the selection item list. [default: "", show, fadeIn, slideDown] (Options) "" (Default) : Displays the entire contents at once. "show" : Spreads from a point. "fadeIn" : Fades in the entire contents. "slideDown" : Slides down.
appearance
Selection item display method (Options) "minimal" : Displays selection items one by one. The end user can change the selection item using arrow keys. "full" (Default) : Displays “ - All - ”.
checkboxClickSync
Synchronizes with the selection. [default: false, true] (Options) "true": Synchronizes. "false" (Default) : Not to synchronize.
checkDisabledOnAllCheck
Select disabled items also when selecting all items. [default: true, false] (Options) "true" (Default) : Selects disabled items. "false" : Not to select disabled items upon selecting “-All-”.
chooseOption
Shows the selection guide message. [default: false, true]
Display the text defined as the chooseOptionLabel property.
However, if chooseOptionLabel is not specified while chooseOption is "true", "-Choose-" (label) will be displayed. At the time, the value will be "" (empty string). (Options) "true": Display the selection guide message defined in the chooseOptionLabel property. "false" (Default) : Not to display the selection guide message. (Related Property) chooseOptionLabel
chooseOptionLabel
Set the label of the selection guide message. Valid when the chooseOption is "true". (Related Property) chooseOption="true"
chooseOptionLabelLocaleRef
Key of the chooseOptionLabel text.
When there is no text for the key, "global_undefined" will be displayed on the screen.
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.
closeonmouseleave
Closes the list upon mouse moving out when the list is open on the subLayer. [default:false, true] (Options) "false" (Default) : Not to close the list. "true": Closes the list.
customLabelFormatter
Specify the user-defined function that can customize the label value of the SelectBox. [default: “”]
delimiter
Separates the value from the label. Used by the displayMode property. (Related Property) displayMode
direction
Opening direction of the items. [defulat: auto, down, up]
disabled
Disable the component. [default:false, true] (Options) "false" (Default) : Not to disable the component. "true": Disables the component.
displayAllOptionLabel
Displays “All” instead of the labels of all items. [default: false, true]
displaymessage
Displays the result message upon a validation failure by validate(); API. [default: false, true]
Default message provided by the Engine is displayed. However, using the invalidMessageFunc property, a separate message can be defined. (Options) "false" (Default) : Not to display the result message. "true": Displays the result message. (Related API) validate(); (Function) invalidMEssageFunc (Property)
displayMode
Displaying method. [default:label, value delim label, label delim value, value]
Both the label and the value are displayed.
The delimiter is defined as a property. (Options) "label" "value delim label" "label delim value" "value" (Related Property) delimiter
escape
Decodes HTML escape characters as tags. (Options) "true" (Default) : Not convert into HTML Escape characters. "false" : Decodes HTML escape characters as tags.
id
Component ID
The component ID is allocated as a global object. The script can access each object through the component ID.
invalidMessage
Message to display upon a failure by the validate API. Valid only in case of displaymessage="true".
Cannot be used with the invalidMessageFunc property at the same time. (Related API) validate(); displaymessage="true" (!!!Warning!!!) Cannot be used with the invalidMessageFunc property at the same time.
invalidMessageFunc
Name of the user-defined function that will generate a message upon a validation failure by the validation API.
The displaymessage property must be true. Cannot be used with invalidMessage at the same time. (Example of User-defined Function) // Upon a validation failure, a message is dynamically generated. // mandatory, allowChar, ignoreChar, minLength, maxLength, minByteLength, maxByteLength function fn_msg(){ var tmpType = checkbox1.getType(); var tmpValue = checkbox1.getValue(); if(tmpType == "mandatory") { return "This field is mandatory."; } } (Related API) validate(); displaymessage="true" (!!!Warning!!!) Cannot be used with the invalidMessage property.
labelWidthAuto
Ignores the defined width of the component, and automatically adjusts the width to the longest text. [default: false, true]
However, in case of “position: absolute;” with the component on the right, the UI may not be displayed as intended.
It is recommended that there should be no component on the right and use “position: relative;” CSS. (Options) "false" (Default) : Uses the defined width. "true": Adjusts to the longest text.
mandatory
Allows reading only. [default:false, true]
The validation function checks the mandatory fields. (Options) "false" (Default) : Not to make it mandatory. "true": Makes it mandatory. (Related Method) validate();
navBtn
Displays [Cancel] and [Confirm] buttons below the selection item list.
([Cancel] - Cancels selection. [Confirm] - Confirms selection.) (Options) "true" : Displays [Cancel] and [Confirm] buttons below the selection item list. "false" (Default) : Not display.
nextTabID
The ID of the component to be selected upon the end user’s pressing the Tab key.
rangeSeparator
Specifies the ranged items. (Example: "x-y")
The range is determined based on the sequence of the items on the selection item list. (Example) When there are items from 1 to 100 and items of "1,3,4,5,6,12,13,14,25,26,27,88,89,90,91" are selected, the rangeSeperator "-" will be displayed as shown below. "1,3-6,12-14,25-27,88-91"
ref
Value path of the DataCollection. Used with a purpose to bind a DataCollection with a WebSquare component.
(Format: data: [DataCollection ID].[Key id or Column id])
When bound with a DataList, the value of the selected row in the GridView will be bound. // (Example) data:dataMap1.dept // Specify the XPath of the XML data to interface with the instance data. // (Sample) res/userInfo/dept/@value
search
Search method. [default: start, contain, none]
Valid only in case of interactionMode="true". (Options) "start" (Default) Searches only those starting with the inputted value. "contain" Searches those containing the inputted value. "none" Searches only those exactly same as the inputted value. (Related Property) interactionMode="false"
searchTarget
Data to search based on the user's input. [default:label, value, both] (Options) "label" (Default) : Searches the labels. "value" : Searches the values. "both" : Searches both labels and values.
separator
Separator to divide multiple selections. [default:" "(space)]
sortMethod
Sorting method. Valid only when the sortOption is defined. [default: ascending, descending] (Options) "ascending" (Default) : Sorts in ascending powers. "descending" : Sorts in ascending powers. (Related Property) sortOption
sortOption
Standard by which sorting will be made. [label, value]
Sorted in ascending powers in default. However, in case the sortMethod is defined, the specified sorting method will be used. (Options) "label" : Sorts the selection item list based on the label. "value" Sorts the selection item list based on the value. (Related Property) sortMethod="ascending" sortMethod="descending"
submenuSize
Way of deciding the selection item list. [default: fixed, auto, column] (Options) "fixed" (Default) : Uses the fixed width. "auto" : Adjusts according to the label. "column" : The width is decided based on the number of the columns. (When there are two 70px-wide columns, the width will be 140px, or when there are eight, the width will be 560px.) (Related Property) labelWidthAuto="true" visibleColNum, visibleColMax : Determins the number of the columns. The default values of both properties are 1.
tabIndex
The focusing order by the Tab key.
Same as the tabindex property in HTML.
title
Same as the title property in HTML. The title is displayed upon the end user’s moving the mouse over the component. Generally used to support web accessibility.
useDrag
Selects multiple items through mouse dragging.
Hold the Shift and drag the mouse to unselect items. (Options) "true" : Dragging the mouse will select the items. Holding the Shift and dragging the mouse will unselect the items. "false" (Default): Not allows item selection through mouse dragging.
useEdit
Allows end users to directly enter the items to select. (Options) "true": Allows end users to directly enter selection items in the input field. "false" (Default) : Not allows end users to directly enter selection items. (The end user must click the checkbox, and setValue() API must be used to set the selections.)
useItemLocale
Supports multi-language in the selection item list.
useKeywordHighlight
Highlights the keyword in the search result by applying a separate class. [default:false, true] (Options) "false" (Default) : Does not apply. "true": Applies "w2autoComplete_keyword" class to the search keyword.
useLocale
Multilanguage support
Uses multi-language keys of the client to display label values in multiple languages.
(For more information, see the user guide.) (Options) "false" (Default) : Not to support multi-language. "true": Supports multi-language through the use of the multi-language keys in the client. (Related Properties) Multi-language key is needed for the chooseOptionLabel. (chooseOptionLabelLocaleRef)
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");
validateOnInput
[default:false] Validates the user’s input (useEdit=“true”). Supported in IE9 or higher versions supporting oninput event. (Options) "false" (Default) : Does not apply. "true" : Validates user’s input, and blocks invalid user’s input. (Related Property) useEdit
validator
Name of the validation function
Runs the specified function upon blurring of the component.
The specified function is executed before the onblur event, and validates upon occurrence of blurring. The developer can change the value through the return. (Related Event) onblur
visibleColMax
Number of maximum columns to use to display selection items. To be used when the number of columns are decided based on the number of the selection items.
visibleColNum = Math.min(visibleColMax, Math.ceil(itemCount / visibleRowNum))
In case the visibleColNum is defined, the visibleColMax will be denied. (Options) "visibleRowNum=5,visibleColMax=8" In case there are less than 40 items, one row will be added for every five items. If there are four items, one row will be created. For 12 items, three rows (5*3) will be displayed. Or, for 24 items, five rows (5*5), and for 30 items, six rows (5*6) will be displayed. When there are more than 40 items, a vertical scroll will be created. The list will be displayed as a 5*8 rectangle. (Related Property) visibleColNum : In case the visibleColNum is defined, the visibleColMax setting will be ignored.
visibleColNum
Number of the columns to display selection items The default is 1. (Options) 3 : A rectangular list of three rows and Math.ceil(Data count/3) columns will be displayed.
visibleColumn
Hides certain items from the selection item list.
Shows the display status when the selection item list is bound with the DataList.
In case the column value is same as the visibleColumnFalseValue value, the corresponding row will not be displayed on the selection item list.
selectedIndex is not affected. In other words, the entire index, not the displayed index, is used.
The property can be set by the setVisibleColumn API. (Example) The CheckBox is bound with the dataList1. visibleColumn="col3" visibleColumnFalseValue="false" settings are used. Do the following: dataList1.getCellData(row, "col3"); In case “false” is returned, the corresponding row will not be displayed on the selection item list. (Related API) visibleColumnFalseValue (Property) setVisibleColumn (Method)
visibleColumnFalseValue
Value that specifies hiding of the items from the selection item list when the visibleColumn property is used. (Options) Default: "0", "false", "FALSE", or "F" (Example) Do the following: dataList.getCellData(row, visibleColumn); In case one of "0”, “false”, “FALSE”, “F" is returned, the corresponding row will not be displayed on the list. (Related Property) visibleColumn
visibleRowNum
Number of the rows to be displayed "1" is not recommended.
wmode
Displays the selection item list above the object tag using the wmode. [default:false, true]
To be used when the selection item list is hidden by objects (such as ActiveX, Flash, etc.)
Use wmode in the object (such as ActiveX, Flash, etc.) not in the component. (Options) "true" : Use the wmode. "false" (Default) : Not use the wmode.

Event Detail

onblur
Triggered when the focus is lost.
Parameter
nametypedescription
eObjectEvent object
onchange
Triggered upon a value change by the end user’s selecting/changing or through the use of the API.
When controlling the end user’s selection only, use the onviewchange event.
Parameter
nametypedescription
infoJSONReturns JSON data containing oldValue and newValue. <String> info.oldValue : Old value <String> info.newValue : New value
Sample
// The event is within the component tag. <script ev:event="onchange( info )"><![CDATA[ var oldValue = info.oldValue; var newValue = info.newValue; ]]></script>
oncheckboxclick
Triggered upon selection (checking/unchecking) of an item on the list.
Parameter
nametypedescription
indexNumberIndex of the selected item
isCheckedBooleanSelection status. “true” when the checkbox is selected. "false" when the checkbox is not selected.
valueStringValue of the selected item
onclick
Triggered upon the end user's clicking the component.
Parameter
nametypedescription
eObjectEvent object
onclose
Triggered upon clicking other areas after selection.
Parameter
nametypedescription
flagBooleanCloses. "true" : Upon the user's clicking other areas than the list "false" : Upon user's clicking an arrow button or pressing the Enter
ondblclick
Triggered upon the end user's double-clicking the CheckComboBox component.
Parameter
nametypedescription
eObjectEvent object
onfocus
Triggered upon the component being focused.
Parameter
nametypedescription
eObjectEvent object
onviewchange
Triggered when the value on the list is changed through keyboard input or mouse clicking.
In case the change was made by a script, the event will not be triggered. (Similar to the native onchange event.)
Parameter
nametypedescription
infoJSONReturns an object containing oldValue, newValue, oldSelectedIndex, and newSelectedIndex. <String> info.oldValue : Old value <String> info.newValue : New value <Array> info.oldInfo : Old status in a JSON array <Array> info.newInfo : New status in a JSON array
Sample
<script ev:event="onviewchange( info )"><![CDATA[ var oldValue = info.oldValue; // 이전 value var newValue = info.newValue; // 현재 value var oldInfoArr = info.oldInfo; // 이전 상태의 항목 정보 Array var newInfoArr = info.newInfo; // 현재 상태의 항목 정보 Array //현재 상태의 항목 중 첫번째 항목에 대한 세부 정보에 접근 할 경우 var tmpInfo = newInfoArr[0]; var tmpInfoValue = tmpInfo.value; // (반환 예) "1" var tmpInfoLabel = tmpInfo.label; // (반환 예) "사과" var tmpInfoChecked = tmpInfo.checked; // (반환 예) true var tmpInfoIndex = tmpInfo.index; // (반환 예) 0 ]]></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");
addItem( value , label , index )
Adds an item. If the index is not specified, the item will be added as a sub-item.
Note that when allOption is enabled, the item will be included in the index but the item defined by the chooseOption will not be included in the index.
Parameter
nametyperequireddescription
valueStringYValue of the item
labelStringYLabel of the item
indexNumberNIndex of the item
Return
typedescription
NumberIndex of the added item
Sample
// Do not add an item. Set chooseOption and allOption as "true". <xf:checkcombobox id="checkcombobox1" chooseOption="true" allOption="true" style="position: relative;width: 148px;height: 21px;" appearance="minimal" direction="auto"></xf:checkcombobox> // Add an item without specifying an index. checkcombobox1.addItem( "1" , "Apple"); // Result - "All" Added to the end of the list. The order of the items will be "All", // "Select"(chooseOption) will not be on the selection list. Unselected items will be included in the label. // Add an item with specifying the index as "0". checkcombobox1.addItem( "2" , "Orange",0); // Result - An item of Index 0 will be added before "All". The order of the items will be "Orange", "All", "Apple". // "Select"(chooseOption) will not be on the selection list. Unselected items will be included in the label.
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");
checkAll( checked )
Checks or unchecks all items.
Parameter
nametyperequireddescription
checkedBooleanY{0}// Select/Unselect
Sample
// Check all. checkcombobox1.checkAll(true); // Uncheck all. checkcombobox1.checkAll(false);
deleteItem( index )
Deletes the item of the corresponding index. When the allOption is true, the index will be numbered.
Parameter
nametyperequireddescription
indexNumberNIndex of the item to delete
Return
typedescription
JSONJSON containing information of the deleted item
<String> label : Label of the item <String> value : Value of the item
Sample
// Add an item as shown below, and set chooseOption and allOption as "true". <xf:checkcombobox id="checkcombobox1" chooseOption="true" allOption="true" style="position: relative;width: 148px;height: 21px;" appearance="minimal" direction="auto"> </xf:choices> <xf:item> <xf:label><![CDATA[사과]]></xf:label> <xf:value><![CDATA[1]]></xf:value> </xf:item> <xf:item> <xf:label><![CDATA[오렌지]]></xf:label> <xf:value><![CDATA[2]]></xf:value> </xf:item> </xf:choices> </xf:checkcombobox> var returnValue = checkcombobox1.deleteItem(0); // Since allOption is "true", the corresponding item will be deleted. // (Return) {label: "All", value: "all"}
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
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"
getInfo( index )
Returns JSON data containing of all item information as an array.
Parameter
nametyperequireddescription
indexIntegerYIndex
Return
typedescription
JSONJSON containing item information
<Number> index : Index of the item <String> label : Label of the item <String> value : Value of the item <Boolean> checked : Selection status
Sample
// Add an item as shown below, and set chooseOption and allOption as "true". <xf:checkcombobox id="checkcombobox1" chooseOption="true" allOption="true" style="position: relative;width: 148px;height: 21px;" appearance="minimal" direction="auto"> <xf:choices> <xf:item> <xf:label><![CDATA[사과]]></xf:label> <xf:value><![CDATA[1]]></xf:value> </xf:item> <xf:item> <xf:label><![CDATA[오렌지]]></xf:label> <xf:value><![CDATA[2]]></xf:value> </xf:item> </xf:choices> </xf:checkcombobox> var returnValue = checkcombobox1.getInfo(1); // Since allOption is "ture", the first will be Apple. // (Return Example) {index: 1, label: "Apple", value: "1", checked: false}
getInfoArray( )
Returns JSON data containing of all item information as an array.
Return
typedescription
ArrayJSON array containing all item information
<JSON> info : JSON containing item information
Sample
// Add an item as shown below, and set chooseOption and allOption as "true". <xf:checkcombobox id="checkcombobox1" chooseOption="true" allOption="true" style="position: relative;width: 148px;height: 21px;" appearance="minimal" direction="auto"> <xf:choices> <xf:item> <xf:label><![CDATA[사과]]></xf:label> <xf:value><![CDATA[1]]></xf:value> </xf:item> <xf:item> <xf:label><![CDATA[오렌지]]></xf:label> <xf:value><![CDATA[2]]></xf:value> </xf:item> </xf:choices> </xf:checkcombobox> var listArray = checkcombobox1.getInfoArray(); // Get information of Apple var tmpListObj = listArray[1]; // (Return Example) {index: 1, label: "Apple", value: "1", checked: false} // Get the value of Apple. var tmpListValue = tmpListObj.value; (Return Example) "1"
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.)
getItemCount( )
Returns the number of the items on the list.
Return
typedescription
NumberNumber of the selection items.
Sample
// When there are total two items var returnValue = checkcombobox1.getItemCount(); // (Return) 2
getItemDisabled( index )
Returns the disabled status of the item of the corresponding index.
Parameter
nametyperequireddescription
indexNumberYIndex of the item
Return
typedescription
BooleanDisabled status of the item
Sample
// Get the disabled status of the first item which is enabled. var returnValue = checkcombobox1.getItemDisabled(0); // (Return) false
getNextTabID( )
Returns the nextTabID value. (Related Property) nextTabID
Sample
// Example var nextTabID = checkcombobox1.getNextTabID();
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
getSelectedInfo( )
Returns the JSON data containing information of the selected item as an array.
Return
typedescription
ArrayJSON array containing information of the selected items.
Sample
// Add an item, and select Apple item. <xf:checkcombobox id="checkcombobox1" style="position: relative;width: 148px;height: 21px;" appearance="minimal" direction="auto"> <xf:choices> <xf:item> <xf:label><![CDATA[사과]]></xf:label> <xf:value><![CDATA[1]]></xf:value> </xf:item> <xf:item> <xf:label><![CDATA[오렌지]]></xf:label> <xf:value><![CDATA[2]]></xf:value> </xf:item> </xf:choices> </xf:checkcombobox> var selectedArr = checkcombobox1.getSelectedInfo(); // (Return Example) [{index: 0, label: "Apple", value: "1", checked: true}] // Get the first item (Apple). var selectedObj = selectedArr[0]; // (Return Example) {index: 0, label: "Apple", value: "1", checked: true} // Get the value of the first item. var selectedValue = selectedObj.value; // (Return Example) "1"
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.)
getText( separator )
Gets the label of the currently selected item. Multiple items are separated by the specified separator when being returned.
If not specified, space will be used as the delimiter.
Parameter
nametyperequireddescription
separatorStringNSeparator
Return
typedescription
StringString containing labels of the selected items
Sample
// Select "Apple" and "Orange". var returnValue = checkcombobox1.getText(); // (Return) "Apple Orange" // Use the separator. var returnValue = checkcombobox1.getText(","); // (Return) "Apple,Orange"
getTextArray( )
Returns the labels of the selected items in an array.
Return
typedescription
ArrayArray containing labels of the selected items
Sample
// Select "Apple" and "Orange". var returnValue = checkcombobox1.getTextArray(); // (Return Example) ["Apple", "Orange"]
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/
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"
getValue( separator )
Returns the value of the selected item. Multiple items are separated by the specified separator when being returned.
If not specified, space will be used as the delimiter.
Parameter
nametyperequireddescription
separatorStringNSeparator
Return
typedescription
StringString containing the value of the selected item.
Sample
// When values "1" and "2" are selected. // Use the corresponding API. var returnValue = checkcombobox1.getValue(); // (Return) "1 2" // Use "," separator. var returnValue = checkcombobox1.getValue(","); // (Return) "1,2"
getValueArray( )
Returns the values of the selected items in an array.
Return
typedescription
ArrayArray of the values of the selected items
Sample
// When values "1" and "2" are selected. var returnValue = checkcombobox1.getValueArray(); // (Return Example) ["1", "2"]
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 component.
initCheckCombobox( )
Initializes the CheckComboBox. (Deletes the items and initializes the values.)
Sample
// (Example) checkcombobox.initCheckCombobox();
openTable( )
Opens the selection item list.
Updates the selection item list (updateTabe), and shows the selection item list (showTable).
Must be called by xforms-submit-done event when the interactionMode is "true", and must be called after the submission or submissionFunc. (Related Property) interactionMode="true"
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");
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);
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();
setItemDisabled( index , flag )
Sets the disabled status of the item of the corresponding index.
Parameter
nametyperequireddescription
indexNumberYIndex of the item
flagBooleanYDisabled status
true: Disabled. false: Not disabled.
Sample
// Disable the first item. checkcombobox1.setItemDisabled(0, true); // The first item cannot be selected or unselected.
setItemSet( nodeset , label , value )
Sets the selection item list.
Keeps the current selection (input), and newly sets the selection item list only.
Parameter
nametyperequireddescription
nodesetStringNnodeset of the item
labelStringNNew path to set as the label of the selection item list
valueStringNNew path to set as the value of the selection item list
Sample
// (Example) // (1) Bind with "dc_tmpSearchList" DataList. // (2) Set the disp column as the label and the code column as the value. checkcombobox1.setItemSet("data:dc_tmpSearchList","disp","code");
setNextTabID( componentID , componentScope )
Sets the nextTabID property.
When the ID of the frame in which the nextTabID, the second argument, is given, the scope can be set. (Related Property) nextTabID
Parameter
nametyperequireddescription
componentIDStringYComponent ID to set as the nextTabID
componentScopeStringNComponent scope to set as the nextTabID
Sample
// Example checkcombobox1.setNextTabID("input2", "wframe1");
setNodeSet( nodeset , label , value )
Sets the selection item list.
When bound with the DataList, the nodeset parameter must start with "data:".
Parameter
nametyperequireddescription
nodesetStringYDataList ID. Must start with "data:". (Or XPath of the InstanceData)
labelStringNColumn ID to set as the label. If no value is allocated, the existing value will be applied. (Or XPath under the nodeset to set as the label.)
valueStringNColumn ID to set as the value. If no value is allocated, the existing value will be applied. (Or XPath under the nodeset to set as the value.)
Sample
// Define a DataList. <w2:dataList id="dataList1"> <w2:columnInfo> <w2:column id="lbl" dataType="text"></w2:column> <w2:column id="code" dataType="text"></w2:column> </w2:columnInfo> <w2:data use="true"> <w2:row> <lbl><![CDATA[zero]]></lbl> <code><![CDATA[0]]></code> </w2:row> <w2:row> <lbl><![CDATA[one]]></lbl> <code><![CDATA[1]]></code> </w2:row> </w2:data> </w2:dataList> // (EXample 1) Bind with DataList1, and use lbl column for the label and code column for the value. checkcombobox1.setNodeSet('data:dataList1','lbl','code'); // (Example 2) Bind with DataList2, and use existing column settings for the label and the value. checkcombobox1.setNodeSet('data:dataList2'); // (Result) The existing label and value codes remain the same, and only the DataList is changed.
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);
setRef( path )
Sets the ref property. Add “data:” prefix to bind with a DataCollection.
If not specified, XPath of the InstanceData will be used.
Parameter
nametyperequireddescription
pathStringYPath of ref
Sample
//Bind hobby key of dataMap1 with the value of checkcombobox1. checkcombobox1.setRef("data:dataMap1.hobby"); // Bind with "res/userData/hobby" of the InstanceData. checkcombobox1.setRef("res/userData/hobby");
setSelectedInfo( infoArray )
Selects or unselects items based on the selection information (in JSON format).
Parameter
nametyperequireddescription
infoArrayArrayYJSON array containing information of the items to select/unselect
Sample
// Add an item and set allOption as "true". <xf:checkcombobox id="checkcombobox1" allOption="true" style="position: relative;width: 148px;height: 21px;" appearance="minimal" direction="auto"> <xf:choices> <xf:item> <xf:label><![CDATA[사과]]></xf:label> <xf:value><![CDATA[1]]></xf:value> </xf:item> <xf:item> <xf:label><![CDATA[오렌지]]></xf:label> <xf:value><![CDATA[2]]></xf:value> </xf:item> </xf:choices> </xf:checkcombobox> // When selecting "Orange" - because allOption is "true" the item will be of Index 0. checkcombobox1.setSelectedInfo([{index:2,checked:true}]); // When selecting "Apple" and "Orange" - because allOption is "true" the item will be of Index 0. checkcombobox1.setSelectedInfo([{index:1,checked:true},{index:2,checked:true}]);
setSize( width , height )
Sets the size (width, height) of the WebSquare component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
widthNumberYWidth of the component or null.
heightNumberYHeight of the component or null.
Sample
// (Example) Set the height of the component as 100px. componentId.setSize(null,100);
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");
setText( label )
Selects the item of the specified label. Use the specified separator to enter multiple labels.
In case no separator is defined, blank space will be used.
Parameter
nametyperequireddescription
labelStringYLabels of the items to select
Sample
// Add an item and define "," as the separator. <xf:checkcombobox id="checkcombobox1" separator="," style="position: relative;width: 148px;height: 21px;" appearance="minimal" direction="auto"> <xf:choices> <xf:item> <xf:label><![CDATA[사과]]></xf:label> <xf:value><![CDATA[1]]></xf:value> </xf:item> <xf:item> <xf:label><![CDATA[오렌지]]></xf:label> <xf:value><![CDATA[2]]></xf:value> </xf:item> </xf:choices> </xf:checkcombobox> // Select "Apple" and "Orange". checkcombobox1.setText("Apple,Orange");
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.
setValue( value )
Selects the selection item of the given value.
When setting multiple items, use space. In case there is no item of the corresponding value, no operation will be made.
Parameter
nametyperequireddescription
valueStringYValue of the item
Sample
// Add an item and define "," as the separator. <xf:checkcombobox id="checkcombobox1" separator="," style="position: relative;width: 148px;height: 21px;" appearance="minimal" direction="auto"> <xf:choices> <xf:item> <xf:label><![CDATA[Apple]]></xf:label> <xf:value><![CDATA[1]]></xf:value> </xf:item> <xf:item> <xf:label><![CDATA[Orange]]></xf:label> <xf:value><![CDATA[2]]></xf:value> </xf:item> </xf:choices> </xf:checkcombobox> // Select "Apple" and "Orange". checkcombobox1.setValue("1,2");
setVisibleColumn( columnId , visibleColumnFalseValue )
Dynamically sets the visibleColumn property.
The visibleColumn column indicates whether to be displayed on the selection item list.
visibleColumn is to hide certain items from the selection item list of the CheckComboBox.
selectedIndex is not affected. Instead the entire selection item list is used. (Related Property) visibleColumn visibleColumnFalseValue
Parameter
nametyperequireddescription
columnIdStringYColumn ID to set as the visibleColumn. (The column contains the item list to hide from the selection item list.)
visibleColumnFalseValueStringNValue required to hide from the selection item list.
Sample
// CheckComboBox is bound with the DataList. checkCombobox1.setVisibleColumn(col3, false); // (Result) Rows of which col3 has “false” value will not be displayed as selection items on the CheckComboBox.
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);
unbindRef( )
Releases the ref binding.
validateObject( )
Validates the component according to the specified properties. (Related Property) displaymessage="true" (Validation-related Properties) mandatory minlength maxLength minByteLength maxByteLength
Return
typedescription
Objectobject validation result object
<String> object.callerId Validation target component ID <String> object.type Validation items <Boolean> object.value Validation result
Sample
// Set mandatory in checkcombobox1 as shown below. <xf:checkcombobox appearance="minimal" id="checkcombobox1" style="position: absolute;width:249px;height:57px;left:74px;top:459px;" mandatory="true"> <xf:choices> <xf:itemset nodeset="data:dataList2"> <xf:label ref="label"></xf:label> <xf:value ref="value"></xf:value> </xf:itemset> </xf:choices> </xf:checkcombobox> var returnObj = checkcombobox1.validateObject(); // (Return - When there is no CheckComboBox value) returnObj will be returned. returnObj.callerId = "checkcombobox1" returnObj.type = "mandatory" returnObj.value = "" // (Return - When there is a CheckComboBox value) An empty object will be returned. // In case of displaymessage="true", a default message will be alerted. // (Alert Example) This field is mandatory.
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;