PropertyEventMethodIndex
WebSquare.uiplugin.span - 5.0_1.3015A.20180410.143527

Displays a simple label. Functions same as the span tag of HTML.
Created to more easily use the span tag in the TextBox.
Functions similar to the TextBox but does not have the tagname property.

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 defines the customized format for the value.
escape
[default:false, true] Converts <>&" into HTML Escape string for display.
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.
id
ID of the component. Allocated as a global object. Scripts access the component through the 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:".
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.

Method Summary

addClass( className )
Adds a class of the specified name to the component.
bind( eventType , function )
Dynamically allocates events to the component.
changeClass( oldClassName , newClassName )
Replaces the oldClassName class with the newClassName class.
focus( )
Moves the focus to the component.
getDataType( )
Returns the dataType of the component.
getDisabled( )
Gets the current value of the disabled property.
getFormatValue( )
Returns the formatted value for the component.
getGenerator( )
Called by a component under the Generator component. When called, gets the parent Generator object.
getID( )
Gets the ID of the component.
getLabel( )
Returns the label of the component.
getOpacity( )
Gets the opacity of the component defined in CSS.
getPluginName( )
Gets the pluginName (or the name) of the component.
getPosition( positionName )
Gets the left or top position of the component.
getReadOnly( )
Gets the current setting of the readOnly property.
getSize( sizeName )
Gets the size of the component.
getStyle( propertyName )
Gets the current value of the propertyName of the component defined in CSS.
getStyleValue( style )
[deprecated] Use getStyle instead.
getTitle( )
Gets the title value.
getUserData( key )
Returns the user-defined property value set by setUserData as the user data or source (page XML).
getValue( )
Returns the original, unformatted value (for the specified label).
hasClass( className )
Checks whether the component has className received as a parameter or not.
hide( )
Hides the component.
removeClass( className )
Deletes a class of the specified name from the component.
setDisabled( disabled )
Sets the disabled property.
setDisplayFormat( format )
Sets the displayFormat property of the component.
setDisplayFormatter( formatter )
Sets the displayFormatter in the component.
setEventPause( evList , flag )
Disables or enables the component event.
setLabel( label )
Changes the value of the label property.
setLocaleRef( localeRef )
Sets the localeRef.
setOpacity( value )
Sets the opacity of the component.
setPosition( left , top , mode )
Sets the position (left, top) of the component.
setReadOnly( readOnly )
Controls the "readOnly" property.
setRef( ref )
Sets the ref property.
setSize( width , heigth )
Sets the size (width, height) of the component.
setStyle( propertyName , value )
Sets the style of the specified property.
setUserData( key , value )
Sets the user data in the component.
setValue( label )
Sets the text to be displayed (defined in the label property).
show( displayType )
Displays the component.
toggleClass( className )
Removes the class of the corresponding className from the component. If there is no such a class, a class of the corresponding className will be added.
trigger( type , array )
Triggers a certain event registered for the component.
unbind( type , function )
Removes an event registered for the component.
unbindRef( )
Releases the ref binding.
visible( flag )
[deprecated] Shows/Hides the component, or sets the visible property using setStyle.

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 defines the customized format for the value.
Formats the value, and returns the formatted value.
(Example) Define a function fn_inputFormat (tmpVal){ return tmpVal+" 님" }; in the global script, and define the displayFormatter as fn_inputFormat.
escape
[default:false, true] Converts <>&" into HTML Escape string for display.
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.
id
ID of the component. Allocated as a global object. Scripts access the component through the 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
userData1
User-defined property. Use getUserData("userData1") to get the data.
userData2
User-defined property. Use getUserData("userData2") to get the data.
userData3
User-defined property. Use getUserData("userData3") to get the data.

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

Method Detail

