PropertyEventMethodIndex
WebSquare.uiplugin.checkcombobox - 5.0_2.2916B.20171222.151448

Provides extended functions of select tag in HTML. Provides an interface that is like a combination of a select box and a check box in order to allow the end user to make multiple selections.
At the highest-level is the div tag containing sub tags.

Type

uiplugin

Property Summary

allOption
[default:false, true] Whether to allow all options or not. The label is "-All-" and the value is "all".
animation
Sets the animation for the itemtable.
appearance
The appearance property of xforms select1
checkboxClickSync
[default:false, true] Synchronizes the checkbox clicking with the selected itemset.
checkDisabledOnAllCheck
[default:true, false]
chooseOption
[default:false,true] Displays the selection options. In case the chooseOptionLabel is not defined, the label will be "-Choose-" and the value ""(empty string).
chooseOptionLabel
Define the text (label) to guide selection when the chooseOption is true.
class
Provides a similar feature to the class in HTML. One or more classes defined in the CSS file or the style block can be used.
closeonmouseleave
[default:false, true] Closes the sub-layer upon the mouseleave event.
delimiter
Separates the value from the label. Used by the displayMode property.
direction
[defulat:auto, down, up] Opening direction of the items
disabled
[default:false, true] Disables the component.
displayAllOptionLabel
[default:false, true] Displays All instead of the labels of all items.
displaymessage
[default:false, true] Displays the result message upon a validation failure by the validation API.
displayMode
[default:label, value delim label, label delim value] Mode of display. Both the label and the value can be displayed. The separator (delim) is defined in the delimiter property.
escape
Converts <>&" characters into HTML Escape characters.
id
ID of the component. Allocated as a global object. Scripts access the component through the ID.
invalidMessage
A message displayed upon failure of the validation API. The displaymessage property must be true.
invalidMessageFunc
Name of the function that dynamically displays messages upon a validation failure by the validation API.
labelWidthAuto
[default:false, true]
mandatory
[default:false, true] Whether to check the mandatory input or not when calling the validation API.
navBtn
Sets the button for the itemtable.
nextTabID
Component ID to move by tab
ref
The value of the DataCollection. Required to bind the component with a DataCollection. Starts with a prefix of "data:".
separator
[default:" "(space)] Delimiter to list multiple labels of the selected items.
sortMethod
[default:ascending, descending] Referenced by the sortOption property. The method to sort the values defined in the sortOption.
sortOption
[label,value] Used to sort the items by label or value.
submenuSize
[default:auto, fixed] Whether to fit the list size to the label or fix it to the default width. Not valid when the labelWidthAuto property is true.
tabIndex
Same as the tabindex property in HTML standard. Indicates the focusing order of the component by the tab key.
title
Same as the title property of HTML. Displays the Text upon the end user's hovering the mouse over the browser.
useLocale
[default:false, true] True to use the multi-language key to display the labels on the WebSquare5 client.
userData1
User-defined property
userData2
User-defined property
userData3
User-defined property
validator
Name of the validation function
visibleRowNum
Number of the rows to be displayed
wmode
[default:false, true] Use wmode. To be used when the component is hidden by an object (such as activeX or flash).

Event Summary

