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

Functions as a button on a web page. Provides similar interface to those provided by HTML <input> tag and type=”button”.
Depending on the type, can be displayed as a button or as an image.
- button : type="button"
- image : Consists of the table tag, and CSS applicable to each of left, center, and right. (Image link)
- anchor : Uses the highest-level anchor tag. The button text is in the span tag.

Type

uiplugin

Property Summary

anchorWithGroupClass
Applies the w2group class when the type is anchor.
centerOffImageClass
Valid only when the type is image. Define the name of the class to apply to the center td upon the mouse hovering off.
centerOnImageClass
Valid when the type is image. Define the class to be applied to the center td upon mouse-over.
class
Provides a similar feature to the class in HTML. One or more classes defined in the CSS file or the style block can be used.
disabled
[default:false, true] Disables the component.
id
ID of the component. Allocated as a global object. Scripts access the component through the ID.
leftOffImageClass
Valid only when the type is image. Define the name of the class to apply to the left td upon the mouse hovering off.
leftOnImageClass
Valid when the type is image. Define the class name on the left td upon mouse-over.
localeRef
Defines the key of the text to be displayed on the WebSquare5 client when the multi-language feature is enabled.
rightOffImageClass
Valid when the type is image. Define the class to be applied to the right td.
rightOnImageClass
Valid when the type is image. Define the class to be applied to the right td.
tabIndex
Same as the tabindex property in HTML standard. Indicates the focusing order of the component by the tab key.
toolTip
Tooltip provided by WebSquare5. Displays additional information of the component.
type
[default:button, image, anchor] rigger-displaying type. For the HTML of each type, see the below.
userData1
User-defined property
userData2
User-defined property
userData3
User-defined property

Event Summary

onblur
Triggered upon blurring of the focus.
onclick
Triggered upon clicking of the component, or pressing the Space key while the focus is on the component.
ondblclick
Triggered upon double-clicking of the component.
onfocus
Triggered upon focusing.
onkeydown
Triggered upon key-down on the component area.
onkeypress
Triggered upon key-down on the component area.
onkeyup
Triggered upon the end user's releasing a key off the keyboard after pressing the key.
onmousedown
Triggered upon the end user's clicking the mouse.
onmousemove
Triggered upon moving of the mouse pointer.
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.
onmouseup
Triggered upon the end user's unclicking the mouse (after clicking).

Method Summary

addClass( className )
Adds a class to the component.
bind( eventType , function )
Dynamically allocates events to the component.
changeClass( oldClassName , newClassName )
Renames the class from oldClassName to newClassName.
focus( )
Moves the focus to the component.
getBackgroundImage( )
Returns the background-image defined in the CSS when the type is button.
getDisabled( )
Gets the current value of the disabled property.
getGenerator( )
Called by a component under the Generator component. When called, gets the parent Generator object.
getID( )
Gets the ID of the component.
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.
getType( )
Returns the current type of the component.
getUserData( key )
Returns the user-defined property value set by setUserData as the user data or source (page XML).
getValue( )
Returns the label of the displayed component.
hasClass( className )
Checks whether the component has className received as a parameter or not.
hide( )
Hides the component.
removeClass( className )
Removes className from the component.
setBackgroundImage( imgUrl )
Sets the background image when the type is button.
setDisabled( disabled )
Sets the disabled property.
setEventPause( evList , flag )
Disables or enables the component event.
setLabel( lable )
Sets the label (value).
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.
setSize( width , heigth )
Sets the size (width, height) of the component.
setStyle( propertyName , value )
Sets the style of the specified property.
setTitle( title )
Sets the title.
setUserData( key , value )
Sets the user data in the component.
setValue( lable )
Sets the label (value).
show( displayType )
Displays the component.
toggleClass( className )
Removes a class named className, or if there is no such a class, adds a class named className.
trigger( type , array )
Triggers a certain event registered for the component.
unbind( type , function )
Removes an event registered for the component.
visible( flag )
[deprecated] Shows/Hides the component, or sets the visible property using setStyle.

Property Detail

