PropertyEventMethodIndex
WebSquare.uiplugin.autoComplete - 5.0_4.4427B.20210603.112955

AutoComplete. Conducts search and displays the search result on the selection list. Provides the search feature as an extended version of SelectBox. Returns the search result based on the end user’s input.
Provides suggestions based on the user's input. Use the interactionMode property to communicate with the server in real time for the display of the suggestions. (Related Property: interactionMode)
The highest-level tag of the AutoComplet is <div> under which various tags can be used.

Type

uiplugin

Property Summary

allOption
To be deprecated.
allowEmptySubmission
Allows search of empty string in case interactionMode="true" is used.
animation
Animation effects to apply to the selection item list.
autoFocus
Automatically moves to the nextTabID component upon (100ms later) the end user’s entering a complete item on the selection list.
caseSensitive
Identifies upper-class alphabets from lower-class.
chooseOption
Shows the selection guide message. [default:false,true]
chooseOptionLabel
Set the label of the selection guide message.
chooseOptionLabelLocaleRef
Key of the chooseOptionLabel text.
chooseOptionValue
Set the value of the selection guide message.
class
Same as the class property in HTML.
closeonmouseleave
Closes the list upon mouse moving out when the list is open on the subLayer. [default:false, true]
delimiter
Delimiter to separate the value from the label when both the value and the label are displayed on the list.
direction
Sets the list-opening direction.
disabled
Disabled status of the component
disableEdit
Displays the list only without entering the editing mode upon mouse clicking.
displayFormatter
Name of the function that formats the component value.
displayMode
Displaying method. [default:label, value delim label, label delim value, value]
editModeEvent
Sets an event that triggers entering into the editing mode.
editType
Sets the operation triggered by the end user’s clicking the component.
emptyIndex
Index of the item to select when rendering the AutoComplete for the first time.
emptyItem
When a value or index not in the item list is set (by a method such as setValue or setSelectedIndex), sets an empty label or value (empty string). [default: false, true]
emptyValue
Value to be used when emptyItem="true" is set.
escape
Converts <>&" characters into HTML Escape characters.
id
Component ID
interactionEnterKey
Executes submission upon the end user’s pressing the Enter after data input. [default:false, truee]
interactionMode
Dynamically receives the data from the server and generates the selection items based on the user’s input. [default: false, true]
keyInputRef
Name of the node containing the key node under the XPath when the search result is bound with the InstanceData.
mandatory
Allows reading only. [default:false, true]
nextTabByEnter
Allows the Enter key to function same as the Tab key when the nextTabID is given. Upon the end user’s pressing the Enter key, the focus will move to the nextTabID component.
nextTabID
The ID of the component to be selected upon the end user’s pressing the Tab key.
noResult
Sets the text processing method when there is no result returned for the end user’s input.
noResultFirstItem
Displays the first selection item upon initial loading. [default: false, true]
placeholder
Same as the placeholder property in HTML5. Displays additional info such as hints for the end user.
preventWheelEvent
Prevents mouse wheel events.
readOnly
Enables the readOnly setting.
ref
Binds the initial value of the component with a model and the DataCollection.
search
Search method. [default: start, contain, none]
searchTarget
Data to search based on the user's input.
selectedData
Keeps the selection not existing in the bound DataList.
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.
submission
Submission ID when the interactioMode is true.
submissionFunc
Function to call when the interactioMode is "true".
tabIndex
The focusing order by the Tab key.
textAlign
Sets the text alignment in the selection item list.
title
Same as the class property in HTML.
tooltipClass
Name of the style class to apply to the tooltip
tooltipDisplay
Displays tooltip for the user’s selection.
tooltipTime
Tooltip display time. (Unit: second)
type
Same as the type property in HTML.
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
useMousewheel
Allows use of the mouse wheeling on the selection item list.
userData1
User-defined property
userData2
User-defined property
userData3
User-defined property
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