onblur
Triggered when the focus is lost.
onchange
Triggered upon the end user's selecting/changing an item or setting a value. Use the onviewchange event to control only the end user's selecting an item.
oncheckboxclick
Triggered upon selection (checking/unchcking) of an item on the list.
onclick
Triggered upon the end user's clicking the CheckComboBox 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 class to the component.
addItem( value , label , idx )
Adds an item. If no index is specified, the item will be appended to the lower node.
bind( eventType , function )
Dynamically allocates events to the component.
changeClass( oldClassName , newClassName )
Renames the class from oldClassName to newClassName.
checkAll( checked )
Checks or unchecks all items.
deleteItem( idx )
Deletes the item of the corresponding index. When the allOption is true, the index will be numbered from an option that is to select all items.
focus( )
Moves the focus to the component.
getDisabled( )
Gets the current value of the disabled property.
getGenerator( )
Called by a component under the Generator component. When called, gets the parent Generator object.
getID( )
Gets the ID of the 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( property )
Gets the initial style of the component.
getItemCount( )
Returns the number of the items.
getItemDisabled( index )
Returns the disabled status of the item of the corresponding index.
getNextTabID( )
Returns the nextTabID value.
getOpacity( )
Gets the opacity of the component defined in CSS.
getPluginName( )
Gets the pluginName (or the name) of the component.
getPosition( positionName )
Gets the left or top position of the component.
getReadOnly( )
Gets the current setting of the readOnly property.
getScope( )
Returns the parent WFrame object when the component is a child of the WFrame which uses the scope feature (scope=true).
getScopeWindow( )
Returns the scope object of the parent when the component is a child of the WFrame which uses the scope feature (scope=true).
getSelectedInfo( )
Returns the JSON data containing information of the selected item as an array.
getSize( sizeName )
Gets the size of the component.
getStyle( propertyName )
Gets the current value of the propertyName of the component defined in CSS.
getStyleValue( style )
[deprecated] Use getStyle instead.
getText( separator )
Gets the label of the currently selected item. For multiple items, uses the defined separator.
getTextArray( )
Returns the labels of the selected items in an array.
getTitle( )
Gets the title value.
getUdcHome( )
Returns the path of the file which defines the UDC.
getUdcRoot( )
Returns the path of the file which defines the UDC.
getUserData( key )
Returns the user-defined property value set by setUserData as the user data or source (page XML).
getValue( separator )
Gets the value of the currently selected item. Uses the defined separator for multiple values.
getValueArray( )
Returns the values of the selected items in an array.
hasClass( className )
Checks whether the component has className received as a parameter or not.
hide( )
Hides the component.
removeAll( isInitialize )
[default:false, true] Removes all items. In case allOption is specified and isInitialize is true, the item will not be removed.
removeClass( className )
Removes className from the component.
setDisabled( disabled )
Sets the disabled property.
setEventPause( evList , flag )
Disables or enables the component event.
setInitStyle( property )
Initializes the component style.
setItemDisabled( idx , value )
Disables or enables the item of the corresponding index.
setNextTabID( componentID , componentScope )
Sets the nextTabID.
setNodeSet( nodeset , label , value )
Changes the itemset setting. When bound with a DataList, the nodeset must start with data: prefix.
setOpacity( value )
Sets the opacity of the component.
setPosition( left , top , mode )
Sets the position (left, top) of the component.
setReadOnly( readOnly )
Controls the "readOnly" property.
setRef( ref )
Dynamically sets the ref binding. Add data: prefix to bind with a DataCollection.
setSelectedInfo( infoArray )
Selects or unselects items based on the selection information (in JSON format).
setSize( width , heigth )
Sets the size (width, height) of the component.
setStyle( propertyName , value )
Sets the style of the specified property.
setText( label )
Selects the item of the specified label. Use the specified separator to enter multiple labels.
setUserData( key , value )
Sets the user data in the component.
setValue( value )
Selects an item which contains the value received as a parameter, and sets the value in the selected item.
show( displayType )
Displays the component.
toggleClass( className )
Removes a class named className, or if there is no such a class, adds a class named className.
trigger( type , array )
Triggers a certain event registered for the component.
unbind( type , function )
Removes an event registered for the component.
unbindRef( )
Releases the ref binding.
validateObject( )
Validates the component according to the specified properties.
visible( flag )
[deprecated] Shows/Hides the component, or sets the visible property using setStyle.

Property Detail

