PropertyEventMethodIndex
WebSquare.uiplugin.textbox - 5.0_2.3750B.20190805.154938

Displays Text through the use of div tag of HTML. A lighter version of the Output component.
HTML tags (such as li, dt, dd, h1, p, etc.) can be drawn through the use of the tagname. The TextBox component cannot have a child. Container-type tags must be used with the Group component.

Type

uiplugin

Property Summary

class
Same as the class property in HTML standard. One or more classes defined in the CSS file or in the style block can be applied (through the use of the space as the separator).
dataType
[default:text, number, date, time, link] Data type of the Span component values, and referred to by the properties such as displayFormat.
displayFormat
Formats the values same as in Excel file. Depends on the dataType defined in the Engine.
displayFormatter
Name of the function that format the component value.
escape
[true, false] Converts <>&" into HTML Escape characters.
escapeFormatter
Name of the function that defines the customized format for the value. Allows the developer to directly control characters (such as html tag, javascript:alert) not allowed for security reasons.
for
ID of the component to focus upon clicking of the component (or label).
id
Component ID
label
Text to be displayed as the value of the component.
localeRef
Defines the key of the text to be displayed on the WebSquare5 client when the multi-language feature is enabled.
ref
The value of the DataCollection. Required to bind the component with a DataCollection. Starts with a prefix of "data:".
tabIndex
The focusing order by the Tab key.
tagname
In most cases, the TextBox component uses the div tag. This field is used to use other tags than the div tag.
toolTip
Tooltip provided by WebSquare5. Displays additional information of the component.
tooltipDisplay
[default:false, true] Displays the cell data as a tooltip upon the end user's hovering the mouse over the cell when the cell data is longer than the cell width.
tooltipFormatter
Name of the customized function to change the tooltip text when the tooltipDisplay property is true.
tooltipPositionX
[defulat:20] X coordinate of the tooltip. Valid when the tooltipDisplay is set as true. The left end of the currently selected element is the oritin, and the coordinate unit is px.
tooltipPositionY
[defulat:cellHeight+3] Y coordinate of the tooltip. Valid when the tooltipDisplay is set as true. The upper-left corner is the origin and the coordinate unit is px.
tooltipTime
Tooltip display time. (Unit: second)
userData1
User-defined property
userData2
User-defined property
userData3
User-defined property

Event Summary

onclick
Triggered upon the end user's mouse clicking.
ondblclick
Triggered upon the end user's double-clicking.
onmouseout
Triggered upon the mouse focus moving out of a specified area or link.
onmouseover
Triggered upon the mouse moving into a specified area or link.
ontooltiphide
Triggered upon the tooltip being hidden
ontooltipshow
Triggered upon the tooltip showing

Method Summary