onafteredit
Triggered after the end user selects the item and the change is completely done.
onchange
// Upon users changing the selection item
oneditenter
Triggered upon the end user's pressing Enter key on the keyboard.
oneditkeyup
Triggered upon the end user's releasing a key off the keyboard after pressing the key.
onitemclick
Triggered upon end user’s clicking a selection item on the list.
onselected
Triggered after the end user’s clicking a selection item on the list.
ontoggleclick
Triggered upon the end user’s clicking the toggle button (▼).
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( label , value , nodest , index )
Adds the first item.
bind( eventType , function )
Dynamically allocate an event and the handler function to the component.
changeChooseOption( newValue , newLabel )
Changes the chooseOption property.
changeClass( oldClassName , newClassName )
Changes the class currently applied to the corresponding WebSquare component. (Supported in all WebSquare components.)
disableEdit( onoff )
Displays the selection items only without entering the editing mode upon the end user’s clicking mouse.
focus( )
Focuses the WebSquare component.
getDataListInfo( )
Returns the dataList bound with the AutoComplete.
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.
getInitStyle( CSS )
Returns the initial style of the WebSquare component.
getItem( index )
Returns the item information of the specified index.
getItemCount( )
Returns the number of the items on the list.
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.)
getSearchedItems( )
Returns the searched items as an array.
getSelectedIndex( )
Returns the index of the selected item.
getSelectedRow( )
Returns the object that stores the value of the selected row.
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( isOriginal )
Returns the label of the currently selected item.
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( )
Returns the value of the title property.
hasClass( className )
Checks whether the WebSquare component has a certain class.
hide( )
Hides the component.
initAutoComplete( )
Initializes the AutoCompelete component.
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.
setDummyData( value , label )
Sets a dummy selection value and label.
setEditMode( )
Displays focus on the input field.
setEventPause( evList , flag )
Pauses the event.
setGridItemset( obj )
Dynamically changes the gridViewItemset binding.
setInitStyle( property )
Restores the initial style of the WebSquare component.
setItem( label , value , nodest , index )
Sets the selection item with the given value.
setItemSet( nodeset , label , value )
Sets the selection item list.
setMaxLength( maxLength )
Dynamically sets the maxLength.
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.
setSize( width , height )
Sets the size (width, height) of the WebSquare component.
setStyle( propertyName , value )
Sets the style with the given value.
setText( label , isOriginal )
Selects the item matching with the received label.
setTitle( title )
Sets the title of the WebSquare component.
setUserData( key , value )
Sets random data in the WebSquare component. (Supported in all WebSquare components.)
setValue( value )
Selects the item matching with the received 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.
validate( )
Validates the component according to the specified properties.
validateObject( )
Validates the component according to the specified properties.
visible( flag )
[deprecated]

Property Detail

