PropertyEventMethodIndex
WebSquare.uiplugin.dataMap - 5.0_4.4547B.20211124.201933

Used for data submissions and web pages to display data. A single object consisting of a key and a value. Has similar structure as the MAP object of JAVA.
Created under DataCollection. Divided into Key Info that defines the data structure and Data that stores the initial data.
Key Info part (source: <w2:keyInfo>) contains key information. Define the name of the key in the id property of the key.
Data part (source: <w2:data>) defines the initial data. Select the use data option (source: <w2:data use="true">) to use the defined initial data.

Type

uiplugin

Property Summary

attributeMap
Relevant only when the DataType is XML. Name of the DataMap to define an additional attribute in the rootNode. The key and the value of the DataMap will be defined as the attribute name and the attribute value of the rootNode.
baseNode
[default:map] Valid only when DataType is XML. Specifies the XPath that will serve as the root node for data conversion into XML.
defaultValue
Default key value
firstSet
Whether to set the first value set by a method (such as setValue) or the end user's input as the initial data of the DataMap if no initial data has been defined.
firstSetSubmission
Sets the data updated by setJSON or setXML API or by a submission in the DataMap.
id
DataMap ID.
idAttribute
Valid only when DataType is XML. Uses the ID of the DataMap as another attribute (to be defined here) other than ID.
length
Data length in the column
userData1
User-defined property
userData2
User-defined property
userData3
User-defined property
valueAttribute
Relevant only when the DataType is XML. Allocates the actual data to the attribute.

Event Summary

onmodelchange
Triggered when a value of a certain key is changed.
onsetdata
Triggered when data is set by setJSON or setXML or when the result of data submission is set in the target of the DataCollection.

Method Summary

bind( eventType , function )
Dynamically allocates the DataMap event.
get( key )
Gets the key ID defined in Key Info.
getArray( )
Returns the entire DataMap as an array in an order as defined in Key Info.
getCount( )
Returns the number of the keys defined in the DataMap.
getID( )
Returns the ID of a DataMap object that is same as the object ID.
getIndex( keyID )
Returns the key index of the corresponding key ID as defined in Key Info.
getInfo( )
Gets the details of the DataMap.
getJSON( )
Returns the entire data of the DataMap as JSON data.
getKey( keyIndex )
Returns the ID of the corresponding key index.
getKeyInfo( key )
Gets details of a certain key in the DataMap.
getModifiedArray( )
Returns the key array and the value array of the modified data (the data changed from the original data in the DataMap) as JSON.
getModifiedData( )
Returns the key value of the modified data (the data changed from the original data in the DataMap) as an array.
getModifiedIndex( )
Returns the key indices of the modified data (the data changed from the original data in the DataMap) as an array.
getModifiedJSON( )
Returns the keys of the modified data (the data changed from the original data in the DataMap) as JSON.
getModifiedKey( )
Returns the keys of the modified data as an array.
getModifiedXML( )
Returns the keys of the modified data (the data changed from the original data in the DataMap) as XML.
getName( keyID )
Returns the name of the corresponding key ID defined in Key Info.
getObjectType( )
Returns the type of the DataCollection.
getOption( attr )
Returns the value of the corresponding attribute defined in the DataMap.
getOriginal( KeyID )
Returns the initial value allocated to the key ID defined in Key Info.
getScope( )
Returns the parent WFrame object when the component is a child of the WFrame which uses the scope feature (scope=true). Returns null if not the child of the scoping-enabled (scope=true) WFrame.
getScopeWindow( )
Returns the scope object of the parent when the component is a child of the WFrame which uses the scope feature (scope=true). Returns the window object if not a child of the scoping-enabled (scope=true) WFrame.
getType( KeyID )
Returns the dataType of the corresponding key ID defined in Key Info.
getXML( )
Returns the entire data of the DataMap as XML.
initRowStatus( )
Initializes the dataMap status.
modifyKeyStatus( key , isModified )
Changes the status as true (modified) or false (not modified.)
redo( )
Goes back to the previous change.
reform( )
Initializes the key data of the DataMap and changes the original value into the present key data.
restore( )
Returns the data to the previous stage.
set( KeyID , KeyValue )
Sets the specified value in the corresponding key ID.
setArray( arrayData )
Sets the entire data of the DataMap as an array.
setEmptyValue( )
Checks the key values, and sets an empty value. In case a default is defined, the default will be set.
setJSON( jsonData )
Sets the entire data of the DataMap as an JSON.
setXML( xmlData )
Sets the entire data of the DataMap as XML.
trigger( eventType , paramArray )
Directly triggers the specified event registered in the DataMap.
unbind( eventType , function )
Unbinds the event from the DataMap.
undo( )
Converts the key value of the DataMap into the original data.