allOption
[default:false, true] Whether to allow all options or not. The label is "-All-" and the value is "all".
animation
Sets the animation for the itemtable.
appearance
The appearance property of xforms select1
checkboxClickSync
[default:false, true] Synchronizes the checkbox clicking with the selected itemset.
checkDisabledOnAllCheck
[default:true, false]
Select disabled items also when selecting all items.
true (Default): Selects disabled items.
false: Does not select disabled items.
chooseOption
[default:false,true] Displays the selection options. In case the chooseOptionLabel is not defined, the label will be "-Choose-" and the value ""(empty string).
chooseOptionLabel
Define the text (label) to guide selection when the chooseOption is true.
class
Provides a similar feature to the class in HTML. One or more classes defined in the CSS file or the style block can be used.
The WebSquare5 Engine has a dedicated class to each component. Using the class of the component, the developer can apply a common CSS.
closeonmouseleave
[default:false, true] Closes the sub-layer upon the mouseleave event.
delimiter
Separates the value from the label. Used by the displayMode property.
Used as the "delim" in the displayMode property.
direction
[defulat:auto, down, up] Opening direction of the items
disabled
[default:false, true] Disables the component.
displayAllOptionLabel
[default:false, true] Displays All instead of the labels of all items.
displaymessage
[default:false, true] Displays the result message upon a validation failure by the validation API.
Displays the result message upon a validation failure by the validation API. Define a customized message using the invalidMessageFunc property.
displayMode
[default:label, value delim label, label delim value] Mode of display. Both the label and the value can be displayed. The separator (delim) is defined in the delimiter property.
escape
Converts <>&" characters into HTML Escape characters.
id
ID of the component. Allocated as a global object. Scripts access the component through the ID.
invalidMessage
A message displayed upon failure of the validation API. The displaymessage property must be true.
Cannot be used with invalidMessageFunc at the same time.
invalidMessageFunc
Name of the function that dynamically displays messages upon a validation failure by the validation API.
The displaymessage property must be true. Cannot be used with invalidMessage at the same time.
The customized function (in the following example) gets the type of the value through this.getType() and the value through this.getValue(), and returns the dynamically created message through the use of the type and the value.
(Type) mandatory, allowChar, ignoreChar, minLength, maxLength, minByteLength, maxByteLength
(Example) function fn_msg(){ var tmpType = this.getType(); var tmpValue = this.getValue(); if(tmpType == "mandatory"){ return "Required."; } }
labelWidthAuto
[default:false, true]
Note when the position is absolute in the style and the component is on the right side, the component position may get unstable. Put the component on the left side, or set the component position as relative.
mandatory
[default:false, true] Whether to check the mandatory input or not when calling the validation API.
navBtn
Sets the button for the itemtable.
nextTabID
Component ID to move by tab
ref
The value of the DataCollection. Required to bind the component with a DataCollection. Starts with a prefix of "data:".
(Format: data: [DataCollection ID].[Key id or Column id]) (Example) data:dataMap1.dept
When bound with a DataList, the row selected on the GridView will be bound.
Specify the XPath of the XML data to interface with the instance data. (Example) res/userInfo/dept/@value
separator
[default:" "(space)] String containing values of the selected items in the component.
sortMethod
[default:ascending, descending] Referenced by the sortOption property. The method to sort the values defined in the sortOption.
sortOption
[label,value] Used to sort the items by label or value.
In the default, the items are sorted in ascending order. In case sortMethod is specified, the items will be sorted in the corresponding method.
submenuSize
[default:auto, fixed] Whether to fit the list size to the label or fix it to the default width. Not valid when the labelWidthAuto property is true.
tabIndex
Same as the tabindex property in HTML standard. Indicates the focusing order of the component by the tab key.
title
Same as the title property of HTML. Displays the Text upon the end user's hovering the mouse over the browser.
useLocale
[default:false, true] True to use the multi-language key to display the labels on the WebSquare5 client.
Uses the multi-language key to display the label on the client side.
userData1
User-defined property. Use getUserData("userData1") to get the data.
userData2
User-defined property. Use getUserData("userData2") to get the data.
userData3
User-defined property. Use getUserData("userData3") to get the data.
validator
Name of the validation function
visibleRowNum
Number of the rows to be displayed
wmode
[default:false, true] se wmode. To be used when the component is hidden by an object (such as activeX or flash).
sing the wmode (true) is to put the component above the object tag, not to set the wmode. It is recommended to use the wmode in the object tag (such as activeX or flash).