anchorWithGroupClass
Applies the w2group class when the type is anchor.
true: Apply.
false (Default): Does not apply.
centerOffImageClass
Valid only when the type is image. Define the name of the class to apply to the center td upon the mouse hovering off.
Specify the image url in the left and the right classes. In most cases, width can be omitted.
(Example) .tmpBtnCenter{ background-image: url(/img/btn_c.png); }
centerOnImageClass
Valid when the type is image. Define the class to be applied to the center td upon mouse-over.
Specify the image url in the left and the right classes. In most cases, width can be omitted.
(Example) .tmpBtnCenterOn{ background-image: url(/img/btn_c_on.png); }
class
Provides a similar feature to the class in HTML. One or more classes defined in the CSS file or the style block can be used.
The WebSquare5 Engine has a dedicated class to each component. Using the class of the component, the developer can apply a common CSS.
disabled
[default:false, true] Disables the component.
id
ID of the component. Allocated as a global object. Scripts access the component through the ID.
leftOffImageClass
Valid only when the type is image. Define the name of the class to apply to the left td upon the mouse hovering off.
Specify the image url and thd width in the class. (When not giving width to the center td.)
(Example) .tmpBtnLeft{ background-image: url(/img/btn_l.png); width:10px; }
leftOnImageClass
Valid when the type is image. Define the class name on the left td upon mouse-over.
Specify the image url and thd width in the class. (When not giving width to the center td.)
(Example) .tmpBtnLeftOn{ background-image: url(/img/btn_l_on.png); }
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.
rightOffImageClass
Valid when the type is image. Define the class to be applied to the right td.
Specify the image url and thd width in the class. (When not giving width to the center td.)
(Example) .tmpBtnRight{ background-image: url(/img/btn_r.png); width:10px; }
rightOnImageClass
Valid when the type is image. Define the class to be applied to the right td.
Specify the image url and thd width in the class. (When not giving width to the center td.)
(Example) .tmpBtnRightOn{ background-image: url(/img/btn_r.png); width:10px; }
tabIndex
Same as the tabindex property in HTML standard. Indicates the focusing order of the component by the tab key.
toolTip
Tooltip provided by WebSquare5. Displays additional information of the component. Displayed upon mouse-over.다.
type
[default:button, image, anchor] rigger-displaying type. For the HTML of each type, see the below.
button : Uses HTML input tag. The type property is defined as button.
image : Uses the highest-level table tag. Class is applicable to left, center, and right. (See the properties starting with center, left, and right.)
anchor : Uses the highest-level anchor tag. The button text is in the span tag.
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

onblur
Triggered upon blurring of the focus.
Parameter
nametypedescription
eObjectEvent object
onclick
Triggered upon clicking of the component, or pressing the Space key while the focus is on the component.
However, when type is image, triggered only by mouse-clicking.
Parameter
nametypedescription
eObjectEvent object
ondblclick
Triggered upon double-clicking of the component.
Parameter
nametypedescription
eObjectEvent object
onfocus
Triggered upon focusing.
Parameter
nametypedescription
eObjectEvent object
onkeydown
Triggered upon key-down on the component area.
Parameter
nametypedescription
eObjectEvent object
onkeypress
Triggered upon key-down on the component area.
Parameter
nametypedescription
eObjectEvent object
onkeyup
Triggered upon the end user's releasing a key off the keyboard after pressing the key.
Parameter
nametypedescription
eObjectEvent object
onmousedown
Triggered upon the end user's clicking the mouse.
Parameter
nametypedescription
eObjectEvent object
onmousemove
Triggered upon moving of the mouse pointer.
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
onmouseup
Triggered upon the end user's unclicking the mouse (after clicking).
Parameter
nametypedescription
eObjectEvent object

Method Detail