addClass( className )
Adds a class to the component.
bind( eventType , function )
Dynamically allocate an event and the handler function to the component.
changeClass( oldClassName , newClassName )
Renames the class from oldClassName to newClassName.
focus( )
Focuses the WebSquare component.
getAttributeNode( attributeName )
Returns the value defined through HTML attributes in order to extend the use of the tagname.
getDataListInfo( )
Returns the dataList bound with the component.
getDataType( )
Returns the dataType of the component.
getDisabled( )
Returns the current value of the disabled property.
getFormatValue( )
Returns the formatted value for the component.
getGenerator( )
In case generated by the Generator component, returns the parent Generator object that created the component itself.
getID( )
Returns the ID of the WebSquare component.
getInitStyle( CSS )
Returns the initial style of the WebSquare component.
getOpacity( )
Returns the opacity of the WebSquare component. (Supported in all WebSquare components.)
getOriginalID( )
Returns the originalID of the WebSquare component. (Supported in all WebSquare components.)
getPluginName( )
Returns the name of the WebSquare component.
getPosition( positionName )
Returns the position (left and top) of the WebSquare component.
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.)
getSize( sizeName )
Sets the size (width, height) of the WebSquare component.
getStyle( propertyName )
Returns the CSS setting of the WebSquare component.
getStyleValue( style )
[deprecated]
getTitle( )
Returns the title of the WebSquare component.
getUdcHome( )
Returns the path of the UDC file including the file name in which the UDC object is defined. (Supported in all WebSquare components.)
getUdcRoot( )
Returns the path of the UDC file in which the UDC object is defined. (Supported in all WebSquare components.)
getUserData( key )
Returns the value set by setUserData or directly defined by the user in the XML file.
getValue( )
Returns the original, unformatted value (for the specified label).
hasClass( className )
Checks whether the WebSquare component has a certain class.
hide( )
Hides the WebSquare component. (Supported in all WebSquare components.)
removeAttributeNode( ref )
Removes a child node of the corresponding nodeName from attributes.
removeClass( className )
Removes className from the component.
setAttributeNode( nodeName , nodeValue )
Sets a value in the child node of the corresponding node name in attributes node.
setDisabled( disabled )
Sets the disabled property of the WebSquare component.
setDisplayFormat( format )
Sets the displayFormat property of the component.
setDisplayFormatter( formatter )
Sets the displayFormatter property of the component.
setEventPause( evList , flag )
Pauses the event.
setInitStyle( property )
Restores the initial style of the WebSquare component.
setLocaleRef( localeRef )
Sets the localeRef.
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( title )
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 CSS of the WebSquare component.
setTitle( title )
Sets the title of the WebSquare component.
setUserData( key , value )
Sets random data in the WebSquare component.
setValue( label )
Sets the text to be displayed (defined in the label property).
show( displayType )
Shows the WebSquare component on the page. (Supported in all WebSquare components.)
toggleClass( className )
Removes a class named className, or if there is no such a class, adds a class named className.
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.
visible( flag )
[deprecated]

Property Detail

class
Same as the class property in HTML standard. One or more classes defined in the CSS file or in the style block can be applied (through the use of the space as the separator).
WebSquare5 Engine applies different classes to different components. By defining a common class, the common class can be applied to multiple components.
dataType
[default:text, number, date, time, link] Data type of the Span component values, and referred to by the properties such as displayFormat.
displayFormat
Formats the values same as in Excel file. Depends on the dataType defined in the Engine.
Cannot be used with the displayFormatter.
(Example) When the dataType is number#,###.#0 means that the comma will be added to every three digits and be of up to two decimal points.
displayFormatter
Name of the function that format 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".
escape
[true, false] Converts <>&" into HTML Escape characters. (Options) "false" (Default) Converts into HTML Escape characters. "true" Not convert into HTML Escape characters.
escapeFormatter
Name of the function that defines the customized format for the value. Allows the developer to directly control characters (such as html tag, javascript:alert) not allowed for security reasons.
Formats the value, and returns the formatted value.
Functions same as the displayFormatter except that the escapeFormatter is of the highest priority.
When defining the function in the XML file, use script lazy="false" area.
for
ID of the component to focus upon clicking of the component (or label). When this property is defined, the corresponding value will be displayed by HTML label Tag and tagname will be ignored.
id
Component ID
The component ID is allocated as a global object. The script can access each object through the component ID.
label
Text to be displayed as the value of the component.
localeRef
Defines the key of the text to be displayed on the WebSquare5 client when the multi-language feature is enabled.
>In case multi-language setting is incorrect or is not of the defined key, "global undefined" will be displayed.
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.name
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/name/@value
tabIndex
The focusing order by the Tab key.
Same as the tabindex property in HTML.
tagname
In most cases, the TextBox component uses the div tag. This field is used to use other tags than the div tag.
Used for the tag that shows values, and cannot have child tags (elements).
toolTip
Tooltip provided by WebSquare5. Displays additional information of the component. Displayed upon mouse-over.
tooltipDisplay
[default:false, true] Displays the cell data as a tooltip upon the end end user's hovering the mouse over the cell when the cell data is longer than the cell width.
tooltipFormatter
Name of the customized function to change the tooltip text when the tooltipDisplay property is true.
The user-defined function receives componentId and label, and returns the string for the tooltip.
tooltipPositionX
[defulat:20] X coordinate of the tooltip. Valid when the tooltipDisplay is set as true. The left end of the currently selected element is the oritin, and the coordinate unit is px.
A coordinate can be inserted to the calculation as well as cellWidth and cellHeight.
(Example) cellWidth/2 : The center of the body cell is the starting point on the X axis for the tooltip.
tooltipPositionY
[defulat:cellHeight+3] Y coordinate of the tooltip. Valid when the tooltipDisplay is set as true. The upper-left corner is the origin and the coordinate unit is px.
A coordinate can be inserted to the calculation as well as cellWidth and cellHeight.
(Example) cellHeight : The Y axis starts from where the body cell ends.
Note that the margin-top setting in the component style will affect Y axis.
tooltipTime
Tooltip display time. (Unit: second)
Valid in case of tooltipDisplay="true". (Related Property) tooltipDisplay="true"
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");