Event Detail

onblur
Triggered when the focus is lost.
Parameter
nametypedescription
eObjectEvent object
onchange
Triggered upon the end user's selecting/changing an item or setting a value. Use the onviewchange event to control only the end user's selecting an item.
The event handler (this function) can access the component. (Example) this.getValue();
oncheckboxclick
Triggered upon selection (checking/unchcking) of an item on the list.
Parameter
nametypedescription
indexNumberIndex of the selected item
isCheckedBooleantrue is when the checkbox is checked, or false when the checkbox is unchecked.
valueStringValue of the selected item
onclick
Triggered upon the end user's clicking the CheckComboBox component.
Parameter
nametypedescription
eObjectEvent object
onclose
Triggered upon clicking other areas after selection.
Parameter
nametypedescription
flagBooleantrue : 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, no event will 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; //return 예시 ) "1" var tmpInfoLabel = tmpInfo.label; //return 예시 ) "사과" var tmpInfoChecked = tmpInfo.checked; //return 예시 ) true var tmpInfoIndex = tmpInfo.index; //return 예시 ) 0 ]]></script>

Method Detail

addClass( className )
Adds a class to the component.
Parameter
nametyperequireddescription
classNameStringYName of the class to add
Sample
// Add oddClass to component input1. input1.addClass("oddClass");
addItem( value , label , idx )
Adds an item. If no index is specified, the item will be appended to the lower node.
Note that when allOption is enabled, the item will be included in the index but chooseOption will not.
Parameter
nametyperequireddescription
valueStringYValue of the item
labelStringYLabel of the item
idxNumberNIndex 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 allocates events to the component.
Parameter
nametyperequireddescription
eventTypeStringYName of the event to allocate.
functionFunctionYHandler function of the event to allocate.
Sample
// Define the event handler function for the onclick event in the input component, and bind the function. input1.bind("onclick", function(e){ alert(input1.getValue();})); // Bind commObj.ev_click function for the onclick event with component input1. var commObj = {}; commObj.ev_click = function(e){ alert("click :: "+this.id); }; input1.bind("onclick", commObj.ev_click );
changeClass( oldClassName , newClassName )
Renames the class from oldClassName to newClassName.
In the default setting, only the classes added by addClass will be applied. In order to directly remove the class defined in the "class" property of the component, add the following setting in config.xml file.
<style><removeDefaultClass value="true" /></style>
Parameter
nametyperequireddescription
oldClassNameStringYName of the class to remove
newClassNameStringYName of the class to add
Sample
// Define a class for the Input component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" class="tmpInputClass"></xf:input> // Add the following to config.xml. <style> <removeDefaultClass value="true" /> </style> // Change tmpInputClass class to tmpInputWarninClass. input1.changeClass("tmpInputClass","tmpInputWarninClass");
checkAll( checked )
Checks or unchecks all items.
Parameter
nametyperequireddescription
checkedBooleanYtrue is to check all, or false is to uncheck all.
Sample
// Check all. checkcombobox1.checkAll(true); // Uncheck all. checkcombobox1.checkAll(false);
deleteItem( idx )
Deletes the item of the corresponding index. When the allOption is true, the index will be numbered from an option that is to select all items.
Parameter
nametyperequireddescription
idxNumberNIndex 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 Example) {label: "All", value: "all"}
focus( )
Moves the focus to the component.
getDisabled( )
Gets the current value of the disabled property.
Return
typedescription
BooleanThe value of the disabled property.
Sample
var returnValue = componentId.getDisabled(); (Return example) false
getGenerator( )
Called by a component under the Generator component. When called, gets the parent Generator object.
Return
typedescription
ObjectParent Generator object
Sample
<w2:generator id="generator1"> <w2:trigger id="trigger1" ev:onclick="scwin.trigger1_onclick"></w2:trigger></w2:generator> scwin.trigger1.onclick = function(){ console.log(this.getGenerator());} // Click trigger1 to display the generator1 object on the console. // See https://inswave.com/jira/browse/WPF-1425.
getID( )
Gets the ID of the component.
Return
typedescription
StringID of the WebSquare5 component
Sample
// The WebSquare5 component dynamically received as a parameter can be used as shown in the following. function fn_validCheck(tmpObj){ // tmpObj has an ID of "input1". var compID = tmpObj.getID(); // (Return Example) "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( property )
Gets the initial style of the component.
Parameter
nametyperequireddescription
propertyStringNName of the attribute (If not specified, all information will be ouputted.)
getItemCount( )
Returns the number of the items.
Return
typedescription
NumberNumber of the items
Sample
// When there are total two items var returnValue = checkcombobox1.getItemCount(); // (Return Example) 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 Example) false
getNextTabID( )
Returns the nextTabID value.
Sample
var nextTabID = checkcombobox1.getNextTabID();
getOpacity( )
Gets the opacity of the component defined in CSS.
Return
typedescription
IntegerOpacity
Sample
// Apply opacity CSS to the Input component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;opacity:0.2;"></xf:input> var returnValue = input1.getOpacity(); // "returnValue" is a real number between 0 and 1. // (Return Value) "0.2"
getPluginName( )
Gets the pluginName (or the name) of the component.
Return
typedescription
StringpluginName of the WebSquare5 component
Sample
// For a WebSquare5 object dynamically received by a common function, conditional statements can be used as shown below. var commObj = {}; commObj.fn_makeReqData = function(tmpObj){ var tmpID = tmpObj.getID(); // Component ID var tmpCompType = tmpObj.getPluginName(); // Component Type if(tmpCompType == "input"){ //..Logic.. }else if(tmpCompType == "gridView"){ //..Logic .. }else{ //..Logic.. } };
getPosition( positionName )
Gets the left or top position of the component. If set by %, the corresponding pixel value will be returned.
Parameter
nametyperequireddescription
positionNameStringY[left,top] Type of the position
Return
typedescription
NumberPosition of the component
Sample
// Apply margin CSS to the Input component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;margin:10px;"></xf:input> var returnValue = input1.getPosition("top"); // The returnValue will be a position in pixels. // (Return Example) 10
getReadOnly( )
Gets the current setting of the readOnly property.
Return
typedescription
BooleanThe current setting of the readOnly property
Sample
var returnValue = componentId.getReadOnly(); // (Return Example) false
getScope( )
Returns the parent WFrame object when the component is a child of the WFrame which uses the scope feature (scope=true).
Returns null when the component is not a child of the WFrame using the scope feature (scope=true).
Return
typedescription
Objectwframe object or null
Sample
// The main page contains wframe1, and wframe1 contains wframe11 which contains textbox1. textbox1.getScope(); // Returns wframe11 object.
getScopeWindow( )
Returns the scope object of the parent when the component is a child of the WFrame which uses the scope feature (scope=true).
Returns a global window object when the component is not a child of the WFrame using the scope feature (scope=true.
Return
typedescription
ObjectScope object of the wframe object, or a global window object
Sample
// The main page contains wframe1, and wframe1 contains wframe11 which contains 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 )
Gets the size of the component. If set by "%", the corresponding pixel value will be returned.
Parameter
nametyperequireddescription
sizeNameStringY[height, innerHeight, outerHeight, outerMarginHeight, width, innerWidth, outerWidth, outerMarginWidth] Type of the size. For the calculation of each size type, see 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"); // "returnValue" will be a size in pixels. If set by "%", the corresponding pixel value will be returned. // (Return Example) 100
getStyle( propertyName )
Gets the current value of the propertyName of the component defined in CSS.
Parameter
nametyperequireddescription
propertyNameStringYName of the property in the style
Return
typedescription
StringStyle value
Sample
// Define an Input component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;"></xf:input> var returnValue = input1.getStyle("width"); // (Return Example) "144px"
getStyleValue( style )
[deprecated] Use getStyle instead.
Gets the current value of the propertyName of the component defined in CSS.
Parameter
nametyperequireddescription
styleStringYName of the property defined in the style
Return
typedescription
StringValue defined in the style property. (In case of a color, the hexcode of the color will be returned.)
getText( separator )
Gets the label of the currently selected item. For multiple items, uses the defined separator.
Gets the label of the currently selected item. For multiple items, uses the defined separator.
Parameter
nametyperequireddescription
separatorStringNSeparator
Return
typedescription
StringString containing labels of the selected items
Sample
// Select "Apple" and "Orange". var returnValue = checkcombobox1.getText(); // (Return Example) "Apple Orange" // Use the separator. var returnValue = checkcombobox1.getText(","); // (Return Example) "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( )
Gets the title value.
Return
typedescription
StringTitle value
Sample
// Define the "title" for the Input component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" title="이름 입력"></xf:input> var tmpTitle = input1.getTitle(); // (Return Example ) "Input Name"
getUdcHome( )
Returns the path of the file which defines the UDC. Includes the file extension of .xml. For a path without .xml, use getUdcRoot. When called by a component, not a UDC object, undefined will be returned.
Return
typedescription
StringWhen called by a component, not a UDC object, undefined will be returned.
Sample
The udc file is /a/b/udc.xml, the XML file is /a/c/main.xml, and the UDC object ID is udc1. udc1.getUdcHome(); // The execution result is /a/b/udc.xml.
getUdcRoot( )
Returns the path of the file which defines the UDC. udc1.getUdcHome(); // The execution result is /a/b/udc.xml. For a path including .xml, use getUdcHome. When called by a component, not a UDC object, undefined will be returned.
Return
typedescription
StringWhen called by a component, not a UDC object, undefined will be returned.
Sample
The udc file is /a/b/udc.xml, the XML file is /a/c/main.xml, and the UDC object ID is udc1. udc1.getUdcHome(); // The execution result is /a/b/udc.xml.
getUserData( key )
Returns the user-defined property value set by setUserData as the user data or source (page XML).
Parameter
nametyperequireddescription
keyStringYRandom data key
Return
typedescription
StringData of the corresponding key
Sample
// Apply the customized property (eduTest) to the Input component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" eduTest="Hello"></xf:input> input1.getUserData("eduTest"); // (Return Example) "Hello" // Use setUserData. input1.setUserData("eduTest","WebSquare"); input1.getUserData("WebSquare"); // (Return Example) "Hello"
getValue( separator )
Gets the value of the currently selected item. Uses the defined separator for multiple values.
Gets the label of the currently selected item. For multiple items, uses the defined separator.
Parameter
nametyperequireddescription
separatorStringNSeparator
Return
typedescription
StringValues of the selected items
Sample
// When values "1" and "2" are selected. // Use the corresponding API. var returnValue = checkcombobox1.getValue(); // (Return Example) "1 2" // Use "," separator. var returnValue = checkcombobox1.getValue(","); // (Return Example) "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 component has className received as a parameter or not.
Parameter
nametyperequireddescription
classNameStringYclassName to check
Return
typedescription
BooleanWhether the component has the class or not
Sample
// Define a class for the Input component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" class="tmpInputClass"></xf:input> var returnValue = input1.hasClass("tmpInputClass"); // (Return Example) true
hide( )
Hides the component.
removeAll( isInitialize )
[default:false, true] Removes all items. In case allOption is specified and isInitialize is true, the item will not be removed.
Parameter
nametyperequireddescription
isInitializeBooleanNWhether to delete allOption item or not.
Sample
// When allOption is defined, all items including allOption will be deleted. checkcombobox1.removeAll(); // When allOption is defined, all items but allOption will be deleted. checkcombobox1.removeAll(true);
removeClass( className )
Removes className from the component.
In the default setting, only the classes added by addClass will be applied. In order to directly remove the class defined in the "class" property of the component, add the following setting in config.xml file.
<style><removeDefaultClass value="true" /></style>
Parameter
nametyperequireddescription
classNameStringYName of the class to remove
Sample
// Define a class for the Input component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" class="tmpInputClass"></xf:input> // Add the following to config.xml. <style> <removeDefaultClass value="true" /> </style> // Remove tmpInputClass class. input1.removeClass("tmpInputClass");
setDisabled( disabled )
Sets the disabled property. True to disable, or false not to disable.
Parameter
nametyperequireddescription
disabledBooleanYTrue to disable, or false not to disable.
Sample
// Disable the component. componentId.setDisabled(true);
setEventPause( evList , flag )
Disables or enables the component event.
Parameter
nametyperequireddescription
evListStringNList of the events. If not specified, all user events of the component will be listed. (Enter null data.)
flagBooleanYtrue is to pause, or false is to cancel pausing.
Sample
input1.setEventPause("onclick", true); // Dynamically pauses the onclick event. input1.setEventPause("onfocus,onblur", false); // Restarts the onfocus and the onblur events. input1.setEventPause(null, true); // Pauses all user events registered for the Input component.
setInitStyle( property )
Initializes the component style.
Parameter
nametyperequireddescription
propertyStringNName of the property (If not specified, all properties will be returned.)
Sample
group1.getInitStyle();
setItemDisabled( idx , value )
Disables or enables the item of the corresponding index.
Parameter
nametyperequireddescription
idxNumberYIndex of the item to disable
valueBooleanYDisabled status
Sample
checkcombobox1.setItemDisabled(0, true); The first item is disabled. The item cannot be selected nor unselected.
setNextTabID( componentID , componentScope )
Sets the nextTabID. When the ID of the frame in which the nextTabID, the second argument, is given, the scope can be set.
Parameter
nametyperequireddescription
componentIDStringYComponent ID to set as the nextTabID
componentScopeStringNComponent scope to set as the nextTabID
Sample
checkcombobox1.setNextTabID("input2", "wframe1");
setNodeSet( nodeset , label , value )
Changes the itemset setting. When bound with a DataList, the nodeset must start with data: prefix.
Parameter
nametyperequireddescription
nodesetStringYAdd data: prefix (or the XPath of the instance data) to the Id of the DataList.
labelStringNID of the column to be used as the label. If not specified, the existing value will be used. (Or XPath under the nodeset to set for the label.)
valueStringNID of the column to be used as the value. If not specified, the existing value will be used. (Or XPath under the nodeset to set for the value.)
Sample
// Define a DataList as shown below. <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> // Change the itemset of checkcombobox1 into, and set the label as lbl column and the value as code column. checkcombobox1.setNodeSet('data:dataList1','lbl','code'); // Change to dataList2 which has same columns with dataList1 but different data. checkcombobox1.setNodeSet('data:dataList2'); // Keep the existing label and the value, and change the dataList only.
setOpacity( value )
Sets the opacity of the component.
Parameter
nametyperequireddescription
valueNumberYOpacity value (A real number between 0 and 1)
Sample
componentId.setOpacity(0.45);
setPosition( left , top , mode )
Sets the position (left, top) of the component.
Parameter
nametyperequireddescription
leftNumberYLeft position or null.
topNumberYTop position or null.
modeStringN[defulat:absolute, delta] absolute sets the current positions as x and y, and delta adds x and y to the current positions.
Sample
// Set the top position of the component as 100 pixels. componentId.setPosition(null, 100);
setReadOnly( readOnly )
Controls the "readOnly" property. True to enable, or false to disable.
Parameter
nametyperequireddescription
readOnlyBooleanYTrue to enable, or false to disable.
Sample
// Enable the read-only. componentId.setReadOnly(true);
setRef( ref )
Dynamically sets the ref binding. Add data: prefix to bind with a DataCollection.
If not specified, XPath of the InstanceData will be used.
Parameter
nametyperequireddescription
refStringYPath of the ref to apply
Sample
// Bind hobby key of dataMap1 with the checkcombobox1 component. 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 , heigth )
Sets the size (width, height) of the component.
Parameter
nametyperequireddescription
widthNumberYComponent width or null
heigthNumberYComponent height or null
Sample
// Set the component height as 100 pixels. componentId.setSize(null,100);
setStyle( propertyName , value )
Sets the style of the specified property.
Parameter
nametyperequireddescription
propertyNameStringYName of the style
valueStringYValue of the style
Sample
// Set the component width as 200px. componentId.setStyle("width", "200px"); // Change the background color to 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 the user data in the component. If the key cannot be set for the component, corresponding logs will be displayed.
Parameter
nametyperequireddescription
keyStringYRandom data key
valueStringYRandom data key
Sample
// Setting a (key, value) pair of ("data", "WebSquare5") in the component. componentId.setUserData("data", "WebSquare"); // Some keys cannot be set for the component. componentId.setUserData("title", "WebSquare"); // (Log Example) !!!WARNING - [title] can't define as UserData
setValue( value )
Selects an item which contains the value received as a parameter, and sets the value in the selected item.
For multiple items, use a separator.
The default separator is space.
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[사과]]></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.setValue("1,2");
show( displayType )
Displays the component.
The related CSS properties are display and visibility:show;.
Parameter
nametyperequireddescription
displayTypeStringN[default:block ,inline ,none ,""] Value of the Display property.
Sample
// Block the "display" property. componentId.show(); // Enable the "display" property in the class. componentId.show("");
toggleClass( className )
Removes a class named className, or if there is no such a class, adds a class named className.
In the default setting, only the classes added by addClass can be removed. To remove other classes, add the following setting in config.xml.
<style><removeDefaultClass value="true" /></style>
Parameter
nametyperequireddescription
classNameStringYclassName to set
Sample
// Define a class for the Input component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" class="tmpInputClass"></xf:input> // Add the following to config.xml. <style> <removeDefaultClass value="true" /> </style> // Remove tmpInputClass class. input1.toggleClass("tmpInputClass"); // Add tmpInputClass class again. input1.toggleClass("tmpInputClass");
trigger( type , array )
Triggers a certain event registered for the component.
Parameter
nametyperequireddescription
typeStringYName of the event to trigger
arrayArrayNArray of parameters to send to the event handler
Sample
// Trigger the onclick event in the input1 component. input1.trigger("onclick"); // Trigger the onviewchange event in the input component and call the event handler function by sending arguments of (1, 2). input1.trigger("onviewchange", [1,2]);
unbind( type , function )
Removes an event registered for the component.
Parameter
nametyperequireddescription
typeStringNName of the event to remove. If not specified, all events of the components will be removed.
functionFunctionNHandler function of the event to remove. If not specified, all handler functions of the event will be removed.
Sample
// Remove all events registered in the input component. input1.unbind(); // Remove all handler functions of onviewchange event registered in the input component. input1.unbind("onviewchange"); // Remove the func1 event handler of onviewchange event registered for component input1. input1.unbind("onviewchange", func1);
unbindRef( )
Releases the ref binding.
validateObject( )
Validates the component according to the specified properties.
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 - without checkcombobox value) An empty object will be returned. // Return -with checkcombobox value) A returnObj object will be returned. returnObj.callerId = "checkcombobox1" returnObj.type = "mandatory" returnObj.value = "" Set displaymessage as true to alert a message defined in the WebSquare5 Engine upon a validation failure. //// (Alert Example) This field is mandatory.
visible( flag )
[deprecated] Shows/Hides the component, or sets the visible property using setStyle.
Sets the visibility of the component style. In case of true, set visible. In case of false, set hidden.
Parameter
nametyperequireddescription
flagBooleanYVisibility (In case of true, set visible. In case of false, set hidden.)