addClass( className )
Adds a class of the specified name 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 allocates events to the component.
Parameter
nametyperequireddescription
eventTypeStringYName of the event to allocate.
functionFunctionYHandler function of the event to allocate.
Sample
// Define the event handler function for the onclick event in the input component, and bind the function. input1.bind("onclick", function(e){ alert(input1.getValue();})); // Bind commObj.ev_click function for the onclick event with component input1. var commObj = {}; commObj.ev_click = function(e){ alert("click :: "+this.id); }; input1.bind("onclick", commObj.ev_click );
changeClass( oldClassName , newClassName )
Replaces the oldClassName class with the newClassName class.
Parameter
nametyperequireddescription
oldClassNameStringYName of the class to remove from the element
newClassNameStringYName of the class to add
Sample
componentId.changeClass("selected","default"); Replaces the oldClassName class with the newClassName class.
focus( )
Moves the focus to the component.
getDataType( )
Returns the dataType of the component.
getDisabled( )
Gets the current value of the disabled property.
Return
typedescription
BooleanThe value of the disabled property.
Sample
var returnValue = componentId.getDisabled(); (Return example) false
getFormatValue( )
Returns the formatted value for the component.
Return
typedescription
StringFormatted value
Sample
// Apply a displayFormat to the Span. <w2:span id="span11" dataType="number" displayFormat="#,###.00" label="100000" style="position: relative;"></w2:span> var returnValue = span1.getFormatValue(); // (Return) "100,000.00"
getGenerator( )
Called by a component under the Generator component. When called, gets the parent Generator object.
Return
typedescription
ObjectParent Generator object
Sample
<w2:generator id="generator1"> <w2:trigger id="trigger1" ev:onclick="scwin.trigger1_onclick"></w2:trigger></w2:generator> scwin.trigger1.onclick = function(){ console.log(this.getGenerator());} // Click trigger1 to display the generator1 object on the console. // See https://inswave.com/jira/browse/WPF-1425.
getID( )
Gets the ID of the component.
Return
typedescription
StringID of the WebSquare5 component
Sample
// The WebSquare5 component dynamically received as a parameter can be used as shown in the following. function fn_validCheck(tmpObj){ // tmpObj has an ID of "input1". var compID = tmpObj.getID(); // (Return Example) "input1" }
getLabel( )
Returns the label of the component. Functions same as getValue.
Return
typedescription
StringLabel of the span
Sample
// Define a Span as shown below. <w2:span id="span01" label="Pinocchio" style="position: relative;"></w2:span> var returnValue = span1.getLabel(); // (Return) "Pinocchio"
getOpacity( )
Gets the opacity of the component defined in CSS.
Return
typedescription
IntegerOpacity
Sample
// Apply opacity CSS to the Input component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;opacity:0.2;"></xf:input> var returnValue = input1.getOpacity(); // "returnValue" is a real number between 0 and 1. // (Return Value) "0.2"
getPluginName( )
Gets the pluginName (or the name) of the component.
Return
typedescription
StringpluginName of the WebSquare5 component
Sample
// For a WebSquare5 object dynamically received by a common function, conditional statements can be used as shown below. var commObj = {}; commObj.fn_makeReqData = function(tmpObj){ var tmpID = tmpObj.getID(); // Component ID var tmpCompType = tmpObj.getPluginName(); // Component Type if(tmpCompType == "input"){ //..Logic.. }else if(tmpCompType == "gridView"){ //..Logic .. }else{ //..Logic.. } };
getPosition( positionName )
Gets the left or top position of the component. If set by %, the corresponding pixel value will be returned.
Parameter
nametyperequireddescription
positionNameStringY[left,top] Type of the position
Return
typedescription
NumberPosition of the component
Sample
// Apply margin CSS to the Input component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;margin:10px;"></xf:input> var returnValue = input1.getPosition("top"); // The returnValue will be a position in pixels. // (Return Example) 10
getReadOnly( )
Gets the current setting of the readOnly property.
Return
typedescription
BooleanThe current setting of the readOnly property
Sample
var returnValue = componentId.getReadOnly(); // (Return Example) false
getSize( sizeName )
Gets the size of the component. If set by "%", the corresponding pixel value will be returned.
Parameter
nametyperequireddescription
sizeNameStringY[height, innerHeight, outerHeight, outerMarginHeight, width, innerWidth, outerWidth, outerMarginWidth] Type of the size. For the calculation of each size type, see below.
height : element.clientHeight innerHeight : element.clientHeight + padding outerHeight : element.clientHeight + padding + border outerMarginHeight : element.clientHeight + padding + border + margin width : element.clientWidth innerWidth : element.clientWidth + padding outerWidth : element.clientWidth + padding + border outerMarginWidth : element.clientWidth + padding + border + margin
Return
typedescription
NumberSize of the component
Sample
var returnValue = componentId.getSize("width"); // "returnValue" will be a size in pixels. If set by "%", the corresponding pixel value will be returned. // (Return Example) 100
getStyle( propertyName )
Gets the current value of the propertyName of the component defined in CSS.
Parameter
nametyperequireddescription
propertyNameStringYName of the property in the style
Return
typedescription
StringStyle value
Sample
// Define an Input component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;"></xf:input> var returnValue = input1.getStyle("width"); // (Return Example) "144px"
getStyleValue( style )
[deprecated] Use getStyle instead.
Gets the current value of the propertyName of the component defined in CSS.
Parameter
nametyperequireddescription
styleStringYName of the property defined in the style
Return
typedescription
StringValue defined in the style property. (In case of a color, the hexcode of the color will be returned.)
getTitle( )
Gets the title value.
Return
typedescription
StringTitle value
Sample
// Define the "title" for the Input component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" title="이름 입력"></xf:input> var tmpTitle = input1.getTitle(); // (Return Example ) "Input Name"
getUserData( key )
Returns the user-defined property value set by setUserData as the user data or source (page XML).
Parameter
nametyperequireddescription
keyStringYRandom data key
Return
typedescription
StringData of the corresponding key
Sample
// Apply the customized property (eduTest) to the Input component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" eduTest="Hello"></xf:input> input1.getUserData("eduTest"); // (Return Example) "Hello" // Use setUserData. input1.setUserData("eduTest","WebSquare"); input1.getUserData("WebSquare"); // (Return Example) "Hello"
getValue( )
Returns the original, unformatted value (for the specified label).
Return
typedescription
StringSpan value (Value of the label property)
Sample
// Define a span as shown below. <w2:span id="span1" dataType="number" displayFormat="#,###.00" label="100000" style="position: relative;"></w2:span> var returnValue = span1.getValue(); // (Return)"100000"
hasClass( className )
Checks whether the component has className received as a parameter or not.
Parameter
nametyperequireddescription
classNameStringYclassName to check
Return
typedescription
BooleanWhether the component has the class or not
Sample
// Define a class for the Input component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" class="tmpInputClass"></xf:input> var returnValue = input1.hasClass("tmpInputClass"); // (Return Example) true
hide( )
Hides the component.
he CSS setting will be "display:none;" and "visibility:hidden;".
Sample
componentId.hide();
removeClass( className )
Deletes a class of the specified name from the component.
Parameter
nametyperequireddescription
classNameStringYName of the class to remove
Sample
componentId.removeClass("selected"); Removes “selected” class from the component.
setDisabled( disabled )
Sets the disabled property. True to disable, or false not to disable.
Parameter
nametyperequireddescription
disabledBooleanYTrue to disable, or false not to disable.
Sample
// Disable the component. componentId.setDisabled(true);
setDisplayFormat( format )
Sets the displayFormat property of the component.
Parameter
nametyperequireddescription
formatStringYdisplayFormat to set
Sample
// Define a span as shown below. <w2:span id="textbox1" dataType="number" label="1000000" style="position: relative;"></w2:span> // (Return) 1000000 // dd a comma to every three digits and display up to two decimal poits. span.setDisplayFormat("#,###.#0"); // (Return) 1,000,000.00
setDisplayFormatter( formatter )
Sets the displayFormatter in the component.
Parameter
nametyperequireddescription
formatterStringYFunction for the new format
Sample
// Define a span as shown below. <w2:span id="span1" label="hong gil dong" style="position: relative;"></w2:span> // 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 span1. span1.setDisplayFormatter("commObj.fn_setUpper"); // (Return) HONG GIL DONG
setEventPause( evList , flag )
Disables or enables the component event.
Parameter
nametyperequireddescription
evListStringNList of the events. If not specified, all user events of the component will be listed. (Enter null data.)
flagBooleanYtrue is to pause, or false is to cancel pausing.
Sample
input1.setEventPause("onclick", true); // Dynamically pauses the onclick event. input1.setEventPause("onfocus,onblur", false); // Restarts the onfocus and the onblur events. input1.setEventPause(null, true); // Pauses all user events registered for the Input component.
setLabel( label )
Changes the value of the label property. Functions same as setValue.
Parameter
nametyperequireddescription
labelStringYText to display
Sample
span1.setLabel("WebSquare");
setLocaleRef( localeRef )
Sets the localeRef.
Parameter
nametyperequireddescription
localeRefStringYlocaleRef to set
Sample
// Define a Span as shown below. <w2:span id="span1" style="position: relative;" localeRef="name"></w2:span> // Apply the name key in the multi-language setting of the client. span1.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 of the component.
Parameter
nametyperequireddescription
valueNumberYOpacity value (A real number between 0 and 1)
Sample
componentId.setOpacity(0.45);
setPosition( left , top , mode )
Sets the position (left, top) of the component.
Parameter
nametyperequireddescription
leftNumberYLeft position or null.
topNumberYTop position or null.
modeStringN[defulat:absolute, delta] absolute sets the current positions as x and y, and delta adds x and y to the current positions.
Sample
// Set the top position of the component as 100 pixels. componentId.setPosition(null, 100);
setReadOnly( readOnly )
Controls the "readOnly" property. True to enable, or false to disable.
Parameter
nametyperequireddescription
readOnlyBooleanYTrue to enable, or false to disable.
Sample
// Enable the read-only. componentId.setReadOnly(true);
setRef( ref )
Sets the ref property.
Parameter
nametyperequireddescription
refStringYpath of ref to apply
Sample
// Bind the name key in the dataMap1 with the values of the textbox1 component. span1.setRef("data:dataMap1.name"); // Bind with res/userData/name of the InstanceData. span1.setRef("res/userData/name");
setSize( width , heigth )
Sets the size (width, height) of the component.
Parameter
nametyperequireddescription
widthNumberYComponent width or null
heigthNumberYComponent height or null
Sample
// Set the component height as 100 pixels. componentId.setSize(null,100);
setStyle( propertyName , value )
Sets the style of the specified property.
Parameter
nametyperequireddescription
propertyNameStringYName of the style
valueStringYValue of the style
Sample
// Set the component width as 200px. componentId.setStyle("width", "200px"); // Change the background color to olive. componentId.setStyle("background-color","olive");
setUserData( key , value )
Sets the user data in the component. If the key cannot be set for the component, corresponding logs will be displayed.
Parameter
nametyperequireddescription
keyStringYRandom data key
valueStringYRandom data key
Sample
// Setting a (key, value) pair of ("data", "WebSquare5") in the component. componentId.setUserData("data", "WebSquare"); // Some keys cannot be set for the component. componentId.setUserData("title", "WebSquare"); // (Log Example) !!!WARNING - [title] can't define as UserData
setValue( label )
Sets the text to be displayed (defined in the label property).
Parameter
nametyperequireddescription
labelStringYText to display
Sample
span1.setValue("Pinocchio");
show( displayType )
Displays the component.
The related CSS properties are display and visibility:show;.
Parameter
nametyperequireddescription
displayTypeStringN[default:block ,inline ,none ,""] Value of the Display property.
Sample
// Block the "display" property. componentId.show(); // Enable the "display" property in the class. componentId.show("");
toggleClass( className )
Removes a class named className, or if there is no such a class, adds a class named className.
Parameter
nametyperequireddescription
classNameStringYclassName to check
Sample
componentId.toggleClass("selected"); Removes the class of the corresponding className from the component. If there is no such a class, a class of the corresponding className will be added.
trigger( type , array )
Triggers a certain event registered for the component.
Parameter
nametyperequireddescription
typeStringYName of the event to trigger
arrayArrayNArray of parameters to send to the event handler
Sample
// Trigger the onclick event in the input1 component. input1.trigger("onclick"); // Trigger the onviewchange event in the input component and call the event handler function by sending arguments of (1, 2). input1.trigger("onviewchange", [1,2]);
unbind( type , function )
Removes an event registered for the component.
Parameter
nametyperequireddescription
typeStringNName of the event to remove. If not specified, all events of the components will be removed.
functionFunctionNHandler function of the event to remove. If not specified, all handler functions of the event will be removed.
Sample
// Remove all events registered in the input component. input1.unbind(); // Remove all handler functions of onviewchange event registered in the input component. input1.unbind("onviewchange"); // Remove the func1 event handler of onviewchange event registered for component input1. input1.unbind("onviewchange", func1);
unbindRef( )
Releases the ref binding.
visible( flag )
[deprecated] Shows/Hides the component, or sets the visible property using setStyle.
Sets the visibility of the component style. In case of true, set visible. In case of false, set hidden.
Parameter
nametyperequireddescription
flagBooleanYVisibility (In case of true, set visible. In case of false, set hidden.)