Event Detail

onclick
Triggered upon the end user's mouse clicking.
Parameter
nametypedescription
eObjectEvent object
ondblclick
Triggered upon the end user's double-clicking.
Parameter
nametypedescription
eObjectEvent object
onmouseout
Triggered upon the mouse focus moving out of a specified area or link.
Parameter
nametypedescription
eObjectEvent object
onmouseover
Triggered upon the mouse moving into a specified area or link.
Parameter
nametypedescription
eObjectEvent object
ontooltiphide
Triggered upon the tooltip being hidden
ontooltipshow
Triggered upon the tooltip showing

Method Detail

addClass( className )
Adds a class to the component.
Parameter
nametyperequireddescription
classNameStringYName of the class to add
Sample
componentId.addClass("selected"); Add “selected” class to the component.
bind( eventType , function )
Dynamically allocate an event and the handler function to the component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
eventTypeStringYEvent to allocate
functionFunctionYHandler function of the event
Sample
// (Example 1) // Define a function for the onclick event of input1. input1.bind("onclick", function(e){ alert(input1.getValue();})); // (Example 2) // Define commObj.ev_click function in advance. var commObj = {}; commObj.ev_click = function(e){ alert("click :: "+this.id); }; // Dynamically allocate onclick event and the handler function to input1 component. input1.bind("onclick", commObj.ev_click );
changeClass( oldClassName , newClassName )
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");
focus( )
Focuses the WebSquare component. (Supported in all WebSquare components.)
getAttributeNode( attributeName )
Returns the value defined through HTML attributes in order to extend the use of the tagname.
The HTML properties of the tag of the defined tagname can be returned. For example, properties such as id, class, or style can be returned, but the tagname property is not returned.
Parameter
nametyperequireddescription
attributeNameStringYName of the attribute
Sample
// Add an attribute using tagname as shown below. <w2:textbox id="ui_btnLogin" style="" tagname="a"> <w2:attributes> <w2:href>#</w2:href> </w2:attributes> </w2:textbox> ui_btnLogin.getAttributeNode("href"); // (Return) "#" ui_btnLogin.getAttributeNode("id"); // (Return) "ui_btnLogin" ui_btnLogin.getAttributeNode("tagname"); // (Return) null
getDataListInfo( )
Returns the dataList bound with the component.
Return
typedescription
ObjectReturns nodeset, label, and value id as an object.
Sample
// Example textbox1.getDataListInfo();
getDataType( )
Returns the dataType of the component.
Sample
// The TextBox component is defined as shown below. <w2:textbox id="textbox1" style="position: relative;" dataType="text" label="이름"></w2:textbox> var returnValue = textbox1.getDataType(); // (Return Example) "text"
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) false
getFormatValue( )
Returns the formatted value for the component.
Return
typedescription
StringFormatted value
Sample
// Apply the displayFormat. <w2:textbox id="textbox1" dataType="number" displayFormat="#,###.00" label="100000" style="position: relative;"></w2:textbox> var returnValue = textbox1.getFormatValue(); // (Return) "100,000.00"
getGenerator( )
In case generated by the Generator component, returns the parent Generator object that created the component itself. (Supported in all WebSquare components.)
Return
typedescription
ObjectParent Generator object
Sample
// (Example) The Generator (parent) create a Trigger (child). <w2:generator id="generator1"> <w2:trigger id="trigger1" ev:onclick="scwin.trigger1_onclick"></w2:trigger></w2:generator> // In the example below, upon the end user’s clicking the Trigger 1, the generator1 object will be displayed on the console. scwin.trigger1.onclick = function(){ console.log(this.getGenerator());}
getID( )
Returns the ID of the WebSquare component. (Supported in all WebSquare components.)
Return
typedescription
StringWebSquare component ID
Sample
// Upon dynamically receiving a WebSquare component, the ID can be checked as shown below. function fn_validCheck(tmpObj){ var compID = tmpObj.getID(); } // If the tmpObj in the above example has "input1" ID. // (Return) "input1"
getInitStyle( CSS )
Returns the initial style of the WebSquare component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
CSSStringNProperty (If not specified, all properties will be displayed.)
getOpacity( )
Returns the opacity of the WebSquare component. (Supported in all WebSquare components.)
The Engine returns the opacity value of the CSS.
Return
typedescription
IntegerOpacity
Sample
// Apply the opacity CSS to the InputBox component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;opacity:0.2;"></xf:input> // Return the opacity of the InputBox. var returnValue = input1.getOpacity(); // A real number between 0 and 1 will be returned. // (Return) "0.2"
getOriginalID( )
Returns the originalID of the WebSquare component. (Supported in all WebSquare components.)
The originalID is valid when the scope function is in use.
For scope="true" WFrame, component IDs inside the WFrame is changed with the prefix(wframeID + "_") being added before the ID given by the user (originalID).
The originalID means the ID before the prefix being added.
Return
typedescription
StringoriginalID of the component
Sample
// An example of multi-WFrame page // Main page with a WFrame (main.xml) <w2:wframe id="wframe1" src="text.xml" scope="true"/> // Source page to be contained in the WFrame (text.xml) <w2:textbox id="textbox1"/> // (Example) Check the Id and the original ID in the script of text.xml // Run getID. textbox1.getID(); // "wframe1_textbox1" is returned. // Run getOriginalID. textbox1.getOriginalID(); // "textbox1" is returned.
getPluginName( )
Returns the name of the WebSquare component. (Supported in all WebSquare components.)
Return
typedescription
StringName of the WebSquare component (pluginName)
Sample
// When a common function dynamically receives a WebSQuare object as shown below, different actions can be made for each component type. var commObj = {}; commObj.fn_makeReqData = function(tmpObj){ var tmpID = tmpObj.getID(); // Component ID var tmpCompType = tmpObj.getPluginName(); // Component name if(tmpCompType == "input"){ //..Logic.. }else if(tmpCompType == "gridView"){ //..Logic .. }else{ //..Logic.. } };
getPosition( positionName )
Returns the position (left and top) of the WebSquare component. (Supported in all WebSquare components.) When the position is set in 0%, the value will be converted into %.
Parameter
nametyperequireddescription
positionNameStringY[left, top] Position type
Return
typedescription
NumberPosition of the component
Sample
// CSS margin is applied to the Input component as shown below. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;margin:10px;"></xf:input> // (Example) Check the top value of the InputBox. var returnValue = input1.getPosition("top"); // Position value in pixels will be returned. // (Return) 10
getReadOnly( )
Returns the current value of the readOnly property. (Supported in all WebSquare components.)
Return
typedescription
BooleanThe current setting of the readOnly property
Sample
// Example to check the readOnly setting of the component. var returnValue = componentId.getReadOnly(); // (Return Example) false
getScope( )
For the child component of a scope="true" WFrame, returns the parent WFrame object. (Supported in all WebSquare components.)
For scope="true" WFrame, null will be returned.
Return
typedescription
ObjectWFrame object or null
Sample
// (Example) // The main page has wframe1 which contains wframe1 which also contains wframe11. // The source page of wframe11 has textbox1. textbox1.getScope(); // (Return Example) wframe11 object
getScopeWindow( )
For the child component of a scope="true" WFrame, returns the parent WFrame object. (Supported in all WebSquare components.)
If not a child of a scope="true" WFrame, a global window object will be returned.
Return
typedescription
ObjectScope object of the WFrame or a global window object
Sample
// (Example) // The main page has wframe1 which contains wframe1 which also contains wframe11. // The source page of wframe11 has textbox1. var scope = textbox1.getScopeWindow(); scope.wframe11 === textbox1.getScope(); // true
getSize( sizeName )
Sets the size (width, height) of the WebSquare component. (Supported in all WebSquare components.) If set in %, the value will be converted into pixels.
Parameter
nametyperequireddescription
sizeNameStringY[height, innerHeight, outerHeight, outerMarginHeight, width, innerWidth, outerWidth, outerMarginWidth] Position type. For the details, 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"); // (Return Example) 100 // Values are in pixels. // If set in %, values will be converted into pixels.
getStyle( propertyName )
Returns the CSS setting of the WebSquare component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
propertyNameStringYCSS property to return
Return
typedescription
StringCSS value
Sample
// Define an Input component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;"></xf:input> // (Example) Check the width of the InputBox above. var returnValue = input1.getStyle("width"); // (Return) "144px"
getStyleValue( style )
[deprecated]
Use getStyle instead.
Returns the current CSS applied to the WebSquare component.
Parameter
nametyperequireddescription
styleStringYCSS property to return
Return
typedescription
StringCSS value (Colors are returned in HexCode.)
getTitle( )
Returns the title of the WebSquare component. (Supported in all WebSquare components.)
Return
typedescription
StringTitle
Sample
// In the following example, the Title is “Input Name”. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" title="이름 입력"></xf:input> var tmpTitle = input1.getTitle(); // (Return Example ) "Input 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"); // (Reurn) "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 original, unformatted value (for the specified label).
Return
typedescription
StringValue of the textbox (Value of the label property)
Sample
// The TextBox component is defined as shown below. <w2:textbox id="textbox1" label="Pinocchio" style="position: relative;"></w2:textbox> var returnValue = textbox1.getValue(); // (Return) "Pinocchio"
hasClass( className )
Checks whether the WebSquare component has a certain class. (Supported in all WebSQuare components.)
Parameter
nametyperequireddescription
classNameStringYName of the class to check
Return
typedescription
BooleanWhether the class exists or not
Sample
// The class is directly defined in the inputBox component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" class="tmpInputClass"></xf:input> var returnValue = input1.hasClass("tmpInputClass"); // (Return) true
hide( )
Hides the WebSquare component. (Supported in all WebSquare components.)
display:none; or visibility:hidden; CSS is applied.
Sample
// (Example) Hide the component. componentId.hide();
removeAttributeNode( ref )
Removes a child node of the corresponding nodeName from attributes.
For the nodeName values, see the attributes settings in config.xml.
Parameter
nametyperequireddescription
refStringYName of the child node to remove
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");
setAttributeNode( nodeName , nodeValue )
Sets a value in the child node of the corresponding node name in attributes node.
For the values that can be used as a nodeName, follow the attributes setting in config.xml.
Parameter
nametyperequireddescription
nodeNameStringYName of the child node to set the value
nodeValueStringYValue to set
setDisabled( disabled )
Sets the disabled property of the WebSquare component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
disabledBooleanYSetting of the disabled property. (true: Used. false: Not used.)
Sample
// Sets the disabled property in the component. componentId.setDisabled(true);
setDisplayFormat( format )
Sets the displayFormat property of the component.
Parameter
nametyperequireddescription
formatStringYdisplayFormat to set
Sample
// The TextBox component is defined as shown below. <w2:textbox id="textbox1" dataType="number" displayFormat="#,###" label="1000000" style="position: relative;"></w2:textbox> // (Display) 1,000,000 // Change the value format to display "," every three digits and to display upto two decimal points. textbox1.setDisplayFormat("#,###.#0"); // (Return) 1,000,000.00
setDisplayFormatter( formatter )
Sets the displayFormatter property of the component.
Parameter
nametyperequireddescription
formatterStringYFunction for the new format
Sample
// The TextBox component is defined as shown below. <w2:textbox id="textbox1" label="hong gil dong" style="position: relative;"></w2:textbox> // Define a formatting function for textbox1 in the global script. (To capitalize the inputted value.) var commObj = {}; commObj.fn_setUpper = function(value){ value = value.toUpperCase(); return value; }; // Set the displayFormatter for textbox1. textbox1.setDisplayFormatter("commObj.fn_setUpper"); // (Return) HONG GIL DONG
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: Restart.)
Sample
// (Example 1) // Pause the onclick event. input1.setEventPause("onclick", true); // (Example 2) // Restart the onfocus and the onblur events. input1.setEventPause("onfocus,onblur", false); // (Example 3) // Pause all events registered in input1. input1.setEventPause(null, true);
setInitStyle( property )
Restores the initial style of the WebSquare component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
propertyStringNCSS property (If not spcified, all properties will be restored.)
Sample
// (Example) group1.setInitStyle();
setLocaleRef( localeRef )
Sets the localeRef.
Parameter
nametyperequireddescription
localeRefStringYlocaleRef to set
Sample
// The TextBox component is defined as shown below. <w2:textbox id="textbox1" style="position: relative;" localeRef="name"></w2:textbox> // Apply the name key in the multi-language setting of the client. textbox1.setLocaleRef("name"); // If the multi-language setting is not properly done or the name key does not exist, the following text will be displayed. // (Example) global_undefined
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
modeStringN[default: absolute, delta]
absolute (Default) : 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( title )
Sets the ref property. Add “data:” prefix to bind with a DataCollection.
If not specified, XPath of the InstanceData will be used.
Parameter
nametyperequireddescription
titleStringYPath of ref
Sample
// Bind the name key in the dataMap1 with the values of the textbox1 component. textbox1.setRef("data:dataMap1.name"); // Bind with res/userData/name of the InstanceData. textbox1.setRef("res/userData/name");
setSize( width , height )
Sets the size (width, height) of the WebSquare component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
widthNumberYWidth of the component or null.
heightNumberYHeight of the component or null.
Sample
// (Example) Set the height of the component as 100px. componentId.setSize(null,100);
setStyle( propertyName , value )
Sets the CSS of the WebSquare component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
propertyNameStringYCSS property to set.
valueStringYValue to set as the specified CSS property
Sample
// (Example 1) Set the width as 200px. componentId.setStyle("width", "200px"); // (Example 2) Set the background as olive. componentId.setStyle("background-color","olive");
setTitle( title )
Sets the title of the WebSquare component.
Parameter
nametyperequireddescription
titleStringYValue to set
Sample
// Set the title as "test". textbox1.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( label )
Sets the text to be displayed (defined in the label property).
Parameter
nametyperequireddescription
labelStringYText to display
Sample
textbox1.setValue("Pinocchio");
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
displayTypeStringN[default: block, inline, none, ""] CSS display setting.
block : display: block; 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 )
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 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 functios 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.
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;