allOption
To be removed after over-riding.
allowEmptySubmission
Allows search of empty string in case interactionMode="true" is used. [default:false, true] (Options) "false" (Default) : Not allow. "true": Allow. (Related Property) interactionMode="true"
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.
autoFocus
Automatically moves to the nextTabID component upon (100ms later) the end user’s entering a complete item on the selection list.
(Note) Not affected by maxByteLength unlike InputBox.
caseSensitive
Uses case-sensitivity. [default:true, false] (Options) "true" (Default) : Use case-sensitivity. "false" : Not use case-sensitivity.
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.
chooseOptionValue
Set the value of the selection guide message. Valid when the chooseOption is "true". (Related Property) chooseOption="true"
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 separated by 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.
delimiter
Separates the value from the label. Used by the displayMode property. (Related Property) displayMode
direction
List-opening direction. [default:auto, down, up, fit] (Options) "auto" (Default) : Automatically decided depending on the position in the browser. "down" : Opens into the lower direction. "up" : Opens into the upper direction. "fit"
disabled
Disable the component. (Options) "false" (Default) : Not to disable the component. "true": Disables the component.
disableEdit
Displays the list only without entering the editing mode upon mouse clicking. [default:false, true] (Options) "false" (Default) : Displays the list and enters the editing mode. "true": Displays the list without entering the editing mode.
displayFormatter
Name of the function that formats the component value.
Formats the value from the Engine, and returns the final value to be displayed. (Example) Define function fn_inputFormat (tmpVal){ return tmpVal+" 님" }; in the global script. Set the property as displayFormatter="fn_inputFormat".
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
editModeEvent
The event required to enter the edit mode. [default:onclick, onfocus] (Options) "onclick" (Default) : Enters the editing mode upon the onclick event being triggered. "onfocus" : Enters the editing mode upon the onfocus event being triggered.
editType
Defines the action to be triggered upon the end user’s clicking the component. [default:focus, select] (Options) "select" (Default) : Selects the focused text. "focus" : Move the cursor to the end of the text.
emptyIndex
Index of the item to select when rendering the AutoComplete for the first time. // In the following case, an empty value is selected during initial loading. emptyItem="true" emptyIndex="-1"
emptyItem
When a value or index not in the item list is set (by a method such as setValue or setSelectedIndex), sets an empty label or value (empty string). [default: false, true]
When a selection item with an empty value is added or removed, the first item will be selected. (Same as selectedIndex=-1 in HTML select.)
However, using the emptyValue property, the value can be set as other values than the empty value. (Options) "false" (Default) : Uses the dynamically set value. "true": Set an empty value. (Related Property) emptyValue
emptyValue
Value to be used when emptyItem="true" is set.
However, there is an item of which value is same as the emptyValue, the label will be displayed as "". (Related Property) emptyItem="true"
escape
Converts <>&" into HTML Escape string for display. [default: false, true] (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.
interactionEnterKey
Executes submission upon the end user’s pressing the Enter after data input. [default:false, truee]
Valid only in case of interactionMode="true". (Options) "false" (Default) "true": Runs the submission upon the end user’s pressing the Enter key.
(!!!Warning!!!) Not function when the interactionKey is "all".
interactionMode
Dynamically receives the data from the server and generates the selection items based on the user’s input. [default: false, true]
Either submission or submissionFunc must be defined.
xforms-submit-done or submission submitdone event must use setItemSet() and openTable() functions. "false" (Default): Generates selection items based on the end user’s input. "true": Not to generate the selection items based on the user’s input.
keyInputRef
Name of the node containing the key node under the XPath when the search result is bound with the InstanceData. Valid when interactionMode="true". (Example) // keyInputRef="req/search" <req><search><key>Keyword</key></search></req><search><key> (Related Property) interactionMode="true"
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();
nextTabByEnter
Allows the Enter key to function same as the Tab key when the nextTabID is given. Upon the end user’s pressing the Enter key, the focus will move to the nextTabID component.
nextTabID
The ID of the component to be selected upon the end user’s pressing the Tab key.
noResult
Text display method when there is no search result. [default: previous, clear, noEnd, useData, first] (Options) "previous" (Default) : Displays the previous value. (Valid only in case of interactionMode="true".) "clear" : Clears the inputted value. "noEnd" : Keeps the input mode. "useData" : Displays the entered data and adds the entered data to the list. (Valid in case of interactionMode="false".) "first" : Displays the first selection item.
noResultFirstItem
Displays the first selection item upon initial loading. [default: false, true]
Valid when bound with the DataCollection through the ref property and the noResult property is "first". (Options) "false" (Default) : Not to display the first selection item. "true": Displays the first selection item.
false (Default): Does not select the first item. (Related Property) ref noResult="first"
placeholder
Same as the placeholder property in HTML5. Displays additional info such as hints for the end user.
When nothing is entered in AutoComplete, the placeholder will be displayed. Upon end user’s input, the placeholder will disappear.
Browsers supported: IE10 or higher
preventWheelEvent
Prevents mouse wheel events. [default:false, true] (Options) "false" (Default) : Allows mouse wheel events. "true": Prevents mouse wheel events. (Related Event) mouseWheelEvent
readOnly
Allows reading only. [default:false, true] (Options) "false" (Default) : Not to set readOnly. "true": Sets readOnly.
ref
Binds the initial value of the component with a model and the DataCollection.
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.
selectedData
Keeps the selection not existing in the bound DataList. [default: true, false] (Options) "true" (Default) : Keeps the newly selected item and ignores the previously selected item. "false" : Keeps the selection.
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 size of the selection item list. [default:fixed, auto] (Options) "fixed" (Default) : Uses the fixed width. "auto" : Adjusts according to the label.
submission
Submission ID when the interactioMode is true.
Runs the submission according to the (currently not open) interactionKey property. (Related Property) interactioMode="true" interactionKey (!!!Warning!!!) Cannot be used with the submissionFunc property.
submissionFunc
Function to call when the interactioMode is "true".
Runs the function according to the (currently not open) interactionKey property. (Related Property) interactioMode="true" interactionKey (!!!Warning!!!) Cannot be used with the submission property.
tabIndex
The focusing order by the Tab key.
Same as the tabindex property in HTML.
textAlign
Text alignment of the selection item list. [default: center, left, right] (Options) "center" (Default) Align at the center. "left" : Align to the left. "right" : Align to the right.
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.
tooltipClass
Name of the style class to apply to the tooltip Valid in case of tooltipDisplay="true". (Related Property) tooltipDisplay="true"
tooltipDisplay
Displays tooltip based on the user’s selection. [default: false, true] (Options) "true": Displays the tooltip. "false" (Default) : Not to display the tooltip.
tooltipTime
Tooltip display time. (Unit: second)
Valid in case of tooltipDisplay="true". (Related Property) tooltipDisplay="true"
type
Same as the type property in HTML. [default:text]
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 Property) Multi-language key is needed for the chooseOptionLabel. (chooseOptionLabelLocaleRef)
useMousewheel
Allows use of the mouse wheel on the selection item list. [default:true, false] (Options) "true" (Default) : Uses the mouse wheel. "false" : Not to use the mouse wheel.
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");
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 AutoComplete 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