addClass( className )
Adds a class to the component.
Parameter
nametyperequireddescription
classNameStringYName of the class to add
Sample
// Add oddClass to component input1. input1.addClass("oddClass");
bind( eventType , function )
Dynamically allocates events to the component.
Parameter
nametyperequireddescription
eventTypeStringYName of the event to allocate.
functionFunctionYHandler function of the event to allocate.
Sample
// Define the event handler function for the onclick event in the input component, and bind the function. input1.bind("onclick", function(e){ alert(input1.getValue();})); // Bind commObj.ev_click function for the onclick event with component input1. var commObj = {}; commObj.ev_click = function(e){ alert("click :: "+this.id); }; input1.bind("onclick", commObj.ev_click );
changeClass( oldClassName , newClassName )
Renames the class from oldClassName to newClassName.
In the default setting, only the classes added by addClass will be applied. In order to directly remove the class defined in the "class" property of the component, add the following setting in config.xml file.
<style><removeDefaultClass value="true" /></style>
Parameter
nametyperequireddescription
oldClassNameStringYName of the class to remove
newClassNameStringYName of the class to add
Sample
// Define a class for the Input component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" class="tmpInputClass"></xf:input> // Add the following to config.xml. <style> <removeDefaultClass value="true" /> </style> // Change tmpInputClass class to tmpInputWarninClass. input1.changeClass("tmpInputClass","tmpInputWarninClass");
focus( )
Moves the focus to the component.
getBackgroundImage( )
Returns the background-image defined in the CSS when the type is button.
Return
typedescription
StringCurrent background-image
Sample
// A background-image is defined as shown below. <xf:trigger type="button" id="trigger1" style="position:relative;width:80px;height:23px;background-image: url(/img/book1.jpg);"> <xf:label><![CDATA[click]]></xf:label> </xf:trigger> var returnValue = trigger1.getBackgroundImage(); // (Return) "url(http://localhost:9999/img/book1.jpg)"
getDisabled( )
Gets the current value of the disabled property.
Return
typedescription
BooleanThe value of the disabled property.
Sample
var returnValue = componentId.getDisabled(); (Return example) false
getGenerator( )
Called by a component under the Generator component. When called, gets the parent Generator object.
Return
typedescription
ObjectParent Generator object
Sample
<w2:generator id="generator1"> <w2:trigger id="trigger1" ev:onclick="scwin.trigger1_onclick"></w2:trigger></w2:generator> scwin.trigger1.onclick = function(){ console.log(this.getGenerator());} // Click trigger1 to display the generator1 object on the console. // See https://inswave.com/jira/browse/WPF-1425.
getID( )
Gets the ID of the component.
Return
typedescription
StringID of the WebSquare5 component
Sample
// The WebSquare5 component dynamically received as a parameter can be used as shown in the following. function fn_validCheck(tmpObj){ // tmpObj has an ID of "input1". var compID = tmpObj.getID(); // (Return Example) "input1" }
getLabel( )
Returns the label of the component. Functions same as getValue.
Return
typedescription
Stringlabel
Sample
// Define the label of trigger1 as shown below. <xf:trigger type="button" id="trigger1" style="position:relative;width:80px;height:23px;"> <xf:label><![CDATA[click]]></xf:label> </xf:trigger> var returnValue = trigger1.getLabel(); // (Return) "click"
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"
getType( )
Returns the current type of the component.
Return
typedescription
StringCurrent value of the type property
Sample
If the "type" property of the Trigger component is "button", trigger1.getType() will return button. In case of image, trigger1.getType() will return image.
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 label of the displayed component. Functions same as getLabel.
Return
typedescription
Stringlabel
Sample
// Define the label of trigger1 as shown below. <xf:trigger type="button" id="trigger1" style="position:relative;width:80px;height:23px;"> <xf:label><![CDATA[click]]></xf:label> </xf:trigger> var returnValue = trigger1.getValue(); // (Return) "click"
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 )
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");
setBackgroundImage( imgUrl )
Sets the background image when the type is button.
The specified value will be used as the background-image in the CSS.
Parameter
nametyperequireddescription
imgUrlStringYImage URL
Sample
trigger1.setBackgroundImage('/img/btn_book1.jpg');
setDisabled( disabled )
Sets the disabled property. True to disable, or false not to disable.
Parameter
nametyperequireddescription
disabledBooleanYTrue to disable, or false not to disable.
Sample
// Disable the component. componentId.setDisabled(true);
setEventPause( evList , flag )
Disables or enables the component event.
Parameter
nametyperequireddescription
evListStringNList of the events. If not specified, all user events of the component will be listed. (Enter null data.)
flagBooleanYtrue is to pause, or false is to cancel pausing.
Sample
input1.setEventPause("onclick", true); // Dynamically pauses the onclick event. input1.setEventPause("onfocus,onblur", false); // Restarts the onfocus and the onblur events. input1.setEventPause(null, true); // Pauses all user events registered for the Input component.
setLabel( lable )
Sets the label (value). Functions same as setValue.
Parameter
nametyperequireddescription
lableStringYText to display
Sample
trigger1.setLabel('search'); // (Display) "search" will be displed on the trigger.
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);
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");
setTitle( title )
Sets the title.
Parameter
nametyperequireddescription
titleStringYtitle
Sample
trigger1.setTitle('search');
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( lable )
Sets the label (value). Functions same as setLabel.
Parameter
nametyperequireddescription
lableStringYText to display
Sample
trigger1.setValue('search'); // (Display) "search" will be displed on the trigger.
show( displayType )
Displays the component.
The related CSS properties are display and visibility:show;.
Parameter
nametyperequireddescription
displayTypeStringN[default:block ,inline ,none ,""] Value of the Display property.
Sample
// Block the "display" property. componentId.show(); // Enable the "display" property in the class. componentId.show("");
toggleClass( className )
Removes a class named className, or if there is no such a class, adds a class named className.
In the default setting, only the classes added by addClass can be removed. To remove other classes, add the following setting in config.xml.
<style><removeDefaultClass value="true" /></style>
Parameter
nametyperequireddescription
classNameStringYclassName to set
Sample
// Define a class for the Input component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" class="tmpInputClass"></xf:input> // Add the following to config.xml. <style> <removeDefaultClass value="true" /> </style> // Remove tmpInputClass class. input1.toggleClass("tmpInputClass"); // Add tmpInputClass class again. input1.toggleClass("tmpInputClass");
trigger( type , array )
Triggers a certain event registered for the component.
Parameter
nametyperequireddescription
typeStringYName of the event to trigger
arrayArrayNArray of parameters to send to the event handler
Sample
// Trigger the onclick event in the input1 component. input1.trigger("onclick"); // Trigger the onviewchange event in the input component and call the event handler function by sending arguments of (1, 2). input1.trigger("onviewchange", [1,2]);
unbind( type , function )
Removes an event registered for the component.
Parameter
nametyperequireddescription
typeStringNName of the event to remove. If not specified, all events of the components will be removed.
functionFunctionNHandler function of the event to remove. If not specified, all handler functions of the event will be removed.
Sample
// Remove all events registered in the input component. input1.unbind(); // Remove all handler functions of onviewchange event registered in the input component. input1.unbind("onviewchange"); // Remove the func1 event handler of onviewchange event registered for component input1. input1.unbind("onviewchange", func1);
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.)