Property Detail

attributeMap
Relevant only when the DataType is XML. Name of the DataMap to define an additional attribute in the rootNode. The key and the value of the DataMap will be defined as the attribute name and the attribute value of the rootNode.
baseNode
[default:map] Valid only when DataType is XML. Specifies the XPath that will serve as the root node for data conversion into XML.
defaultValue
Default key value
firstSet
Whether to set the first value set by a method (such as setValue) or the end user's input as the initial data of the DataMap if no initial data has been defined.
When true, an empty value (" ") will be set. In case of "false", the the first value set by a method (such as setValue) or entered by the end user will be set as the initial value.
firstSetSubmission
Sets the data updated by setJSON or setXML API or by a submission in the DataMap.
When set true, each submission will set the updated dated in the DataMap.
id
DataMap ID.
Allocated as a global object. Used as a key to identify data in submissions and APIs.
idAttribute
Valid only when DataType is XML. Uses the ID of the DataMap as another attribute (to be defined here) other than ID.
length
Data length in the column.
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");
valueAttribute
Valid only when DataType is XML. Allocates the actual data to the attribute. (Default: textNode)

Event Detail

onmodelchange
Triggered when a value of a certain key is changed.
Parameter
nametypedescription
infoObjectObject containing key, oldValue, and newValue.
Sample
<script ev:event="onmodelchange( info )"><![CDATA[ var key = info.key; var oldValue = info.oldValue; var newValue = info.newValue; // validation logic ]]></script>
onsetdata
Triggered when data is set by setJSON or setXML or when the result of data submission is set in the target of the DataCollection.
When bound with a component, triggered before a value is set in the component.

Method Detail

bind( eventType , function )
Dynamically allocates the DataMap event.
Parameter
nametyperequireddescription
eventTypeStringYName of the event
functionFunctionYHandler function of the event to dynamically allocate
Sample
// DataMap ID is "dataMap1". dataMap1.bind("onsetdata", function(e){ alert("date setting");}); // The event function is commObj.fn_dcDataSet. dataMap1.bind("onsetdata", commObj.fn_dcDataSet );
get( key )
Gets the key ID defined in Key Info. The initial value is ""(empty string).
Parameter
nametyperequireddescription
keyStringYKey ID.
Return
typedescription
ObjectID of the key (In most cases, the return type is string and the data is returned in the initially defined data type.)
getArray( )
Returns the entire DataMap as an array in an order as defined in Key Info.
Return
typedescription
ArrayOne-dimensional array that contains the entire data of the DataMap
Sample
// DataMap Example <w2:dataMap id="dataMap1"> <w2:keyInfo> <w2:key id="name" name="이름" dataType="text"></w2:key> <w2:key id="addr" name="주소" dataType="text"></w2:key> </w2:keyInfo> <w2:data use="true"> <name>WebSquare</name> <addr></addr> </w2:data> </w2:dataMap> var tmpArr = dataMap1.getArray(); // (Return Example) ["WebSquare", ""]
getCount( )
Returns the number of the keys defined in the DataMap.
Return
typedescription
NumberNumber of the keys defined in the DataMap
getID( )
Returns the ID of a DataMap object that is same as the object ID. Same as the object ID.
Return
typedescription
StringID of the DataMap object
getIndex( keyID )
Returns the key index of the corresponding key ID as defined in Key Info.
Parameter
nametyperequireddescription
keyIDStringYID defined in Key Info
Return
typedescription
NumberIndex of the key ID
getInfo( )
Gets the details of the DataMap.
Return
typedescription
JSON{dataMapInfo : attributes, keyInfo : Object of the key attributes} JSON object
Sample
// dataMap1.getInfo();
getJSON( )
Returns the entire data of the DataMap as JSON data.
Sample
// DataMap Example <w2:dataMap id="dataMap1"> <w2:keyInfo> <w2:key id="name" name="이름" dataType="text"></w2:key> <w2:key id="addr" name="주소" dataType="text"></w2:key> </w2:keyInfo> <w2:data use="true"> <name>WebSquare</name> <addr></addr> </w2:data> </w2:dataMap> var tmpJSON = dataMap1.getJSON(); // (Return Example - (Converted into string.) {name: "WebSquare", addr: "" }
getKey( keyIndex )
Returns the ID of the corresponding key index.
Parameter
nametyperequireddescription
keyIndexNumberYKey index defined in Key Info
Return
typedescription
StringKey ID.
Sample
// DataMap Example <w2:dataMap id="dataMap1"> <w2:keyInfo> <w2:key id="name" name="이름" dataType="text"></w2:key> <w2:key id="addr" name="주소" dataType="text"></w2:key> </w2:keyInfo> <w2:data use="true"> <name>WebSquare</name> <addr></addr> </w2:data> </w2:dataMap> var tmpKeyNm = dataMap1.getKey(0); // (Return Example) "name"
getKeyInfo( key )
Gets details of a certain key in the DataMap.
Parameter
nametyperequireddescription
keyStringYKey to get the details
Return
typedescription
JSONJSON object of the corresponding key attributes
Sample
// dataList1.getKeyInfo("key1");
getModifiedArray( )
Returns the key array and the value array of the modified data (the data changed from the original data in the DataMap) as JSON. Related with firstSet attribute of the DataMap.
Return
typedescription
JSONSON containing arrays of keys and values of the data modified from the original data.
Sample
// Change the name to "Inswave". var modJsonArray = dataMap1.getModifiedArray(); // (Return Example) - (Converted into string. ) { key : ["name"] , value : ["Inswave"] }
getModifiedData( )
Returns the key value of the modified data (the data changed from the original data in the DataMap) as an array. Related with firstSet attribute of the DataMap.
Return
typedescription
ArrayAn array containing the key values of the data modified from the original data.
Sample
// Change the name to "Inswave". var modArray = dataMap1.getModifiedData(); // (Return Example) [ "Inswave" ]
getModifiedIndex( )
Returns the key indices of the modified data (the data changed from the original data in the DataMap) as an array. Related with firstSet attribute of the DataMap.
Return
typedescription
ArrayArray of the key indices of the data modified from the original data
Sample
// Change the name to "Inswave". var modArray = dataMap1.getModifiedIndex(); // (Return Example) [0]
getModifiedJSON( )
Returns the keys of the modified data (the data changed from the original data in the DataMap) as JSON. Related with firstSet attribute of the DataMap.
Return
typedescription
JSONJSON containing keys of the data modified from the original data
Sample
// Change the name to "Inswave". var modJSON = dataMap1.getModifiedJSON(); // (Return Example) - (Converted into string.) { name: "Inswave" }
getModifiedKey( )
Returns the keys of the modified data as an array. Related with firstSet attribute of the DataMap.
Return
typedescription
ArrayAn array of the keys with data different from the original data
Sample
// Change the name to "Inswave". var modKeyArr = dataMap1.getModifiedKey(); // (Return Example) ["name"]
getModifiedXML( )
Returns the keys of the modified data (the data changed from the original data in the DataMap) as XML. Related with firstSet attribute of the DataMap.
Return
typedescription
XMLXML containing the keys of the data modified from the original data.
Sample
// Change the name to "Inswave". var modXML = dataMap1.getModifiedXML(); // (Return Example) - (Converted into string.) <map id="dataMap1"><name>Inswave</name></map>
getName( keyID )
Returns the name of the corresponding key ID defined in Key Info.
Parameter
nametyperequireddescription
keyIDStringYKey ID defined in Key Info
Return
typedescription
StringKey name defined in Key Info
Sample
// DataMap Example <w2:dataMap id="dataMap1"> <w2:keyInfo> <w2:key id="name" name="이름" dataType="text"></w2:key> <w2:key id="addr" name="주소" dataType="text"></w2:key> </w2:keyInfo> </w2:dataMap> var keyName = dataMap1.getName("name"); // (Return Example) "Name"
getObjectType( )
Returns the type of the DataCollection.
Return
typedescription
String[dataMap, dataList, linkedDataList] Returns the type of the DataCollection.
Sample
var dataCollectionType = dataMap1.getObjectType(); // Get the type of the dataMap1. (Return Example) "dataMap"
getOption( attr )
Returns the value of the corresponding attribute defined in the DataMap.
Parameter
nametyperequireddescription
attrStringYName of the attribute
Return
typedescription
StringAttribute defined in the DataMap
Sample
// DataMap Example <w2:dataMap id="dataMap1" baseNode="map"> <w2:keyInfo> <w2:key id="name" name="이름" dataType="text"></w2:key> <w2:key id="addr" name="주소" dataType="text"></w2:key> </w2:keyInfo> </w2:dataMap> var tmpAttr = dataMap1.getOption("baseNode"); // (Return Example) "map"
getOriginal( KeyID )
Returns the initial value allocated to the key ID defined in Key Info.
Parameter
nametyperequireddescription
KeyIDStringYKey ID.
Return
typedescription
ObjectInitial value allocated to the Key ID (In most cases, the return type is string, and the data is returned in the initially defined data type.)
Sample
// DataMap Example <w2:dataMap id="dataMap1"> <w2:keyInfo> <w2:key id="name" name="이름" dataType="text"></w2:key> </w2:keyInfo> <w2:data use="true"> <name>WebSquare</name> </w2:data> </w2:dataMap> // Set the name value. dataMap1.set("name","inswave"); // Get the name value. //var tmpData = dataMap1.get("name"); // (Return Example) "inswave" // Get the initial value of name. var tmpOrgData = dataMap1.getOriginal("name"); // (Return Example) "WebSquare"
getScope( )
Returns the parent WFrame object when the component is a child of the WFrame which uses the scope feature (scope=true). Returns null when the component is not a child of the WFrame using the scope feature (scope=true).
Return
typedescription
Objectwframe object or null
Sample
// The main page contains wframe1 which contains wframe11 that is bound with dataMap1. dataMap1.getScope(); // Returns wframe11 object.
getScopeWindow( )
Returns the scope object of the parent when the component is a child of the WFrame which uses the scope feature (scope=true). Returns a global window object when the component is not a child of the WFrame using the scope feature (scope=true.
Return
typedescription
ObjectScope object of the wframe object, or a global window object
Sample
// The main page contains wframe1 which contains wframe11 that is bound with dataMap1. var scope = dataMap1.getScopeWindow(); scope.wframe11 === dataMap1.getScope(); // true
getType( KeyID )
Returns the dataType of the corresponding key ID defined in Key Info.
Parameter
nametyperequireddescription
KeyIDStringYKey ID.
Return
typedescription
StringdataType of the key
Sample
// DataMap Example <w2:dataMap id="dataMap1"> <w2:keyInfo> <w2:key id="name" name="이름" dataType="text"></w2:key> </w2:keyInfo> </w2:dataMap> var keyType = dataMap1.getType(); // (Return Example) "text"
getXML( )
Returns the entire data of the DataMap as XML.
Return
typedescription
XMLEntire data in XML format
Sample
// DataMap Example <w2:dataMap id="dataMap1"> <w2:keyInfo> <w2:key id="name" name="이름" dataType="text"></w2:key> <w2:key id="addr" name="주소" dataType="text"></w2:key> </w2:keyInfo> <w2:data use="true"> <name>WebSquare</name> <addr></addr> </w2:data> </w2:dataMap> var tmpXML = dataMap1.getXML(); // (Return Example) //<map id="dataMap1"> // <name>WebSquare</name> // <addr></addr> //</map>
initRowStatus( )
Initializes the dataMap status.
Sample
dataMap1.initRowStatus(); // Set the dataMap1 status as initial status. Hence, calling dataMap1.getModifiedJSON() will return an empty object.
modifyKeyStatus( key , isModified )
Changes the status as true (modified) or false (not modified.)
Parameter
nametyperequireddescription
keyStringYKey to change the status
isModifiedBooleanYNew status to set. True is for modified, and false is for not modified.
Sample
dataMap1.modifyKeyStatus("key1", false); // Sets key1 as unmodified. Results of calling dataMap1.getModifiedJSON will not include key1. dataMap1.modifyKeyStatus("key1", true); // Sets key1 as modified. Result of calling dataMap1.getModifiedJSON will include key1.
redo( )
Goes back to the previous change.
reform( )
Initializes the key data of the DataMap and changes the original value into the present key data.
restore( )
Returns the data to the previous stage.
set( KeyID , KeyValue )
Sets the specified value in the corresponding key ID.
Parameter
nametyperequireddescription
KeyIDStringYKey ID.
KeyValueStringYValue to allocate to the key
Sample
// DataMap Example <w2:dataMap id="dataMap1"> <w2:keyInfo> <w2:key id="name" name="이름" dataType="text"></w2:key> <w2:key id="addr" name="주소" dataType="text"></w2:key> </w2:keyInfo> </w2:dataMap> dataMap1.set("name","WebSquare");
setArray( arrayData )
Sets the entire data of the DataMap as an array. The value index of the array must be same with the key index defined in the DataMap.
Parameter
nametyperequireddescription
arrayDataArrayYAn array of the key values in the same key sequence and quantity as those defined in the KeyInfo.
Sample
// DataMap Example <w2:dataMap id="dataMap1"> <w2:keyInfo> <w2:key id="name" name="이름" dataType="text"></w2:key> <w2:key id="addr" name="주소" dataType="text"></w2:key> </w2:keyInfo> </w2:dataMap> dataMap1.setArray( ["WebSquare","Seoul"] ); // Normally function. dataMap1.setArray( ["WebSquare"] ); // An error occurs.
setEmptyValue( )
Checks the key values, and sets an empty value. In case a default is defined, the default will be set.
(Both the OriginalData and the current data are set with empty values.)
setJSON( jsonData )
Sets the entire data of the DataMap as JSON. Not the entire keys are necessary. Instead, the keys defined in the DataMap will be set.
Parameter
nametyperequireddescription
jsonDataJSONYEntire data of the DataMap in JSON format
Sample
// DataMap Example <w2:dataMap id="dataMap1"> <w2:keyInfo> <w2:key id="name" name="이름" dataType="text"></w2:key> <w2:key id="addr" name="주소" dataType="text"></w2:key> </w2:keyInfo> </w2:dataMap> var tmpData = { "name" : "WebSquare" }; dataMap1.setJSON( tmpData );
setXML( xmlData )
Sets the entire data of the DataMap as XML. Not the entire keys are necessary. Instead, the keys defined in the DataMap will be set.
Parameter
nametyperequireddescription
xmlDataXMLYEntire data in XML format
Sample
// DataMap Example <w2:dataMap id="dataMap1"> <w2:keyInfo> <w2:key id="name" name="이름" dataType="text"></w2:key> <w2:key id="addr" name="주소" dataType="text"></w2:key> </w2:keyInfo> </w2:dataMap> var tmpStr = "<map><name>WebSquare</name></map>"; //XML String. var tmpXML = WebSquare.xml.parse(tmpStr); // Convert into XML. dataMap1.setXML( tmpXML );
trigger( eventType , paramArray )
Directly triggers the specified event registered in the DataMap.
Parameter
nametyperequireddescription
eventTypeStringYName of the event to trigger
paramArrayArrayNParameter array for the event handler
Sample
// Trigger onmodelcahnge event in dataMap1, and call the handler function with {key: "name", oldValue: "WebSquare", newValue: "Inswave"}. dataMap1.trigger( "onmodelchange" , [ {key: "name", oldValue: "WebSquare", newValue: "Inswave"} ] );
unbind( eventType , function )
Unbinds the event from the DataMap.
Parameter
nametyperequireddescription
eventTypeStringNName of the event to remove. If not specified, all events will be deleted.
functionFunctionNEvent handler function to unbind when the function has been dynamically allocated to the event. If not specified, all handler functions of the corresponding event type will be unbound.
Sample
// Unbind the onmodelchange event in dataMap1. dataMap1.unbind("onmodelchange"); //dataMap1.bind("onmodelchange", fn_dataMapChage) is to dynamically allocate an event and the event handler. Unbind the event handler from the event as shown below. dataMap1.unbind("onmodelchange", fn_dataMapChage); // Unbind fn_dataMapChage among the onmodelchange event handler functions.
undo( )
Converts the key value of the DataMap into the original data.