onafteredit
Triggered after the end user selects the item and the change is completely done.
onchange
// Upon users changing the selection item
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>
oneditenter
Triggered upon the end user's pressing Enter key on the keyboard.
Sample
<w2:autoComplete id="autoComplete1" ev:oneditenter="scwin.autoComplete1_oneditenter"/> scwin.autoComplete1_oneditenter = function(e) { var keyCode = (e.charCode) ? e.charCode : e.keyCode; var logStr = "keyCode=" + keyCode; WebSquare.logger.printLog(logStr); console.log(logStr); }
oneditkeyup
Triggered upon the end user's releasing a key off the keyboard after pressing the key.
A JSON object containing oldValue, newValue, and keyCode is received.
Parameter
nametypedescription
infoJSONReturns a JSON containing oldValue, newValue, and keyCode. <String> info.oldValue : Value before the key being entered <String> info.newValue : Newly entered value <Number> info.keyCode : Entered key code
eEventevent object
Sample
<w2:autoComplete id="autoComplete1" ev:oneditkeyup="scwin.autoComplete1_oneditkeyup"/> scwin.autoComplete1_oneditkeyup = function(info, e) { var logStr = "oldValue=" + info.oldValue + ", newValue=" + info.newValue + ", keyCode=" + info.keyCode; WebSquare.logger.printLog(logStr); console.log(logStr); }
onitemclick
Triggered upon end user’s clicking a selection item on the list.
Parameter
nametypedescription
indexnumberIndex of the clicked item
onselected
Triggered after the end user’s clicking a selection item on the list.
Sample
<w2:autoComplete id="autoComplete1" ev:onselected="scwin.autoComplete1_onselected"/> scwin.autoComplete1_onselected = function() { }
ontoggleclick
Triggered upon the end user’s clicking the toggle button (▼).
Parameter
nametypedescription
isOpenbooleanShows whether the item list has been dsiplayed before the event was triggered.
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
infoObjectAn object containing information about previous selection and the present selection. <String> info.oldValue : Old value <String> info.newValue : Currently selected node <Number> info.oldSelectedIndex : Previous index <Number> info.newSelectedIndex : Currently selected index
Sample
<script ev:event="onviewchange( info )"><![CDATA[ var oldValue = info.oldValue; var newValue = info.newValue; var oldSelectedIndex = info.oldIndex; var newSelectedIndex = info.newIndex; ]]></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( label , value , nodest , index )
Adds the first item.
Parameter
nametyperequireddescription
labelStringYLabel of the item
valueStringYValue of the item
nodestElementYnodeset of the item
indexNumberNIndex of the item
Return
typedescription
BooleanExecution result of addItem. “false” is returned upon a failure.
Sample
// label: Title, value: isbn. Separated by (). // (Example) Add Weekend "Getaways (9788959136315)". // The title is "Weekend Getaways" and the isbn is "9788959136315". var returnValue = autoComplete1.addItem("Weekend Getaways","9788959136315"); // (Result) ‘Weekend Getaways’ is added to the end of the selection item list.
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 );
changeChooseOption( newValue , newLabel )
Changes the chooseOption property. (Related Property) chooseOption
Parameter
nametyperequireddescription
newValueStringYNew chooseOption value
newLabelStringYNew chooseOption label
Sample
// (Example) Set the value as "0" and the label as "Choose". autoComplete1.changeChooseOption("0","Choose");
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");
disableEdit( onoff )
Displays the selection items only without entering the editing mode upon the end user’s clicking mouse. The end user can select an item.
Parameter
nametyperequireddescription
onoffBooleanYEditing status
focus( )
Focuses the WebSquare component. (Supported in all WebSquare components.)
getDataListInfo( )
Returns the dataList bound with the AutoComplete.
Return
typedescription
ObjectReturns nodeset, label, and value id as an object.
Sample
// Example autoComplete1.getDataListInfo();
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"
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.)
getItem( index )
Returns the item information of the specified index.
Parameter
nametyperequireddescription
indexNumberYIndex of the item
Return
typedescription
JSONObject containing item information
<String> label : Displayed label (with displayMode applied) <String> orgLabel : Original value of the label <String> value : Value
Sample
// Define a DataList. <w2:dataList baseNode="list" id="dc_tmpList"> <w2:columnInfo> <w2:column id="country" name="label" dataType="text"></w2:column> <w2:column id="value" name="value" dataType="text"></w2:column> </w2:columnInfo> <w2:data use="true"> <w2:row> <country><![CDATA[네덜란드]]></country> <value><![CDATA[0016]]></value> </w2:row> <w2:row> <country><![CDATA[대한민국]]></country> <value><![CDATA[0022]]></value> </w2:row> <w2:row> <country><![CDATA[덴마크]]></country> <value><![CDATA[0023]]></value> </w2:row> </w2:data> </w2:dataList> // (1) Bind the AutoComplete with the above DataList(dc_tmpList). // (2) Use the settings below to display both the label and the value. // (Setting 1) displayMode="label delim value" // (Setting 2) delimiter="::" <w2:autoComplete id="autoComplete1" style="position: relative;width:126px;height:21px;margin-right:10px;" displayMode="label delim value" delimiter="::" submenuSize="auto"> <w2:choices> <w2:itemset nodeset="data:dc_tmpList"> <w2:label ref="country"></w2:label> <w2:value ref="value"></w2:value> </w2:itemset> </w2:choices> </w2:autoComplete> // (EXample) Take the first item. var tmpObj = autoComplete1.getItem(0) // (Return) // { // "label":"The Netherlands::0016", // "value":"0026", // "orgLabel":"The Netherlands" // }
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 = checkbox1.getItemCount(); // (Return) 2
getNextTabID( )
Returns the nextTabID value. (Related Property) nextTabID
Sample
// Example var nextTabID = autoComplete1.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
getSearchedItems( )
Returns the searched items as an array.
Return
typedescription
ArrayOne-dimensional array containing information of all items
<JSON> Object : Containing (formatted) label, value, orgLabel (original label), and index.
Sample
// Define a DataList. <w2:dataList baseNode="list" id="dc_tmpList"> <w2:columnInfo> <w2:column id="country" name="label" dataType="text"></w2:column> <w2:column id="value" name="value" dataType="text"></w2:column> </w2:columnInfo> <w2:data use="true"> <w2:row> <country><![CDATA[네덜란드]]></country> <value><![CDATA[0016]]></value> </w2:row> <w2:row> <country><![CDATA[대한민국]]></country> <value><![CDATA[0022]]></value> </w2:row> <w2:row> <country><![CDATA[덴마크]]></country> <value><![CDATA[0023]]></value> </w2:row> </w2:data> </w2:dataList> // (1) Bind the AutoComplete with the above DataList(dc_tmpList). // (2) Use the settings below to display both the label and the value. // (Setting 1) displayMode="label delim value" // (Setting 2) delimiter="::" <w2:autoComplete id="autoComplete1" style="position: relative;width:126px;height:21px;margin-right:10px;" displayMode="label delim value" delimiter="::" submenuSize="auto"> <w2:choices> <w2:itemset nodeset="data:dc_tmpList"> <w2:label ref="country"></w2:label> <w2:value ref="value"></w2:value> </w2:itemset> </w2:choices> </w2:autoComplete> // (Example 1) Take entire items. var tmpRsArr = autoComplete1.getSearchedItems(); // (Result) Array containing total three items // (Example 2) Take the first item. var tmpObj = tmpRsArr[0]; // (Result) // { // "label":"The Netherlands::0016", // "value":"0026", // "orgLabel":"The Netherlands", // "index":0 // }
getSelectedIndex( )
Returns the index of the selected item.
In case no selection is made, -1 will be returned.
Return
typedescription
NumberThe index of the selected item.
Sample
// (Example) autoComplete1.getSelectedIndex();
getSelectedRow( )
Returns the object that stores the value of the selected row.
However, in case the selection item list is bound with the gridViewItemset, the selected row will be returned.
Return
typedescription
JSONObject that stores information of the item - basic information.
<String> label : Original label without the displayMode being applied. <String> value : value
Sample
// Define a DataList. <w2:dataList baseNode="list" id="dc_tmpList"> <w2:columnInfo> <w2:column id="country" name="label" dataType="text"></w2:column> <w2:column id="value" name="value" dataType="text"></w2:column> </w2:columnInfo> <w2:data use="true"> <w2:row> <country><![CDATA[네덜란드]]></country> <value><![CDATA[0016]]></value> </w2:row> <w2:row> <country><![CDATA[대한민국]]></country> <value><![CDATA[0022]]></value> </w2:row> <w2:row> <country><![CDATA[덴마크]]></country> <value><![CDATA[0023]]></value> </w2:row> </w2:data> </w2:dataList> // (1) Bind the AutoComplete with the above DataList(dc_tmpList). // (2) Use the settings below to display both the label and the value. // (Setting 1) displayMode="label delim value" // (Setting 2) delimiter="::" <w2:autoComplete id="autoComplete1" style="position: relative;width:126px;height:21px;margin-right:10px;" displayMode="label delim value" delimiter="::" submenuSize="auto"> <w2:choices> <w2:itemset nodeset="data:dc_tmpList"> <w2:label ref="country"></w2:label> <w2:value ref="value"></w2:value> </w2:itemset> </w2:choices> </w2:autoComplete> // (Example) Upon user’s selecting the first item var tmpObj = autoComplete1.getSelectedRow(); // (Return) // { // "label":"The Netherlands", // "value":"0026" // }
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( isOriginal )
Returns the label of the currently selected item.
Parameter
nametyperequireddescription
isOriginalBooleanN[default: false, true] Returns the original, not formatted label.
"false" (Default) Returns the formatted label. "true" Returns the original label.
Return
typedescription
Stringlabel of the currently selected item
Sample
// Define a DataList. <w2:dataList baseNode="list" id="dc_tmpList"> <w2:columnInfo> <w2:column id="country" name="label" dataType="text"></w2:column> <w2:column id="value" name="value" dataType="text"></w2:column> </w2:columnInfo> <w2:data use="true"> <w2:row> <country><![CDATA[네덜란드]]></country> <value><![CDATA[0016]]></value> </w2:row> <w2:row> <country><![CDATA[대한민국]]></country> <value><![CDATA[0022]]></value> </w2:row> <w2:row> <country><![CDATA[덴마크]]></country> <value><![CDATA[0023]]></value> </w2:row> </w2:data> </w2:dataList> // (1) Bind the AutoComplete with the above DataList(dc_tmpList). // (2) Use the settings below to display both the label and the value. // (Setting 1) displayMode="label delim value" // (Setting 2) delimiter="::" <w2:autoComplete id="autoComplete1" style="position: relative;width:126px;height:21px;margin-right:10px;" displayMode="label delim value" delimiter="::" submenuSize="auto"> <w2:choices> <w2:itemset nodeset="data:dc_tmpList"> <w2:label ref="country"></w2:label> <w2:value ref="value"></w2:value> </w2:itemset> </w2:choices> </w2:autoComplete> // Upon users selecting the first item // (Example 1) Return the label on the current screen. var tmpObj = autoComplete1.getText(); // (Return) "The Netherlands::0016" // (Example 2) Return the original label. var tmpObj = autoComplete1.getText(true); // (Return) "The Netherlands"
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( )
Returns the value of the title property.
Return
typedescription
StringValue of the selected item
Sample
// (Example) autoComplete1.getValue();
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.
Sample
// Example autoComplete1.hide();
initAutoComplete( )
Initializes the AutoCompelete component. (Deletes items and initializes values.)
Sample
// Example autoComplete1.initAutoComplete();
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);
setDummyData( value , label )
Sets a dummy selection value and label.
The item will not be added to the list, and selectedIndex will be set as -1.
Parameter
nametyperequireddescription
valueStringYValue to set
labelStringYLabel to set
Sample
// (Example 1) Set a random value. autoComplete1.setDummyData("0000","WebSquare"); // "WebSquare" is displayed. // (Example 2) Take out the added value. var tmpRs = autoComplete1.getValue(); // (Return) "0000" // (Example 3) Take out the index of the selected item. var tmpIdx = autoComplete1.getSelectedIndex(); // (Return) “-1” will be returned since it is not selected from the list.
setEditMode( )
Displays focus on the input field.
Sample
// Example autoComplete1.setEditMode();
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);
setGridItemset( obj )
Dynamically changes the gridViewItemset binding.
Deletes the existing gridViewItemset, and sets a new one.
Parameter
nametyperequireddescription
objJSON||XMLYObject containing the gridViewItemset to be newly created. (JSON or XML object only.)
<String> obj.nodeset : DataList ID. Must start with "data:". <String> obj.label : ID of the column to set as label. <String> obj.value : ID of the column to set as value. <Number> obj.width : Width of the gridViewItemset. <Number> obj.height : Height of the gridViewItemset. <Array> obj.item : JSON array containing settings of each column.
Sample
var obj = { "nodeset" : "data:dataList2", "label" : "col1", "value" : "col2", "width" : 400, "height" : 300, "item" : [{"ref" : "col1", "header" : "label"},{"ref" : "col2", "header" : "value"},{"ref" : "col3", "header" : "dummy"}] }; autoComplete1.setGridItemset(obj);
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();
setItem( label , value , nodest , index )
Sets the selection item with the given value.
Parameter
nametyperequireddescription
labelStringYValue of the label
valueStringYValue of the selected item
nodestElementYnodeset of the item
indexNumberYIndex of the item
setItemSet( nodeset , label , value )
Sets the selection item list.
Keeps the current selection (input), and newly sets the selection item list only.
Must be used by the xforms-submit-done event when the interactionMode is "true". (Related Property) interactionMode="true"
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. autoComplete1.setItemSet("data:dc_tmpSearchList","disp","code");
setMaxLength( maxLength )
Sets the maxLength.
Parameter
nametyperequireddescription
maxLengthNumberYmaxLength to set
Sample
// Example autoComplete1.setMaxLength(7); autoComplete1.setMaxLength(""); // No maxLength limit.
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 autoComplete1.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. autoComplete1.setNodeSet('data:dataList1','lbl','code'); // (Example 2) Bind with DataList2, and use existing column settings for the label and the value. autoComplete1.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
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 style with the given value.
Parameter
nametyperequireddescription
propertyNameStringYName of the style to newly set
valueStringYValue to set
Sample
// (Example) Change the width. componentId.setStyle("width", 100); // The width is in pixels, and the result will be same with that of componentId.setStyle("width", "100px");. // The width is in %, and the result will be same with that of componentId.setStyle("width", "100%");.</div> </dd> <a class="anchor" id="setText"></a> <dt class="apiname">setText( label , isOriginal ) </dt> <dd> <div class="pdesc">Selects the item matching with the received label. </div> <!--만일 해당 Method 가 파라미터가 있는 경우 table 테그를 이용해서 보여준다.--> <table id="ptable"> <caption>Parameter</caption> <tr> <td class="header1">name</td><td class="header2">type</td><td class="header2">required</td><td class="header3">description</td> </tr> <tr> <td class="necessary">label</td><td class="row">String</td><td class="row">Y</td><td class="row">Label of the item to select</td> </tr> <tr> <td class="necessary">isOriginal</td><td class="row">Boolean</td><td class="row">N</td><td class="row">[default: false, true] Whether to use the original unformatted label.<br /> <xmp class='js description'>"false" (Default) Returns the formatted label. "true" Returns the original label.
Sample
// Define a DataList. <w2:dataList baseNode="list" id="dc_tmpList"> <w2:columnInfo> <w2:column id="country" name="label" dataType="text"></w2:column> <w2:column id="value" name="value" dataType="text"></w2:column> </w2:columnInfo> <w2:data use="true"> <w2:row> <country><![CDATA[네덜란드]]></country> <value><![CDATA[0016]]></value> </w2:row> <w2:row> <country><![CDATA[대한민국]]></country> <value><![CDATA[0022]]></value> </w2:row> <w2:row> <country><![CDATA[덴마크]]></country> <value><![CDATA[0023]]></value> </w2:row> </w2:data> </w2:dataList> // (1) Bind the AutoComplete with the above DataList(dc_tmpList). // (2) Use the settings below to display both the label and the value. // (Setting 1) displayMode="label delim value" // (Setting 2) delimiter="::" <w2:autoComplete id="autoComplete1" style="position: relative;width:126px;height:21px;margin-right:10px;" displayMode="label delim value" delimiter="::" submenuSize="auto"> <w2:choices> <w2:itemset nodeset="data:dc_tmpList"> <w2:label ref="country"></w2:label> <w2:value ref="value"></w2:value> </w2:itemset> </w2:choices> </w2:autoComplete> // (Example 1) Upon user's selecting an item of "Republic of Korea" label - The displayed label is selected. autoComplete1.setText("Republic of Korea::0022"); // (Display) "Republic of Korea::0022" // (Example 2) Upon users selecting an item of "Republic of Korea" label (with the isOriginal being “true”) autoComplete1.setText("Republic of Korea",true); // (Display) "Republic of Korea::0022" // (Example 3) Upon user’s selecting "Republic of Korea" label - isOriginal is not given autoComplete1.setText("Republic of Korea"); // (Display) The item is not selected.
setTitle( title )
Sets the title of the WebSquare component.
Parameter
nametyperequireddescription
titleStringYValue to set
Sample
// Set the title as "test". autoComplete1.setTitle("test");
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 item matching with the received value.
Parameter
nametyperequireddescription
valueStringYValue of the item to select
Sample
// Define a DataList. <w2:dataList baseNode="list" id="dc_tmpList"> <w2:columnInfo> <w2:column id="country" name="label" dataType="text"></w2:column> <w2:column id="value" name="value" dataType="text"></w2:column> </w2:columnInfo> <w2:data use="true"> <w2:row> <country><![CDATA[네덜란드]]></country> <value><![CDATA[0016]]></value> </w2:row> <w2:row> <country><![CDATA[대한민국]]></country> <value><![CDATA[0022]]></value> </w2:row> <w2:row> <country><![CDATA[덴마크]]></country> <value><![CDATA[0023]]></value> </w2:row> </w2:data> </w2:dataList> // Bind the AutoComplete with the above dataList(dc_tmpList). <w2:autoComplete id="autoComplete1" style="position: relative;width:126px;height:21px;margin-right:10px;" submenuSize="auto"> <w2:choices> <w2:itemset nodeset="data:dc_tmpList"> <w2:label ref="country"></w2:label> <w2:value ref="value"></w2:value> </w2:itemset> </w2:choices> </w2:autoComplete> // (Example) Select an item with "Republic o Korea" label. autoComplete1.setValue("0022");
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 AutoComplete.
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
// AutoComplet is bound with the DataList. autoComplete1.setVisibleColumn(col3, false); // (Result) Rows of which col3 has “false” value will not be displayed as selection items on the AutoComplete.
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.
validate( )
Validates the component according to the specified properties.
Always returns “true” when the interactionMode is "true". (Validation Properties) mandatory (Related Property) interactionMode="true"
Return
typedescription
BooleanValidation result (true/false)
Sample
// Set mandatory as “true”. <xf:input id="autoComplete1" mandatory="true"></xf:input> var returnValue = autoComplete1.validate(); // (Return - When there is no input.) "false" will be returned. // (Return - When there is input.) "true" will be returned.
validateObject( )
Validates the component according to the specified properties. (Validation-related Properties) mandatory
Return
typedescription
ObjectValidation result object
<String> object.callerId Validation target component ID <String> object.type Validation items <Boolean> object.value Validation result
Sample
// Set mandatory as “true”. <w2:autoComplete id="autoComplete1" mandatory="true"> <w2:choices> <w2:itemset nodeset="data:dataList3"> <w2:label ref="label"></w2:label> <w2:value ref="value"></w2:value> </w2:itemset> </w2:choices> </w2:autoComplete> // (Example) var returnObj = autoComplete1.validateObject(); // (Return - No value in the AutoComplete) returnObj will be returned. returnObj.callerId = "autoComplete1" returnObj.type = "mandatory" returnObj.value = "" // (Return - The AutoComplete has values.) An empty object will be returned.
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;